design: animate dock changes
This commit is contained in:
1 parent
09d1e3ee6d
commit
eb00921060
2 files changed
+36
-14
No files matched your search
@@ -7,8 +7,6 @@
|
|||||||
isAdmin,
|
isAdmin,
|
||||||
} from '$lib/components/lemmy/moderation/moderation.js'
|
} from '$lib/components/lemmy/moderation/moderation.js'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import Logo from '$lib/components/ui/Logo.svelte'
|
|
||||||
import { LINKED_INSTANCE_URL, instance } from '$lib/instance.js'
|
|
||||||
import { site } from '$lib/lemmy.js'
|
import { site } from '$lib/lemmy.js'
|
||||||
import { Menu, MenuButton, MenuDivider, Spinner } from 'mono-svelte'
|
import { Menu, MenuButton, MenuDivider, Spinner } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
@@ -21,13 +19,16 @@
|
|||||||
Plus,
|
Plus,
|
||||||
ServerStack,
|
ServerStack,
|
||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import { fly } from 'svelte/transition'
|
|
||||||
import Profile from './Profile.svelte'
|
import Profile from './Profile.svelte'
|
||||||
import NavButton from './NavButton.svelte'
|
import NavButton from './NavButton.svelte'
|
||||||
|
import { scale } from 'svelte/transition'
|
||||||
|
import { expoOut, backOut } from 'svelte/easing'
|
||||||
|
import { flip } from 'svelte/animate'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
class="flex flex-row gap-2 items-center w-full mx-auto p-1 z-50 box-border h-16
|
class="flex flex-row gap-2 items-center w-full mx-auto z-50 box-border h-16
|
||||||
|
p-1 duration-150
|
||||||
{$$props.class}
|
{$$props.class}
|
||||||
"
|
"
|
||||||
style={$$props.style}
|
style={$$props.style}
|
||||||
@@ -45,15 +46,36 @@
|
|||||||
class="px-2 border-r border-l border-slate-200 dark:border-zinc-900
|
class="px-2 border-r border-l border-slate-200 dark:border-zinc-900
|
||||||
flex flex-row items-center gap-2 flex-shrink overflow-hidden max-[500px]:hidden"
|
flex flex-row items-center gap-2 flex-shrink overflow-hidden max-[500px]:hidden"
|
||||||
>
|
>
|
||||||
{#each $profile.favorites ?? [] as favorite}
|
{#each $profile.favorites ?? [] as favorite (favorite.id)}
|
||||||
<NavButton href={favorite.url.toString()} label="Community">
|
<div
|
||||||
<Avatar
|
class="h-9 w-9 flex"
|
||||||
alt={favorite.name}
|
transition:scale|global={{
|
||||||
url={favorite.avatar}
|
start: 0.7,
|
||||||
res={64}
|
easing: backOut,
|
||||||
width={28}
|
duration: 400,
|
||||||
/>
|
delay: 200,
|
||||||
</NavButton>
|
}}
|
||||||
|
animate:flip={{
|
||||||
|
easing: backOut,
|
||||||
|
duration: 400,
|
||||||
|
delay: 100,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<NavButton
|
||||||
|
class="w-full h-full bg-slate-100 dark:bg-zinc-900"
|
||||||
|
title={favorite.name}
|
||||||
|
href={favorite.url.toString()}
|
||||||
|
label="Community"
|
||||||
|
>
|
||||||
|
<Avatar
|
||||||
|
alt={favorite.name}
|
||||||
|
url={favorite.avatar}
|
||||||
|
res={64}
|
||||||
|
width={28}
|
||||||
|
class="w-full"
|
||||||
|
/>
|
||||||
|
</NavButton>
|
||||||
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
if (favs.length >= 3) favs.pop()
|
if (favs.length >= 3) favs.pop()
|
||||||
favs.push({
|
favs.unshift({
|
||||||
avatar: data.community.community_view.community.icon,
|
avatar: data.community.community_view.community.icon,
|
||||||
id: data.community.community_view.community.id,
|
id: data.community.community_view.community.id,
|
||||||
url: $page.url,
|
url: $page.url,
|
||||||
|
|||||||
Reference in new issue
Block a user