adf0d17497
publish / version_or_publish (push) Has been cancelled
storybook-build / changes (push) Has been cancelled
storybook-build / :storybook-build (push) Has been cancelled
Sync Gradio Skills to Hugging Face / sync-skills (push) Has been cancelled
functional / changes (push) Has been cancelled
functional / build-frontend (push) Has been cancelled
functional / functional-test-SSR=false (push) Has been cancelled
functional / functional-reload (push) Has been cancelled
js / changes (push) Has been cancelled
js / js-test (push) Has been cancelled
docs-build / changes (push) Has been cancelled
docs-build / docs-build (push) Has been cancelled
docs-build / website-build (push) Has been cancelled
functional / functional-test-SSR=true (push) Has been cancelled
hygiene / hygiene-test (push) Has been cancelled
python / changes (push) Has been cancelled
python / build (push) Has been cancelled
python / test-ubuntu-latest-flaky (push) Has been cancelled
python / test-ubuntu-latest-not-flaky (push) Has been cancelled
python / test-windows-latest-flaky (push) Has been cancelled
python / test-windows-latest-not-flaky (push) Has been cancelled
108 lines
2.2 KiB
Svelte
108 lines
2.2 KiB
Svelte
<script lang="ts">
|
|
import { spring } from "svelte/motion";
|
|
|
|
interface Props {
|
|
margin?: boolean;
|
|
}
|
|
|
|
let { margin = true }: Props = $props();
|
|
|
|
const top = spring([0, 0]);
|
|
const bottom = spring([0, 0]);
|
|
|
|
let dismounted = $state(false);
|
|
|
|
async function animate(): Promise<void> {
|
|
await Promise.all([top.set([125, 140]), bottom.set([-125, -140])]);
|
|
await Promise.all([top.set([-125, 140]), bottom.set([125, -140])]);
|
|
await Promise.all([top.set([-125, 0]), bottom.set([125, -0])]);
|
|
await Promise.all([top.set([125, 0]), bottom.set([-125, 0])]);
|
|
}
|
|
|
|
async function run(): Promise<void> {
|
|
await animate();
|
|
if (!dismounted) run();
|
|
}
|
|
|
|
async function loading(): Promise<void> {
|
|
await Promise.all([top.set([125, 0]), bottom.set([-125, 0])]);
|
|
|
|
run();
|
|
}
|
|
|
|
$effect(() => {
|
|
loading();
|
|
return () => {
|
|
dismounted = true;
|
|
};
|
|
});
|
|
</script>
|
|
|
|
<div class:margin>
|
|
<svg
|
|
viewBox="-1200 -1200 3000 3000"
|
|
fill="none"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<g style="transform: translate({$top[0]}px, {$top[1]}px);">
|
|
<path
|
|
d="M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"
|
|
fill="#FF7C00"
|
|
fill-opacity="0.4"
|
|
/>
|
|
<path
|
|
d="M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"
|
|
fill="#FF7C00"
|
|
/>
|
|
<path
|
|
d="M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"
|
|
fill="#FF7C00"
|
|
fill-opacity="0.4"
|
|
/>
|
|
<path
|
|
d="M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"
|
|
fill="#FF7C00"
|
|
/>
|
|
</g>
|
|
<g style="transform: translate({$bottom[0]}px, {$bottom[1]}px);">
|
|
<path
|
|
d="M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"
|
|
fill="#FF7C00"
|
|
fill-opacity="0.4"
|
|
/>
|
|
<path
|
|
d="M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"
|
|
fill="#FF7C00"
|
|
/>
|
|
<path
|
|
d="M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"
|
|
fill="#FF7C00"
|
|
fill-opacity="0.4"
|
|
/>
|
|
<path
|
|
d="M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"
|
|
fill="#FF7C00"
|
|
/>
|
|
</g>
|
|
</svg>
|
|
</div>
|
|
|
|
<style>
|
|
svg {
|
|
width: var(--size-20);
|
|
height: var(--size-20);
|
|
}
|
|
|
|
svg path {
|
|
fill: var(--loader-color);
|
|
}
|
|
|
|
div {
|
|
z-index: var(--layer-2);
|
|
}
|
|
|
|
.margin {
|
|
margin: var(--size-4);
|
|
}
|
|
</style>
|