|
1 | 1 | <script> |
2 | 2 | import { onDestroy, onMount } from 'svelte'; |
| 3 | + import './scene0Hero.css'; |
3 | 4 |
|
4 | 5 | export let summary; |
5 | 6 |
|
|
108 | 109 | <canvas bind:this={canvas} aria-hidden="true"></canvas> |
109 | 110 | <p class="mark">DArts</p> |
110 | 111 | <div class="hero-copy" aria-live="polite"> |
| 112 | + <p class="line intro"> |
| 113 | + MoMA is New York's Museum of Modern Art. Its public collection dataset records artists, dates, departments, |
| 114 | + mediums, and nationalities for the works it holds. |
| 115 | + </p> |
111 | 116 | <p class="line l1"><span class="num">{summary.n_artworks_total.toLocaleString()}</span> works.</p> |
112 | 117 | <p class="line l2"><span class="num">{summary.n_artists_total.toLocaleString()}</span> artists.</p> |
113 | 118 | <p class="line l3">One question:</p> |
|
118 | 123 | <span class="caret"></span> |
119 | 124 | </div> |
120 | 125 | </section> |
121 | | -
|
122 | | -<style> |
123 | | - .hero-scene { |
124 | | - position: relative; |
125 | | - min-height: 100vh; |
126 | | - min-height: 100svh; |
127 | | - overflow: hidden; |
128 | | - display: grid; |
129 | | - place-items: center; |
130 | | - color: var(--fg-on-dark-strong); |
131 | | - background: var(--bg-dark); |
132 | | - } |
133 | | -
|
134 | | - canvas { |
135 | | - position: absolute; |
136 | | - inset: 0; |
137 | | - width: 100%; |
138 | | - height: 100%; |
139 | | - } |
140 | | -
|
141 | | - .mark { |
142 | | - position: absolute; |
143 | | - top: var(--space-4); |
144 | | - left: var(--space-4); |
145 | | - margin: 0; |
146 | | - color: var(--fg-on-dark-strong); |
147 | | - font-family: var(--font-display); |
148 | | - font-size: var(--type-h3-size); |
149 | | - font-weight: 600; |
150 | | - } |
151 | | -
|
152 | | - .hero-copy { |
153 | | - position: relative; |
154 | | - z-index: 1; |
155 | | - width: min(58rem, calc(100vw - var(--space-4))); |
156 | | - text-align: center; |
157 | | - } |
158 | | -
|
159 | | - .line { |
160 | | - margin: 0; |
161 | | - opacity: 0; |
162 | | - translate: 0 0.75rem; |
163 | | - animation: hero-line 900ms var(--ease-out) forwards; |
164 | | - } |
165 | | -
|
166 | | - .l1, |
167 | | - .l2, |
168 | | - .l3 { |
169 | | - color: var(--fg-on-dark-mute); |
170 | | - font-family: var(--font-ui); |
171 | | - font-size: clamp(1.25rem, 4vw, var(--type-h2-size)); |
172 | | - font-weight: 600; |
173 | | - line-height: var(--type-h2-line); |
174 | | - } |
175 | | -
|
176 | | - .l2 { |
177 | | - animation-delay: 650ms; |
178 | | - } |
179 | | -
|
180 | | - .l3 { |
181 | | - animation-delay: 1300ms; |
182 | | - } |
183 | | -
|
184 | | - .l4 { |
185 | | - margin-top: var(--space-2); |
186 | | - color: var(--fg-on-dark-strong); |
187 | | - font-family: var(--font-display); |
188 | | - font-size: clamp(2.75rem, 9vw, var(--type-display-size)); |
189 | | - font-weight: 600; |
190 | | - line-height: var(--type-display-line); |
191 | | - animation-delay: 2100ms; |
192 | | - } |
193 | | -
|
194 | | - .num { |
195 | | - color: var(--seq-1); |
196 | | - font-family: var(--font-mono); |
197 | | - font-variant-numeric: tabular-nums; |
198 | | - } |
199 | | -
|
200 | | - .scroll-cue { |
201 | | - position: absolute; |
202 | | - bottom: var(--space-4); |
203 | | - left: 50%; |
204 | | - z-index: 1; |
205 | | - display: grid; |
206 | | - gap: var(--space-1); |
207 | | - justify-items: center; |
208 | | - color: var(--fg-on-dark-mute); |
209 | | - font-family: var(--font-ui); |
210 | | - font-size: var(--type-small-size); |
211 | | - translate: -50% 0; |
212 | | - animation: cue-bob 1600ms var(--ease-inout) infinite; |
213 | | - } |
214 | | -
|
215 | | - .caret { |
216 | | - width: 0.625rem; |
217 | | - height: 0.625rem; |
218 | | - border-right: 1px solid currentColor; |
219 | | - border-bottom: 1px solid currentColor; |
220 | | - rotate: 45deg; |
221 | | - } |
222 | | -
|
223 | | - @keyframes hero-line { |
224 | | - to { |
225 | | - opacity: 1; |
226 | | - translate: 0 0; |
227 | | - } |
228 | | - } |
229 | | -
|
230 | | - @keyframes cue-bob { |
231 | | - 50% { |
232 | | - translate: -50% 0.375rem; |
233 | | - } |
234 | | - } |
235 | | -
|
236 | | - @media (prefers-reduced-motion: reduce) { |
237 | | - .line { |
238 | | - opacity: 1; |
239 | | - translate: 0 0; |
240 | | - animation: none; |
241 | | - } |
242 | | -
|
243 | | - .scroll-cue { |
244 | | - animation: none; |
245 | | - } |
246 | | - } |
247 | | -</style> |
0 commit comments