Skip to content
This repository has been archived by the owner on Jun 24, 2023. It is now read-only.

Commit

Permalink
feat: add control handling with stepped rings
Browse files Browse the repository at this point in the history
  • Loading branch information
V-ed committed Jul 23, 2022
1 parent 3b75e7c commit 4b72a9d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
import Timer from './lib/Timer.svelte';
let isActive = false;
let ringScale = 1.2;
let ringSpeed = 4000;
let ringThickness = 70;
let curr = 4;
const ringScaleArr = [1, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 2.2, 2.2];
const ringSpeedArr = [4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 2000, 2000, 1700];
const ringThicknessArr = [35, 40, 40, 45, 50, 50, 50, 55, 55, 60, 60, 65, 70, 70, 80];
// let secondsBeforeNotMoreIndicator = 20;
let secondsBeforeNotMoreIndicator = 5;
Expand All @@ -27,10 +29,10 @@
}
function handleLeftControl() {
console.log('pls Left');
curr = Math.max(curr - 1, 0);
}
function handleRightControl() {
console.log('pls Right');
curr = Math.min(curr + 1, 14);
}
</script>

Expand All @@ -42,7 +44,7 @@
<div
class="wifi-logo"
class:active={isActive}
style="--ring-scale: {ringScale}; --ring-speed: {ringSpeed}ms; --ring-thickness: {ringThickness}%;"
style="--ring-scale: {ringScaleArr[curr]}; --ring-speed: {ringSpeedArr[curr]}ms; --ring-thickness: {ringThicknessArr[curr]}%;"
/>
</div>

Expand Down

0 comments on commit 4b72a9d

Please sign in to comment.