1
1
<template >
2
2
<div
3
- class =" container grid h-screen w-full grid-cols-3 m-0 p-0 relative items-center overflow-hidden"
3
+ class =" w-full h-screen max-w-screen-xl max-h-screen-md grid lg:grid-cols-3 grid-cols-1 lg:grid-rows-1 justify-items-center justify-center items-center overflow-scroll lg:overflow-hidden relative"
4
+ v-bind =" $attrs"
4
5
>
5
6
<div
6
- class =" info-bar absolute top-0 right-0 p-2 flex flex-row-reverse gap-4 items-center z-[200 ]"
7
+ class =" info-bar absolute top-0 w-full lg:w-min lg: right-0 p-4 pl-6 pr-6 lg:p-4 flex flex-row-reverse lg: gap-4 gap-6 items-center justify-between lg:justify-end z-[1000 ]"
7
8
>
8
- <DarkModeToggle class = " dark-mode-toggle " />
9
+ <DarkModeToggle />
9
10
<HoverCard :open-delay =" 0" >
10
11
<HoverCardTrigger
11
12
><Button class =" p-0 m-0 cursor-pointer" variant =" link"
36
37
</div >
37
38
</HoverCardContent >
38
39
</HoverCard >
39
-
40
- <!-- <CommandPalette
41
- :super-key="superKey"
42
- :animations="
43
- Object.values(animationGroup.animations).map((a) => a.animation)
44
- "
45
- ></CommandPalette> -->
46
40
</div >
47
41
48
42
<template v-if =" ! storedControls .selectedAnimation " >
49
43
<div
50
- class =" start-screen-text absolute grid items-center w-screen gap-0 left-4 top-32 "
44
+ class =" start-screen-text lg: absolute mt-16 w-screen h-0 grid items-center gap-0 left-0 ml-8 top-0 "
51
45
>
52
- <h1 class =" font-bold text-7xl m-0 p-0" >
53
- <span
54
- class =" fraunces lift-down depth-text"
55
- v-for =" (char, index) in startScreenText"
56
- :key =" index"
57
- :style =" {
58
- animationDelay: `${index * 0.3}s`,
59
- animationDuration: `${startScreenText.length * 0.3 + 3}s`,
60
- }"
61
- >
62
- {{ char }}
63
- </span >
64
- <span
65
- class =" depth-text dot-fade"
66
- v-for =" (char, index) in ellipsisText"
67
- :key =" index"
68
- :style =" {
69
- animationDelay: `${index * 0.3}s`,
70
- animationDuration: `${ellipsisText.length * 0.3 + 1}s`,
71
- }"
72
- >
73
- {{ char }}
74
- </span >
46
+ <h1 class =" fraunces font-bold lg:text-7xl text-6xl p-0 grid lg:flex" >
47
+ <div >
48
+ <AnimatedText
49
+ class =" depth-text"
50
+ :text =" startScreenText"
51
+ ></AnimatedText >
52
+ </div >
53
+
54
+ <div >
55
+ <AnimatedText
56
+ class =" dot-fade depth-text"
57
+ :text =" ellipsisText"
58
+ ></AnimatedText >
59
+ </div >
75
60
</h1 >
76
61
<h2 class =" fraunces italic font-light text-4xl w-full" >
77
62
from the list <List class =" inline" ></List > below.
88
73
>
89
74
<AnimationControls
90
75
v-if =" storedControls.selectedAnimation == name"
91
- class =" animation-controls col-span-1"
76
+ class =" col-span-1"
92
77
@slider-update =" sliderUpdate"
93
78
@keyframes-update =" keyframesUpdate"
94
79
:animation =" groupObject.animation"
104
89
</AnimationControls >
105
90
</template >
106
91
107
- <div :class =" storedControls.selectedAnimation ? 'col-span-2' : 'col-span-3'" >
92
+ <div
93
+ :class ="
94
+ ' ' +
95
+ (storedControls?.selectedAnimation == null
96
+ ? 'col-span-3'
97
+ : 'col-span-2')
98
+ "
99
+ >
108
100
<slot name =" animation-content" > </slot >
109
101
</div >
110
102
111
103
<div
112
- class =" menu-bar col-span-3 absolute bottom-0 p-4 m-0 w-screen h-[min-content] flex items-center justify-center"
104
+ class =" sticky lg: absolute bottom-0 p-4 m-0 w-screen h-[min-content] flex items-center justify-center justify-items -center"
113
105
>
114
106
<Menubar class =" flex items-center gap-1 justify-items-center" >
115
107
<MenubarMenu >
181
173
</Menubar >
182
174
</div >
183
175
</div >
176
+
177
+ <ClientOnly >
178
+ <Teleport to =" html" >
179
+ <Toaster />
180
+ </Teleport >
181
+ </ClientOnly >
184
182
</template >
185
183
186
184
<script setup lang="ts">
187
- import { onMounted , ref , watch } from " vue" ;
185
+ import { Teleport , onMounted , ref , watch } from " vue" ;
186
+ import { Toaster } from " vue-sonner" ;
188
187
189
188
import CommandPalette from " @components/custom/CommandPalette.vue" ;
190
189
@@ -249,9 +248,10 @@ import {
249
248
resetAllStores ,
250
249
} from " ./animationStores" ;
251
250
import { SelectIcon } from " radix-vue" ;
251
+ import { useWindowSize } from " @vueuse/core" ;
252
+ import AnimatedText from " ./AnimatedText.vue" ;
252
253
253
254
let startScreenText = $ref (" Select an animation" );
254
- startScreenText = startScreenText .replace (/ / g , " \u00a0 " );
255
255
let ellipsisText = $ref (" ..." );
256
256
257
257
const { superKey, animationGroup } = defineProps <{
@@ -324,9 +324,10 @@ const reset = (target: HTMLElement, all: boolean = false) => {
324
324
.play ();
325
325
326
326
animationGroup .reset ();
327
+ storedControls .selectedAnimation = null ;
327
328
328
329
if (all ) {
329
- resetAllStores ();
330
+ // resetAllStores();
330
331
window .location .reload ();
331
332
}
332
333
};
@@ -351,74 +352,4 @@ onMounted(() => {});
351
352
352
353
background : var (--gradient );
353
354
}
354
-
355
- .lift-down {
356
- display : inline-block ;
357
- animation : liftDown 3s ease-in-out infinite ;
358
- animation-fill-mode : forwards ;
359
- }
360
-
361
- @keyframes liftDown {
362
- 0%,
363
- 100% {
364
- transform : translateY (0 );
365
- }
366
- 50% {
367
- transform : translateY (-5px );
368
- }
369
- }
370
-
371
- .dot-fade {
372
- display : inline-block ;
373
- animation : dotFade 4s ease-in-out infinite ;
374
- animation-fill-mode : forwards ;
375
- }
376
-
377
- @keyframes dotFade {
378
- 0%,
379
- 100% {
380
- opacity : 0 ;
381
- }
382
- 50% {
383
- opacity : 1 ;
384
- }
385
- }
386
-
387
- .remove-outline > * ,
388
- * {
389
- // remove all variations of all child outlines and borders, and focus states:
390
- // outline: none !important;
391
- // border: none !important;
392
- box-shadow : none !important ;
393
-
394
- & :focus {
395
- // outline: none !important;
396
- // border: none !important;
397
- box-shadow : none !important ;
398
- }
399
- }
400
-
401
- @media (max-width : 640px ) {
402
- .container {
403
- grid-template-columns : 1fr ;
404
- grid-template-rows : 1fr 1fr 1fr ;
405
- gap : 0 ;
406
-
407
- height : 100% ;
408
- position : relative ;
409
- }
410
-
411
- .animation-controls {
412
- grid-row : span 1 ;
413
- height : 50px ;
414
- }
415
-
416
- .animation-content {
417
- grid-row : 2 ;
418
- }
419
-
420
- .menu-bar {
421
- position : sticky !important ;
422
- }
423
- }
424
355
</style >
0 commit comments