Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
add-animate-flip-everywhere
#14
by
blanchon
- opened
src/lib/components/models/autocomplete/Autocomplete.svelte
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
import type { ModelCard } from "$lib/type";
|
4 |
import Icon from "@iconify/svelte";
|
5 |
import Item from "./Item.svelte";
|
|
|
6 |
|
7 |
export let defaultModels: ModelCard[] = [];
|
8 |
export let onChange: (model: ModelCard | null) => void;
|
@@ -78,14 +79,16 @@
|
|
78 |
>
|
79 |
{#if search?.length >= 3}
|
80 |
{#if models?.length > 0}
|
81 |
-
{#each models as model}
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
89 |
{/each}
|
90 |
{:else}
|
91 |
<div class="flex items-center justify-center flex-col gap-2 p-3">
|
|
|
3 |
import type { ModelCard } from "$lib/type";
|
4 |
import Icon from "@iconify/svelte";
|
5 |
import Item from "./Item.svelte";
|
6 |
+
import { flip } from 'svelte/animate';
|
7 |
|
8 |
export let defaultModels: ModelCard[] = [];
|
9 |
export let onChange: (model: ModelCard | null) => void;
|
|
|
79 |
>
|
80 |
{#if search?.length >= 3}
|
81 |
{#if models?.length > 0}
|
82 |
+
{#each models as model (model.id)}
|
83 |
+
<span animate:flip={{ duration: 200 }}>
|
84 |
+
<Item
|
85 |
+
model={model}
|
86 |
+
onClick={() => {
|
87 |
+
open = false;
|
88 |
+
onChange(model)
|
89 |
+
}}
|
90 |
+
/>
|
91 |
+
</span>
|
92 |
{/each}
|
93 |
{:else}
|
94 |
<div class="flex items-center justify-center flex-col gap-2 p-3">
|
src/routes/gallery/+layout.svelte
CHANGED
@@ -12,6 +12,7 @@
|
|
12 |
import { userStore } from "$lib/stores/use-user";
|
13 |
import { onMount } from "svelte";
|
14 |
import type { CommunityCard } from "$lib/type";
|
|
|
15 |
|
16 |
let data: {
|
17 |
cards: CommunityCard[],
|
@@ -85,8 +86,13 @@
|
|
85 |
</div>
|
86 |
<!-- mx-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4 3xl:grid-cols-5 gap-5 mt-8 lg:mt-10 -->
|
87 |
<div class="mx-auto flex flex-wrap gap-5 mt-8 lg:mt-10 justify-center md:justify-start">
|
88 |
-
{#each data.cards as card}
|
89 |
-
<
|
|
|
|
|
|
|
|
|
|
|
90 |
{/each}
|
91 |
<InfiniteScroll
|
92 |
elementScroll="{elementScroll ?? undefined}"
|
|
|
12 |
import { userStore } from "$lib/stores/use-user";
|
13 |
import { onMount } from "svelte";
|
14 |
import type { CommunityCard } from "$lib/type";
|
15 |
+
import { flip } from "svelte/animate";
|
16 |
|
17 |
let data: {
|
18 |
cards: CommunityCard[],
|
|
|
86 |
</div>
|
87 |
<!-- mx-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4 3xl:grid-cols-5 gap-5 mt-8 lg:mt-10 -->
|
88 |
<div class="mx-auto flex flex-wrap gap-5 mt-8 lg:mt-10 justify-center md:justify-start">
|
89 |
+
{#each data.cards as card (card.id)}
|
90 |
+
<span
|
91 |
+
class="h-[400px] max-w-[400px] md:h-[350px] md:max-w-[350px] w-full"
|
92 |
+
animate:flip={{ duration: 200 }}
|
93 |
+
>
|
94 |
+
<Card {card} {form} displayDelete={$userStore?.is_admin} />
|
95 |
+
</span>
|
96 |
{/each}
|
97 |
<InfiniteScroll
|
98 |
elementScroll="{elementScroll ?? undefined}"
|
src/routes/models/+layout.svelte
CHANGED
@@ -17,6 +17,7 @@
|
|
17 |
import type { ModelCard } from "$lib/type";
|
18 |
import { userStore } from "$lib/stores/use-user";
|
19 |
import Add from "$lib/components/community/reactions/Add.svelte";
|
|
|
20 |
|
21 |
let data: {
|
22 |
models: ModelCard[],
|
@@ -132,8 +133,14 @@
|
|
132 |
<Input value={form.search} placeholder="Filter by model name" onChange={handleChangeSearch} />
|
133 |
</div>
|
134 |
<div class="mx-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 2xl:grid-cols-4 gap-5 mt-8 lg:mt-10">
|
135 |
-
{#each data.models as card}
|
136 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
{/each}
|
138 |
{#if data.models.length === 0}
|
139 |
<p class="text-neutral-400 text-left w-full">No models found</p>
|
|
|
17 |
import type { ModelCard } from "$lib/type";
|
18 |
import { userStore } from "$lib/stores/use-user";
|
19 |
import Add from "$lib/components/community/reactions/Add.svelte";
|
20 |
+
import { flip } from "svelte/animate";
|
21 |
|
22 |
let data: {
|
23 |
models: ModelCard[],
|
|
|
133 |
<Input value={form.search} placeholder="Filter by model name" onChange={handleChangeSearch} />
|
134 |
</div>
|
135 |
<div class="mx-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 2xl:grid-cols-4 gap-5 mt-8 lg:mt-10">
|
136 |
+
{#each data.models as card (card.id)}
|
137 |
+
<span
|
138 |
+
class="h-[400px] max-w-[400px] md:h-[350px] md:max-w-[350px] w-full"
|
139 |
+
animate:flip={{ duration: 200 }}
|
140 |
+
>
|
141 |
+
<Card {card}/>
|
142 |
+
</span>
|
143 |
+
<!-- <Card card={card} /> -->
|
144 |
{/each}
|
145 |
{#if data.models.length === 0}
|
146 |
<p class="text-neutral-400 text-left w-full">No models found</p>
|
src/routes/saved-generations/+page.svelte
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
import Card from "$lib/components/community/Card.svelte";
|
3 |
import GoTop from "$lib/components/GoTop.svelte";
|
4 |
import GalleryViewer from "$lib/components/community/viewer/Viewer.svelte";
|
|
|
5 |
|
6 |
export let data
|
7 |
</script>
|
@@ -16,8 +17,10 @@
|
|
16 |
Saved generations ({data.total_items})
|
17 |
</h1>
|
18 |
<div class="mx-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 2xl:grid-cols-4 gap-5 mt-8 lg:mt-10">
|
19 |
-
{#each data.cards as card}
|
20 |
-
<
|
|
|
|
|
21 |
{/each}
|
22 |
<GoTop />
|
23 |
</div>
|
|
|
2 |
import Card from "$lib/components/community/Card.svelte";
|
3 |
import GoTop from "$lib/components/GoTop.svelte";
|
4 |
import GalleryViewer from "$lib/components/community/viewer/Viewer.svelte";
|
5 |
+
import { flip } from "svelte/animate";
|
6 |
|
7 |
export let data
|
8 |
</script>
|
|
|
17 |
Saved generations ({data.total_items})
|
18 |
</h1>
|
19 |
<div class="mx-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 2xl:grid-cols-4 gap-5 mt-8 lg:mt-10">
|
20 |
+
{#each data.cards as card (card.id)}
|
21 |
+
<div animate:flip={{ duration: 200 }}>
|
22 |
+
<Card {card} displayReactions={false} displayDelete={true} displayPublish={true} />
|
23 |
+
</div>
|
24 |
{/each}
|
25 |
<GoTop />
|
26 |
</div>
|