[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Smoother time slider

Kasper (Sep 12, 2024, 2:08 AM +0200) 04ed2db4 0925b17a

+9 -1
+1
src/components/Slider.svelte
··· 66 66 > 67 67 <div class="pointer-events-none relative w-full rounded-full bg-gray-700" bind:this={bar}> 68 68 <div class="w-full overflow-hidden rounded-full"> 69 + <!-- I tried the Web Animation API, but somehow that resulted in higher CPU usage --> 69 70 <div 70 71 class="relative -left-full h-1 w-full rounded-full bg-gray-300 transition-colors duration-100 will-change-transform group-hover:bg-[hsl(217,100%,60%)] group-active:bg-[hsl(217,100%,60%)]" 71 72 style:translate="{(internal_value / max) * 100}%"
+8 -1
src/lib/player.ts
··· 76 76 } 77 77 })() 78 78 79 - audio.ontimeupdate = () => { 79 + function update_time() { 80 80 currentTime.set(audio.currentTime) 81 + if (!audio.paused) { 82 + requestAnimationFrame(update_time) 83 + } 84 + } 85 + 86 + audio.onplay = () => { 87 + requestAnimationFrame(update_time) 81 88 } 82 89 83 90 audio.addEventListener('error', async (e) => {