Skip to content

Commit 0e7ea5c

Browse files
committed
update sounds
1 parent 47af44f commit 0e7ea5c

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎apps/codingcatdev/src/routes/(home-partials)/LightChange.svelte‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts">
2-
import { gsap } from 'gsap-trial/dist/gsap';
3-
import { MorphSVGPlugin } from 'gsap-trial/dist/MorphSVGPlugin';
4-
import { Draggable } from 'gsap-trial/dist/Draggable';
2+
import { gsap } from 'gsap';
3+
import { Draggable } from 'gsap/Draggable';
54
import { onMount } from 'svelte';
65
76
import { modeCurrent, setModeUserPrefers, setModeCurrent } from '@codingcatdev/blackcatui';
@@ -13,14 +12,15 @@
1312
}
1413
1514
onMount(() => {
16-
gsap.registerPlugin(MorphSVGPlugin);
15+
gsap.registerPlugin(Draggable);
1716
1817
// Used to calculate distance of "tug"
1918
let startX = 0;
2019
let startY = 0;
2120
2221
const AUDIO = {
23-
CLICK: new Audio('/sounds/click.mp3')
22+
ON: new Audio('/sounds/switch-on.mp3'),
23+
OFF: new Audio('/sounds/switch-off.mp3')
2424
};
2525
const STATE = {
2626
ON: $modeCurrent
@@ -54,19 +54,18 @@
5454
5555
onToggleHandler();
5656
57-
AUDIO.CLICK.play();
57+
STATE.ON ? AUDIO.ON.play() : AUDIO.OFF.play();
5858
},
5959
onComplete: () => {
6060
gsap.set([DUMMY, HIT], { display: 'block' });
6161
gsap.set(CORDS[0], { display: 'none' });
6262
RESET();
6363
}
6464
});
65-
65+
console.log(CORDS);
6666
for (let i = 1; i < CORDS.length; i++) {
6767
CORD_TL.add(
6868
gsap.to(CORDS[0], {
69-
morphSVG: CORDS[i],
7069
duration: CORD_DURATION,
7170
repeat: 1,
7271
yoyo: true
-1.85 KB
Binary file not shown.

0 commit comments

Comments
 (0)