diff --git a/src/app.css b/src/app.css index e383a5e..db7b98e 100644 --- a/src/app.css +++ b/src/app.css @@ -38,7 +38,7 @@ --youtube-red: #ff0000; } -@media screen and (max-width: 640px) { +@media screen and (max-width: 768px) { :root { font-size: 0.7rem; } diff --git a/src/lib/components/media/mediaCard.svelte b/src/lib/components/media/mediaCard.svelte index a5a7b29..c341646 100644 --- a/src/lib/components/media/mediaCard.svelte +++ b/src/lib/components/media/mediaCard.svelte @@ -3,7 +3,7 @@ import Services from '$lib/services.json' import IconButton from '$lib/components/utility/iconButton.svelte' - import { backgroundImage } from '$lib/utils/stores.js' + import { backgroundImage, currentlyPlaying } from '$lib/utils/stores.js' const iconClasses = { song: 'fa-solid fa-music', @@ -19,7 +19,7 @@ const x = (2 * (event.x - cardRect.left)) / cardRect.width - 1 // These are simplified calculations to find the x-y coords relative to the center of the card const y = (2 * (cardRect.top - event.y)) / cardRect.height + 1 - let angle = Math.atan(x / y) // You'd think it should be y / x but it's actually the inverse + const angle = Math.atan(x / y) // You'd think it should be y / x but it's actually the inverse const distanceFromCorner = Math.sqrt((x - 1) ** 2 + (y - 1) ** 2) // This is a cool little trick, the -1 on the x an y coordinate is effective the same as saying "make the origin of the glare [1, 1]" cardGlare.style.backgroundImage = `linear-gradient(${angle}rad, transparent ${distanceFromCorner * 50 + 50}%, rgba(255, 255, 255, 0.1) ${distanceFromCorner * 50 + 60}%, transparent 100%)` @@ -40,7 +40,12 @@ {/if}
- ($backgroundImage = mediaData.image)}> + { + $currentlyPlaying = mediaData + $backgroundImage = mediaData.image + }} + > diff --git a/src/lib/components/media/miniPlayer.svelte b/src/lib/components/media/miniPlayer.svelte new file mode 100644 index 0000000..49ece70 --- /dev/null +++ b/src/lib/components/media/miniPlayer.svelte @@ -0,0 +1,102 @@ + + +{#if song} +
+ {#if displayMode === 'vertical'} +

Vertical Mode

+ {:else} +
+
+ {song.name} thumbnail +
+
{song.name}
+
{Array.from(song.artists, (artist) => artist.name).join(', ')}
+
+ +
+
+ + + + + + + ($currentlyPlaying = null)}> + + + + + +
+
+
+ { + volume = event.detail.value + setVolume(volume) + }} + /> + +
+ + + +
+
+ {/if} +
+{/if} + + diff --git a/src/lib/components/media/scrollableCardMenu.svelte b/src/lib/components/media/scrollableCardMenu.svelte index 7bdde29..fc7ef94 100644 --- a/src/lib/components/media/scrollableCardMenu.svelte +++ b/src/lib/components/media/scrollableCardMenu.svelte @@ -6,7 +6,12 @@ import IconButton from '$lib/components/utility/iconButton.svelte' let scrollable, + scrollableWidth, + isScrollable = false, scrollpos = 0 + + $: isScrollable = scrollable?.scrollWidth > scrollableWidth + $: scrollpos = scrollable?.scrollLeft / (scrollable?.scrollWidth - scrollableWidth)
@@ -15,16 +20,17 @@

{header}

{/if}
- (scrollable.scrollLeft -= scrollable.clientWidth)}> + (scrollable.scrollLeft -= scrollable.clientWidth)}> - 0.99} on:click={() => (scrollable.scrollLeft += scrollable.clientWidth)}> + 0.99 || !isScrollable} on:click={() => (scrollable.scrollLeft += scrollable.clientWidth)}>
(scrollpos = scrollable.scrollLeft / (scrollable.scrollWidth - scrollable.clientWidth))} class="no-scrollbar flex gap-6 overflow-y-hidden overflow-x-scroll scroll-smooth py-4" > diff --git a/src/lib/components/utility/footer.svelte b/src/lib/components/utility/footer.svelte new file mode 100644 index 0000000..0c7830e --- /dev/null +++ b/src/lib/components/utility/footer.svelte @@ -0,0 +1,12 @@ +
+ +
+ + diff --git a/src/lib/components/utility/navbar.svelte b/src/lib/components/utility/navbar.svelte index 532e6e7..9f3fe3d 100644 --- a/src/lib/components/utility/navbar.svelte +++ b/src/lib/components/utility/navbar.svelte @@ -2,46 +2,35 @@ import IconButton from './iconButton.svelte' import { goto } from '$app/navigation' import { page } from '$app/stores' - - let windowY = 0 - -