File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
apps/codingcatdev/src/routes/(home-partials)/(home-podcast) Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
+ import { inView } from ' $lib/actions/inView' ;
2
3
import type { Podcast } from ' $lib/types' ;
4
+ import { fly } from ' svelte/transition' ;
3
5
import GitLineGradient from ' ../(home-campaign)/GitLineGradient.svelte' ;
4
6
import PodcastCard from ' ./PodcastCard.svelte' ;
5
7
import PodcastSvg from ' ./PodcastSvg.svelte' ;
6
8
export let podcasts: Podcast [];
9
+ let visible = false ;
7
10
</script >
8
11
9
12
<section class =" bg-surface-800-100-token text-surface-100-800-token relative" >
14
17
<PodcastSvg />
15
18
<GitLineGradient rotate ={true } />
16
19
</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
+ >
18
26
<div class =" flex flex-col lg:flex-row gap-8 items-center" >
19
27
<div class =" sm:basis-2/3 flex flex-col justify-center gap-8" >
20
28
<h2 >CodingCat.dev Podcast</h2 >
37
45
class =" snap-x scroll-px-4 snap-mandatory scroll-smooth flex gap-4 overflow-x-auto overflow-y-hidden py-10 sm:justify-center"
38
46
>
39
47
{#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 }
41
57
{/each }
42
58
</div >
43
59
</div >
You can’t perform that action at this time.
0 commit comments