|
7 | 7 | import CheckOutArrow from './CheckOutArrow.svelte'; |
8 | 8 | import CoursesSvg from './CoursesSvg.svelte'; |
9 | 9 | import { inView } from '$lib/actions/inView'; |
10 | | - import { fade } from 'svelte/transition'; |
| 10 | + import { fade, fly } from 'svelte/transition'; |
11 | 11 |
|
12 | 12 | let videoVisible = false; |
| 13 | + let courseLessons = false; |
13 | 14 | </script> |
14 | 15 |
|
| 16 | +<!-- TODO: Pull Latest from Repo --> |
15 | 17 | <div class=" bg-surface-800-100-token h-[800px]" /> |
16 | 18 |
|
17 | 19 | <div> |
|
49 | 51 | on:enter={() => (videoVisible = true)} |
50 | 52 | on:exit={() => (videoVisible = false)} |
51 | 53 | > |
52 | | - <Video class="rounded-2xl" src="https://youtu.be/sp7qvtvCFv8" title="Svelte" /> |
| 54 | + <div class="relative aspect-video"> |
| 55 | + {#if videoVisible} |
| 56 | + <div in:fade={{ delay: 500, duration: 300 }}> |
| 57 | + <Video class="rounded-2xl" src="https://youtu.be/sp7qvtvCFv8" title="Svelte" /> |
| 58 | + </div> |
| 59 | + {/if} |
| 60 | + </div> |
53 | 61 | </div> |
54 | 62 |
|
55 | 63 | <!-- Lessons --> |
56 | 64 | <div class="flex flex-col gap-8"> |
57 | 65 | <div |
58 | 66 | class="grid grid-cols-1 sm:grid-rows-2 sm:grid-cols-2 gap-4 sm:gap-8 relative py-8 sm:py-0" |
| 67 | + use:inView={{ bottom: 100 }} |
| 68 | + on:enter={() => (courseLessons = true)} |
| 69 | + on:exit={() => (courseLessons = false)} |
59 | 70 | > |
60 | 71 | <div class="hidden absolute w-full h-full sm:flex justify-center items-center -z-10"> |
61 | 72 | <div class="bg-surface-800-100-token rounded-full h-24 w-24" /> |
62 | 73 | </div> |
63 | | - <div class="bcu-card !text-surface-800-100-token !bg-surface-100-800-token"> |
64 | | - <div class="p-4 space-y-4"> |
65 | | - <div class="text-4xl font-bold text-primary-400-500-token">01</div> |
66 | | - <h2>What is Svelte?</h2> |
67 | | - <article> |
68 | | - <p> |
69 | | - Svelte is a modern JavaScript framework that is designed to be fast, simple, |
70 | | - and scalable. |
71 | | - </p> |
72 | | - </article> |
| 74 | + {#if courseLessons} |
| 75 | + <div |
| 76 | + class="bcu-card !text-surface-800-100-token !bg-surface-100-800-token" |
| 77 | + in:fly={{ x: -200, y: -200, delay: 500, duration: 400 }} |
| 78 | + > |
| 79 | + <div class="p-4 space-y-4"> |
| 80 | + <div class="text-4xl font-bold text-primary-400-500-token">01</div> |
| 81 | + <h2>What is Svelte?</h2> |
| 82 | + <article> |
| 83 | + <p> |
| 84 | + Svelte is a modern JavaScript framework that is designed to be fast, simple, |
| 85 | + and scalable. |
| 86 | + </p> |
| 87 | + </article> |
| 88 | + </div> |
73 | 89 | </div> |
74 | | - </div> |
75 | | - <div class="bcu-card !text-surface-800-100-token !bg-surface-100-800-token"> |
76 | | - <div class="p-4 space-y-4"> |
77 | | - <div class="text-4xl font-bold text-primary-400-500-token">02</div> |
78 | | - <h2>Getting Started</h2> |
79 | | - <article> |
80 | | - <p>Explanation of Svelte vs. SvelteKit and other metaframeworks</p> |
81 | | - </article> |
| 90 | + <div |
| 91 | + class="bcu-card !text-surface-800-100-token !bg-surface-100-800-token" |
| 92 | + in:fly={{ x: 200, y: -200, delay: 500, duration: 400 }} |
| 93 | + > |
| 94 | + <div class="p-4 space-y-4"> |
| 95 | + <div class="text-4xl font-bold text-primary-400-500-token">02</div> |
| 96 | + <h2>Getting Started</h2> |
| 97 | + <article> |
| 98 | + <p>Explanation of Svelte vs. SvelteKit and other metaframeworks</p> |
| 99 | + </article> |
| 100 | + </div> |
82 | 101 | </div> |
83 | | - </div> |
84 | | - <div class="bcu-card !text-surface-800-100-token !bg-surface-100-800-token"> |
85 | | - <div class="p-4 space-y-4"> |
86 | | - <div class="text-4xl font-bold text-primary-400-500-token">03</div> |
| 102 | + <div |
| 103 | + class="bcu-card !text-surface-800-100-token !bg-surface-100-800-token" |
| 104 | + in:fly={{ x: -200, y: 200, delay: 500, duration: 400 }} |
| 105 | + > |
| 106 | + <div class="p-4 space-y-4"> |
| 107 | + <div class="text-4xl font-bold text-primary-400-500-token">03</div> |
87 | 108 |
|
88 | | - <h2>Starting To Code</h2> |
89 | | - <article> |
90 | | - <p>Setup VSCode and Get Started writing Svelte</p> |
91 | | - </article> |
| 109 | + <h2>Starting To Code</h2> |
| 110 | + <article> |
| 111 | + <p>Setup VSCode and Get Started writing Svelte</p> |
| 112 | + </article> |
| 113 | + </div> |
92 | 114 | </div> |
93 | | - </div> |
94 | | - <div class="bcu-card !text-surface-800-100-token !bg-surface-100-800-token"> |
95 | | - <div class="p-4 space-y-4"> |
96 | | - <div class="text-4xl font-bold text-primary-400-500-token">04</div> |
| 115 | + <div |
| 116 | + class="bcu-card !text-surface-800-100-token !bg-surface-100-800-token" |
| 117 | + in:fly={{ x: 200, y: 200, delay: 500, duration: 400 }} |
| 118 | + > |
| 119 | + <div class="p-4 space-y-4"> |
| 120 | + <div class="text-4xl font-bold text-primary-400-500-token">04</div> |
97 | 121 |
|
98 | | - <h2>Components and Props</h2> |
99 | | - <article> |
100 | | - <p> |
101 | | - Components are reusable pieces of code that can be used to build complex user |
102 | | - interfaces, props pass data within those components. |
103 | | - </p> |
104 | | - </article> |
| 122 | + <h2>Components and Props</h2> |
| 123 | + <article> |
| 124 | + <p> |
| 125 | + Components are reusable pieces of code that can be used to build complex |
| 126 | + user interfaces, props pass data within those components. |
| 127 | + </p> |
| 128 | + </article> |
| 129 | + </div> |
105 | 130 | </div> |
106 | | - </div> |
| 131 | + {/if} |
107 | 132 | </div> |
108 | 133 | <div class="grid grid-cols-1 sm:grid-rows-2 sm:grid-cols-2 gap-4 sm:gap-8 relative"> |
109 | 134 | <div class="flex sm:justify-end"> |
|
0 commit comments