generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/#118-preset-save-save-preset-button-a…
…nd-text-box
- Loading branch information
Showing
18 changed files
with
246 additions
and
267 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
Apps/frontend/cypress/e2e/3-control-panel-top/distribute-button.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe("distributeButton", () => { | ||
beforeEach(() => { | ||
cy.visit("http://localhost:5173/"); | ||
}); | ||
|
||
it("is visible", () => { | ||
cy.get(".control-panel--top_general").should("be.visible"); | ||
cy.get('[data-cy="distribute-button"]').should("be.visible"); | ||
}); | ||
|
||
it("is clickable", () => { | ||
cy.get('[data-cy="distribute-button"]').click(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
Apps/frontend/src/components/DistributeOffsetButton.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script> | ||
import { NUM_CHANNELS } from "../const"; | ||
import { channelActivated, offsetAdjustment } from "../stores"; | ||
function calculateOffset() { | ||
// offset is calculated based on the number of channels between -1 and 1 | ||
return 2 / ($channelActivated.filter(Boolean).length + 1); | ||
} | ||
</script> | ||
|
||
<button | ||
class="icon-button mui-icon--distribute" | ||
on:click={() => { | ||
let baseOffset = calculateOffset(); | ||
let offsetY = 1 - baseOffset; | ||
for (let index = 0; index < NUM_CHANNELS; index++) { | ||
if ($channelActivated[index]) { | ||
$offsetAdjustment[index] = offsetY; | ||
offsetY -= baseOffset; | ||
} | ||
} | ||
}} | ||
data-cy="distribute-button" | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script> | ||
import Switch from "svelte-toggle"; | ||
import { LINE_COLORS_RGBA } from "../const.js"; | ||
import { channelActivated } from "../stores.js"; | ||
export let channel; | ||
let color = LINE_COLORS_RGBA[channel]; | ||
</script> | ||
|
||
<div class="control-panel--bottom_switch" data-cy="startStopSwitch-{channel}"> | ||
<Switch | ||
hideLabel | ||
small | ||
bind:toggled={$channelActivated[channel]} | ||
toggledColor={color} | ||
/> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.