Skip to content

Commit 7fb7ff1

Browse files
committed
feat: colors
1 parent cdde25a commit 7fb7ff1

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

src/lib/colors.svelte

-31
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
import type { voiceType } from './types';
55
export let voice: voiceType;
66
7-
<<<<<<< Updated upstream
8-
let osc: Tone.Oscillator | undefined = undefined;
9-
let touchStartY: number = 0;
10-
let value: number = 0;
11-
=======
127
let valueInDb: number = -Infinity;
138
$: {
149
valueInDb = 20 * Math.log10(value);
@@ -18,35 +13,17 @@
1813
let osc: Tone.Oscillator | undefined = undefined;
1914
// let touchStart: number = 0;
2015
let value: number = -100;
21-
>>>>>>> Stashed changes
2216
2317
onMount(() => {
2418
if (osc) return;
2519
import('tone').then((Tone) => {
2620
osc = new Tone.Oscillator(voice.note, 'sine').toDestination();
2721
});
2822
});
29-
<<<<<<< Updated upstream
30-
// $: console.log(value);
31-
=======
32-
>>>>>>> Stashed changes
3323
</script>
3424

3525
<button
3626
on:touchstart={(e) => {
37-
<<<<<<< Updated upstream
38-
touchStartY = e.changedTouches[0].clientY;
39-
}}
40-
on:touchmove={(e) => {
41-
const touch = e.changedTouches[0];
42-
const directionY = touchStartY < touch.clientY ? 'down' : 'up';
43-
// const directionX = touchStartX < touch.screenX ? 'left' : 'right';
44-
if (directionY == 'up' && value == 0) return;
45-
if (directionY == 'down' && value < 100) {
46-
value += 1;
47-
}
48-
if (directionY == 'up' && value > 0) value -= 1;
49-
=======
5027
// touchStart = e.changedTouches[0].clientX;
5128
if (osc) osc.start();
5229
}}
@@ -60,7 +37,6 @@
6037
0
6138
);
6239
if (osc) osc.volume.linearRampTo(value, 0.1);
63-
>>>>>>> Stashed changes
6440
}}
6541
class="flex justify-center items-center"
6642
>
@@ -69,12 +45,5 @@
6945
<rect width="100" height="100" fill={voice.color} />
7046
<text x="10" y="60" font-size="35" fill="white">{value}</text>
7147
</g>
72-
<<<<<<< Updated upstream
73-
<!-- <g>
74-
<rect x="0" y="0" width="100" height="100" fill="red"></rect>
75-
<text x="0" y="50" font-family="Verdana" font-size="35" fill="blue">Hello</text>
76-
</g> -->
77-
=======
78-
>>>>>>> Stashed changes
7948
</svg>
8049
</button>

0 commit comments

Comments
 (0)