Skip to content

Commit 4916971

Browse files
committed
fixed safari things
1 parent af952ab commit 4916971

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/lib/PlayPause.svelte

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
let right: SVGPathElement | null = null;
55
let play: SVGPathElement | null = null;
66
let first = true;
7+
let playTimeout = 0;
78
let animate = (el: SVGPathElement, from: string, to: string, reverse: boolean) => {
89
let anim: SVGAnimateElement | null = el.querySelector('animate');
910
if (!anim) {
@@ -40,7 +41,14 @@
4041
'M 49.9 30, L 85 50, l 0 0, L 49.9 70, Z',
4142
playing
4243
);
43-
animate(play, 'M 50 50, l 0 0, l 0 0, Z', 'M 15 10, L 85 50, L 15 90, Z', playing);
44+
if (!playing) {
45+
playTimeout = window.setTimeout(() => {
46+
play.setAttribute('d', 'M 15 10, L 85 50, L 15 90, Z');
47+
}, 200);
48+
} else {
49+
play.setAttribute('d', 'M 50 50, l 0 0, l 0 0, Z');
50+
window.clearTimeout(playTimeout);
51+
}
4452
}
4553
$: {
4654
if (left && right && play) transition(left, right, play, playing);
@@ -62,7 +70,5 @@
6270
<path bind:this={right} d="M 49.9 30, L 85 50, l 0 0, L 49.9 70, Z">
6371
<animate attributeName="d" dur="0.2s" fill="freeze" begin="indefinite" />
6472
</path>
65-
<path bind:this={play} d="M 15 10, L 85 50, L 15 90, Z">
66-
<animate attributeName="d" dur="0.2s" fill="freeze" begin="indefinite" />
67-
</path>
73+
<path bind:this={play} d="M 15 10, L 85 50, L 15 90, Z" />
6874
</svg>

src/routes/styles/reset.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,7 @@ h6 {
6868
#__next {
6969
isolation: isolate;
7070
}
71+
72+
* {
73+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
74+
}

0 commit comments

Comments
 (0)