Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Add flip animation to /models route
Browse files
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>
|