File tree Expand file tree Collapse file tree
apps/codingcatdev/src/routes/(home-partials)/(home-podcast) Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { inView } from ' $lib/actions/inView' ;
23 import type { Podcast } from ' $lib/types' ;
4+ import { fly } from ' svelte/transition' ;
35 import GitLineGradient from ' ../(home-campaign)/GitLineGradient.svelte' ;
46 import PodcastCard from ' ./PodcastCard.svelte' ;
57 import PodcastSvg from ' ./PodcastSvg.svelte' ;
68 export let podcasts: Podcast [];
9+ let visible = false ;
710 </script >
811
912<section class =" bg-surface-800-100-token text-surface-100-800-token relative" >
1417 <PodcastSvg />
1518 <GitLineGradient rotate ={true } />
1619 </div >
17- <div class =" basis-11/12 pl-4 sm:pl-2 pt-8 sm:pt-20 pb-96 lg:mb-72" >
20+ <div
21+ class =" basis-11/12 pl-4 sm:pl-2 pt-8 sm:pt-20 pb-96 lg:mb-72"
22+ use:inView
23+ on:enter ={() => (visible = true )}
24+ on:exit ={() => (visible = false )}
25+ >
1826 <div class =" flex flex-col lg:flex-row gap-8 items-center" >
1927 <div class =" sm:basis-2/3 flex flex-col justify-center gap-8" >
2028 <h2 >CodingCat.dev Podcast</h2 >
3745 class =" snap-x scroll-px-4 snap-mandatory scroll-smooth flex gap-4 overflow-x-auto overflow-y-hidden py-10 sm:justify-center"
3846 >
3947 {#each podcasts as content , i }
40- <PodcastCard position ={i % 2 ? ' left' : ' right' } {content } />
48+ {#if visible }
49+ <div
50+ class =" flex flex-none"
51+ in:fly ={{ x : 200 , delay : 300 * (i + 1 ), duration : 300 }}
52+ out:fly
53+ >
54+ <PodcastCard position ={i % 2 ? ' left' : ' right' } {content } />
55+ </div >
56+ {/if }
4157 {/each }
4258 </div >
4359 </div >
You can’t perform that action at this time.
0 commit comments