Skip to content

Commit

Permalink
Merge pull request #871 from tutors-sdk/ux/links-style
Browse files Browse the repository at this point in the history
animation effect
  • Loading branch information
edeleastar authored Nov 28, 2024
2 parents 35b6951 + e2c7c02 commit a7cc0d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/routes/(home)/CourseList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@
<div class="card container mx-auto my-1 p-4">
<p class="p-4 text-2xl">Favourites</p>
<div class="mx-auto grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3">
{#each courseVisits as courseVisit}
{#if courseVisit.favourite}
{#each courseVisits.filter((cv) => cv.favourite) as courseVisit (courseVisit.id)}
<div animate:flip={{ duration: 300 }}>
<CourseVisitCard {courseVisit} {deleteCourse} {starUnstarCourse} />
{/if}
</div>
{/each}
</div>

<p class="p-4 text-2xl">Recently accessed</p>
<div class="mx-auto grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3">
{#each courseVisits as courseVisit}
{#if !courseVisit.favourite}
{#each courseVisits.filter((cv) => !cv.favourite) as courseVisit (courseVisit.id)}
<div animate:flip={{ duration: 300 }}>
<CourseVisitCard {courseVisit} {deleteCourse} {starUnstarCourse} />
{/if}
</div>
{/each}
</div>
</div>
5 changes: 4 additions & 1 deletion src/routes/(home)/CourseVisitCard.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<script>
import Iconify from "@iconify/svelte";
import { cubicIn, cubicOut } from "svelte/easing";
import { fade, scale } from "svelte/transition";
let { courseVisit, deleteCourse, starUnstarCourse } = $props(); // Using prop rune syntax
let { courseVisit, deleteCourse, starUnstarCourse } = $props();
</script>

<div
transition:scale|local={{ duration: 300, start: 0.8, easing: cubicOut }}
class="to-accent-50 dark:to-accent-900 card card-hover from-primary-50 dark:from-primary-900 m-2 border bg-gradient-to-l p-2"
>
<div class="flex justify-between">
Expand Down

0 comments on commit a7cc0d9

Please sign in to comment.