Layout is looking pretty slick now!
This commit is contained in:
@@ -17,7 +17,8 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if song && displayMode === 'horizontal'}
|
{#if song && displayMode === 'horizontal'}
|
||||||
<div class="grid w-full grid-cols-3 grid-rows-1 items-center gap-10 overflow-hidden bg-black px-6 text-lg" style="height: 80px;" transition:slide={{ axis: 'y' }}>
|
<div class="w-full p-4">
|
||||||
|
<div class="grid w-full grid-cols-3 grid-rows-1 items-center gap-10 overflow-hidden rounded-xl bg-neutral-950 px-6 text-lg" style="height: 80px;" transition:slide={{ axis: 'y' }}>
|
||||||
<section class="flex h-full w-full items-center justify-start gap-4 py-2.5 text-sm">
|
<section class="flex h-full w-full items-center justify-start gap-4 py-2.5 text-sm">
|
||||||
<img class="h-full rounded-lg object-contain" src={song.image} alt="{song.name} thumbnail" />
|
<img class="h-full rounded-lg object-contain" src={song.image} alt="{song.name} thumbnail" />
|
||||||
<div class="flex h-full flex-col justify-center gap-1 overflow-hidden">
|
<div class="flex h-full flex-col justify-center gap-1 overflow-hidden">
|
||||||
@@ -79,9 +80,10 @@
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{:else if song && displayMode === 'vertical'}
|
{:else if song && displayMode === 'vertical'}
|
||||||
<div class="w-full p-2" style="height: 80px;" transition:slide={{ axis: 'y' }}>
|
<div class="w-full p-2" style="height: 80px;" transition:slide={{ axis: 'y' }}>
|
||||||
<div class="flex h-full justify-between rounded-xl bg-slate-900 p-2.5">
|
<div class="flex h-full justify-between rounded-xl bg-neutral-950 p-2.5">
|
||||||
<section class="flex gap-4">
|
<section class="flex gap-4">
|
||||||
<img class="h-full rounded-xl object-contain" src={song.image} alt="{song.name} thumbnail" />
|
<img class="h-full rounded-xl object-contain" src={song.image} alt="{song.name} thumbnail" />
|
||||||
<div class="flex h-full flex-col justify-center gap-1 overflow-hidden text-lg">
|
<div class="flex h-full flex-col justify-center gap-1 overflow-hidden text-lg">
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<search
|
<search
|
||||||
role="search"
|
role="search"
|
||||||
bind:this={searchBar}
|
bind:this={searchBar}
|
||||||
class="relative flex h-full w-full max-w-xl items-center gap-2.5 justify-self-center rounded-full border-2 border-transparent px-4 py-1.5"
|
class="relative flex h-full w-full items-center gap-2.5 justify-self-center rounded-full border-2 border-transparent bg-black px-4 py-2"
|
||||||
on:focusout={() => {
|
on:focusout={() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// This is a completely stupid thing you have to do, if there is not timeout, the active element will be the body of the document and not the newly focused element
|
// This is a completely stupid thing you have to do, if there is not timeout, the active element will be the body of the document and not the newly focused element
|
||||||
@@ -68,9 +68,3 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</search>
|
</search>
|
||||||
|
|
||||||
<style>
|
|
||||||
search {
|
|
||||||
background-color: rgba(100, 100, 100, 0.25);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<script>
|
<script>
|
||||||
import Navbar from '$lib/components/utility/navbar.svelte'
|
|
||||||
import MiniPlayer from '$lib/components/media/miniPlayer.svelte'
|
import MiniPlayer from '$lib/components/media/miniPlayer.svelte'
|
||||||
import { fly, fade } from 'svelte/transition'
|
import { fly, fade } from 'svelte/transition'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
@@ -12,17 +11,13 @@
|
|||||||
header: 'Home',
|
header: 'Home',
|
||||||
icon: 'fa-solid fa-house',
|
icon: 'fa-solid fa-house',
|
||||||
},
|
},
|
||||||
'/artist': {
|
|
||||||
header: 'Artists',
|
|
||||||
icon: 'fa-solid fa-guitar',
|
|
||||||
},
|
|
||||||
'/playlist': {
|
|
||||||
header: 'Playlists',
|
|
||||||
icon: 'fa-solid fa-bars-staggered',
|
|
||||||
},
|
|
||||||
'/library': {
|
'/library': {
|
||||||
header: 'Libray',
|
header: 'Libray',
|
||||||
icon: 'fa-solid fa-book-open',
|
icon: 'fa-solid fa-bars-staggered',
|
||||||
|
},
|
||||||
|
'/search': {
|
||||||
|
header: 'Search',
|
||||||
|
icon: 'fa-solid fa-search',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,9 +44,19 @@
|
|||||||
|
|
||||||
const calculateBar = (activeTab) => {
|
const calculateBar = (activeTab) => {
|
||||||
if (activeTab && indicatorBar && tabList) {
|
if (activeTab && indicatorBar && tabList) {
|
||||||
|
if ($pageWidth >= 768) {
|
||||||
|
const listRect = tabList.getBoundingClientRect()
|
||||||
|
const tabRec = activeTab.getBoundingClientRect()
|
||||||
|
if (direction === 1) {
|
||||||
|
indicatorBar.style.bottom = `${listRect.bottom - tabRec.bottom}px`
|
||||||
|
setTimeout(() => (indicatorBar.style.top = `${tabRec.top - listRect.top}px`), pageTransitionTime)
|
||||||
|
} else {
|
||||||
|
indicatorBar.style.top = `${tabRec.top - listRect.top}px`
|
||||||
|
setTimeout(() => (indicatorBar.style.bottom = `${listRect.bottom - tabRec.bottom}px`), pageTransitionTime)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
const listRect = tabList.getBoundingClientRect()
|
const listRect = tabList.getBoundingClientRect()
|
||||||
const tabRec = activeTab.getBoundingClientRect()
|
const tabRec = activeTab.getBoundingClientRect()
|
||||||
indicatorBar.style.top = `${listRect.height}px`
|
|
||||||
if (direction === 1) {
|
if (direction === 1) {
|
||||||
indicatorBar.style.right = `${listRect.right - tabRec.right}px`
|
indicatorBar.style.right = `${listRect.right - tabRec.right}px`
|
||||||
setTimeout(() => (indicatorBar.style.left = `${tabRec.left - listRect.left}px`), pageTransitionTime)
|
setTimeout(() => (indicatorBar.style.left = `${tabRec.left - listRect.left}px`), pageTransitionTime)
|
||||||
@@ -61,54 +66,72 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="main-grid" class="h-full">
|
|
||||||
<Navbar />
|
|
||||||
<section id="content-grid" class="overflow-hidden">
|
|
||||||
<section id="sidebar">
|
|
||||||
{#if $pageWidth >= 768}
|
{#if $pageWidth >= 768}
|
||||||
<div class="mr-4 flex h-full flex-col gap-8 rounded-lg px-3 py-6">
|
<div id="content-grid" class="h-full overflow-hidden">
|
||||||
|
<section class="relative mr-4 flex h-full flex-col gap-6 rounded-lg px-3 py-6" bind:this={tabList}>
|
||||||
{#each Object.entries(contentTabs) as [page, tabData]}
|
{#each Object.entries(contentTabs) as [page, tabData]}
|
||||||
<button
|
{#if data.url === page}
|
||||||
class="{data.url === page ? 'pointer-events-none text-white' : 'text-neutral-400 hover:text-lazuli-primary'} aspect-square w-14 transition-colors"
|
<button bind:this={activeTab} class="pointer-events-none aspect-square w-14 text-white transition-colors" disabled="true">
|
||||||
disabled={data.url === page}
|
|
||||||
on:click={() => goto(page)}
|
|
||||||
>
|
|
||||||
<i class="{tabData.icon} text-xl" />
|
<i class="{tabData.icon} text-xl" />
|
||||||
<span class="text-xs">{tabData.header}</span>
|
<span class="text-xs">{tabData.header}</span>
|
||||||
</button>
|
</button>
|
||||||
|
{:else}
|
||||||
|
<button class="aspect-square w-14 text-neutral-400 transition-colors hover:text-lazuli-primary" on:click={() => goto(page)}>
|
||||||
|
<i class="{tabData.icon} text-xl" />
|
||||||
|
<span class="text-xs">{tabData.header}</span>
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
<!-- {#if data.url in contentTabs}
|
{#if data.url in contentTabs}
|
||||||
<div bind:this={indicatorBar} transition:fade class="absolute h-0.5 bg-lazuli-primary transition-all duration-300 ease-in-out" />
|
<div bind:this={indicatorBar} transition:fade class="absolute left-0 w-[0.2rem] rounded-full bg-white transition-all duration-300 ease-in-out" />
|
||||||
{/if} -->
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
</section>
|
</section>
|
||||||
|
<section class="no-scrollbar relative overflow-y-scroll">
|
||||||
|
{#key previousPage}
|
||||||
|
<div in:fly={{ y: -50 * direction, duration: pageTransitionTime, delay: pageTransitionTime }} out:fly={{ y: 50 * direction, duration: pageTransitionTime }} class="absolute w-full pr-[5vw] pt-16">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
{/key}
|
||||||
|
</section>
|
||||||
|
<footer class="fixed bottom-0 flex w-full flex-col items-center justify-center">
|
||||||
|
<MiniPlayer displayMode={'horizontal'} />
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="h-full overflow-hidden">
|
||||||
{#key previousPage}
|
{#key previousPage}
|
||||||
<section
|
<section
|
||||||
id="page"
|
|
||||||
in:fly={{ x: 200 * direction, duration: pageTransitionTime, delay: pageTransitionTime }}
|
in:fly={{ x: 200 * direction, duration: pageTransitionTime, delay: pageTransitionTime }}
|
||||||
out:fly={{ x: -200 * direction, duration: pageTransitionTime }}
|
out:fly={{ x: -200 * direction, duration: pageTransitionTime }}
|
||||||
class="no-scrollbar h-full overflow-y-scroll px-[5vw] pt-4 md:pl-[0rem]"
|
class="no-scrollbar h-full overflow-y-scroll px-[5vw] pt-16"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</section>
|
</section>
|
||||||
{/key}
|
{/key}
|
||||||
</section>
|
|
||||||
<footer class="fixed bottom-0 flex w-full flex-col items-center justify-center">
|
<footer class="fixed bottom-0 flex w-full flex-col items-center justify-center">
|
||||||
<MiniPlayer displayMode={$pageWidth > 768 ? 'horizontal' : 'vertical'} />
|
<MiniPlayer displayMode={'vertical'} />
|
||||||
{#if $pageWidth < 768}
|
<div bind:this={tabList} id="bottom-tab-list" class="relative flex w-full items-center justify-around bg-black">
|
||||||
<h1 id="tabList" class="relative flex w-full items-center justify-around bg-black">
|
|
||||||
{#each Object.entries(contentTabs) as [page, tabData]}
|
{#each Object.entries(contentTabs) as [page, tabData]}
|
||||||
<button class="{data.url === page ? 'pointer-events-none text-white' : 'text-neutral-400 hover:text-lazuli-primary'} transition-colors" disabled={data.url === page} on:click={() => goto(page)}>
|
{#if data.url === page}
|
||||||
|
<button bind:this={activeTab} class="pointer-events-none text-white transition-colors" disabled="true">
|
||||||
|
<i class={tabData.icon} />
|
||||||
|
</button>
|
||||||
|
{:else}
|
||||||
|
<button class="text-neutral-400 transition-colors hover:text-lazuli-primary" on:click={() => goto(page)}>
|
||||||
<i class={tabData.icon} />
|
<i class={tabData.icon} />
|
||||||
</button>
|
</button>
|
||||||
{/each}
|
|
||||||
</h1>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
{/each}
|
||||||
|
{#if data.url in contentTabs}
|
||||||
|
<div bind:this={indicatorBar} transition:fade class="absolute bottom-0 h-1 rounded-full bg-white transition-all duration-300 ease-in-out" />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#content-grid {
|
#content-grid {
|
||||||
@@ -116,12 +139,7 @@
|
|||||||
grid-template-columns: max-content auto;
|
grid-template-columns: max-content auto;
|
||||||
grid-template-rows: 100%;
|
grid-template-rows: 100%;
|
||||||
}
|
}
|
||||||
#main-grid {
|
#bottom-tab-list {
|
||||||
display: grid;
|
|
||||||
grid-template-rows: max-content auto;
|
|
||||||
grid-template-columns: 100%;
|
|
||||||
}
|
|
||||||
#tabList {
|
|
||||||
padding: 16px 0px;
|
padding: 16px 0px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
|
|||||||
1
src/routes/(app)/search/+page.svelte
Normal file
1
src/routes/(app)/search/+page.svelte
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h1>Search Page</h1>
|
||||||
Reference in New Issue
Block a user