-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Page Transition and Component Animation (#9)
* feat: add view transition for page transition, add install btns animation * feat(desktop): add extension store logo cross-page transition with gasp Flip
- Loading branch information
1 parent
ad83e89
commit 11cc796
Showing
21 changed files
with
252 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
apps/desktop/src/lib/components/dance/dance-transition.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script lang="ts"> | ||
import { Layouts } from "@kksh/ui" | ||
import { cn } from "@kksh/ui/utils" | ||
import { onMount } from "svelte" | ||
import { fade } from "svelte/transition" | ||
import Dance from "./dance.svelte" | ||
let { | ||
duration = 400, | ||
class: className, | ||
delay = 0, | ||
show = $bindable(true), | ||
autoHide = true | ||
}: { | ||
duration?: number | ||
class?: string | ||
delay?: number | ||
show?: boolean | ||
autoHide?: boolean | ||
} = $props() | ||
onMount(() => { | ||
setTimeout(() => { | ||
if (autoHide) show = false | ||
}, delay ?? 0) | ||
}) | ||
</script> | ||
|
||
{#if show} | ||
<div out:fade={{ duration, delay }}> | ||
<Layouts.Center class={cn("bg-background absolute h-screen w-screen", className)} hidden={true}> | ||
<Dance /> | ||
</Layouts.Center> | ||
</div> | ||
{/if} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import { Constants } from "@kksh/ui" | ||
import { afterNavigate, beforeNavigate } from "$app/navigation" | ||
import { gsap } from "gsap" | ||
import { Flip } from "gsap/Flip" | ||
gsap.registerPlugin(Flip) | ||
let flipState: Flip.FlipState | ||
beforeNavigate(() => { | ||
flipState = Flip.getState(`.${Constants.CLASSNAMES.EXT_LOGO}`) | ||
}) | ||
afterNavigate(() => { | ||
if (!flipState) { | ||
return | ||
} | ||
Flip.from(flipState, { | ||
targets: ".kk-ext-logo", | ||
duration: 0.5, | ||
absolute: true, | ||
scale: true, | ||
ease: "ease-out" | ||
}) | ||
}) | ||
const { children } = $props() | ||
</script> | ||
|
||
{@render children?.()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.