@d0rich/esprit-design 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/components/DChip.vue.d.ts +1 -1
  3. package/dist/components/DPagination.vue.d.ts +2 -2
  4. package/dist/components/DStats.vue.d.ts +1 -1
  5. package/dist/components/animations/DAnimationAccordion.vue.d.ts +2 -2
  6. package/dist/components/animations/DAnimationDefLetterD.vue.d.ts +1 -1
  7. package/dist/components/animations/DAnimationFloatingLetter.vue.d.ts +2 -2
  8. package/dist/components/animations/DAnimationHypnosis.vue.d.ts +2 -2
  9. package/dist/components/animations/DAnimationSpinner.vue.d.ts +2 -2
  10. package/dist/components/animations/index.d.ts +5 -4
  11. package/dist/components/buttons/DBigBangButton.vue.d.ts +3 -3
  12. package/dist/components/buttons/DBigBangButtonAnimation.vue.d.ts +1 -1
  13. package/dist/components/buttons/DBtn.vue.d.ts +4 -3
  14. package/dist/components/buttons/index.d.ts +4 -3
  15. package/dist/components/cards/DCard.vue.d.ts +2 -2
  16. package/dist/components/cards/DCardTitle.vue.d.ts +1 -1
  17. package/dist/components/cards/index.d.ts +3 -2
  18. package/dist/components/content/DAlert.vue.d.ts +2 -2
  19. package/dist/components/content/DQuote.vue.d.ts +2 -2
  20. package/dist/components/content/index.d.ts +3 -2
  21. package/dist/components/index.d.ts +4 -3
  22. package/dist/components/lists/DActionsFan.vue.d.ts +5 -4
  23. package/dist/components/lists/DActionsList.vue.d.ts +5 -4
  24. package/dist/components/lists/index.d.ts +3 -2
  25. package/dist/components/utils/DWrapBackground.vue.d.ts +4 -3
  26. package/dist/components/utils/DWrapFocusHighlight.vue.d.ts +2 -2
  27. package/dist/components/utils/DWrapShape.vue.d.ts +8 -7
  28. package/dist/components/utils/index.d.ts +4 -3
  29. package/dist/composables/big-bang-button-utils.d.ts +1 -1
  30. package/dist/composables/router.d.ts +9 -6
  31. package/dist/composables/utils.d.ts +1 -0
  32. package/dist/esprit-design.js +1380 -1344
  33. package/dist/esprit-design.umd.cjs +13 -13
  34. package/dist/style.css +1 -1
  35. package/dist/utils/boundings.d.ts +2 -1
  36. package/index.html +14 -0
  37. package/package.json +9 -13
  38. package/plugins/shadows.js +87 -0
  39. package/src/components/DChip.vue +32 -0
  40. package/src/components/DPagination.vue +91 -0
  41. package/src/components/DStats.vue +514 -0
  42. package/src/components/animations/DAnimationAccordion.vue +103 -0
  43. package/src/components/animations/DAnimationDefLetterD.vue +11 -0
  44. package/src/components/animations/DAnimationFloatingLetter.vue +58 -0
  45. package/src/components/animations/DAnimationHypnosis.vue +102 -0
  46. package/src/components/animations/DAnimationSpinner.vue +114 -0
  47. package/src/components/animations/index.ts +11 -0
  48. package/src/components/buttons/DBigBangButton.vue +70 -0
  49. package/src/components/buttons/DBigBangButtonAnimation.vue +117 -0
  50. package/src/components/buttons/DBtn.vue +107 -0
  51. package/src/components/buttons/index.ts +5 -0
  52. package/src/components/cards/DCard.vue +98 -0
  53. package/src/components/cards/DCardTitle.vue +67 -0
  54. package/src/components/cards/index.ts +4 -0
  55. package/src/components/content/DAlert.vue +112 -0
  56. package/src/components/content/DQuote.vue +71 -0
  57. package/src/components/content/index.ts +4 -0
  58. package/src/components/index.ts +12 -0
  59. package/src/components/lists/DActionsFan.vue +153 -0
  60. package/src/components/lists/DActionsList.vue +100 -0
  61. package/src/components/lists/index.ts +4 -0
  62. package/src/components/utils/DWrapBackground.vue +76 -0
  63. package/src/components/utils/DWrapFocusHighlight.vue +241 -0
  64. package/src/components/utils/DWrapShape.vue +170 -0
  65. package/src/components/utils/index.ts +7 -0
  66. package/src/composables/big-bang-button-utils.ts +7 -0
  67. package/src/composables/index.ts +2 -0
  68. package/src/composables/router.ts +81 -0
  69. package/src/composables/utils.ts +5 -0
  70. package/src/index.ts +3 -0
  71. package/src/style.css +3 -0
  72. package/src/utils/boundings.ts +35 -0
  73. package/src/utils/index.ts +3 -0
  74. package/src/utils/pagination.ts +4 -0
  75. package/src/utils/polygon-animation.ts +139 -0
  76. package/src/vite-env.d.ts +1 -0
  77. package/tailwind.config.js +22 -0
  78. package/tsconfig.json +25 -0
  79. package/tsconfig.node.json +10 -0
  80. package/vite.config.ts +35 -0
@@ -0,0 +1,514 @@
1
+ <script lang="ts">
2
+ import { ref, computed } from 'vue'
3
+ import { Icon } from '@iconify/vue'
4
+
5
+ export default {
6
+ name: 'DStats',
7
+ components: {
8
+ Icon
9
+ }
10
+ }
11
+ </script>
12
+
13
+ <script setup lang="ts">
14
+ export type StatsProps = {
15
+ groupTitle?: string
16
+ titles: string[]
17
+ values: number[]
18
+ }
19
+
20
+ const props = defineProps<StatsProps>()
21
+
22
+ const fullStarPoints = ref<number[][]>([
23
+ [500, 0], // 1
24
+ [630, 330], // 1-2
25
+ [980, 350], // 2
26
+ [700, 590], // 2-3
27
+ [790, 910], // 3
28
+ [500, 720], // 3-4
29
+ [210, 910], // 4
30
+ [300, 590], // 4-5
31
+ [20, 350], // 5
32
+ [370, 330] // 5-1
33
+ ])
34
+ const scales = ref<number[]>([1, 0.8, 0.6, 0.4, 0.27])
35
+ const posToIndex = {
36
+ '1': 0,
37
+ '1-2': 1,
38
+ '2': 2,
39
+ '2-3': 3,
40
+ '3': 4,
41
+ '3-4': 5,
42
+ '4': 6,
43
+ '4-5': 7,
44
+ '5': 8,
45
+ '5-1': 9
46
+ }
47
+ const center = [500, 500]
48
+ function pointsToString(points: number[][]) {
49
+ return points.map((pair) => pair.join(',')).join(' ')
50
+ }
51
+ function shrinkStar(points: number[][], scale: number, cx = 500, cy = 500) {
52
+ return points.map((coords) => {
53
+ return [
54
+ coords[0] - (coords[0] - cx) * (1 - scale),
55
+ coords[1] - (coords[1] - cy) * (1 - scale)
56
+ ]
57
+ })
58
+ }
59
+ const scaledStars = computed(() => {
60
+ return scales.value.map((scale) => shrinkStar(fullStarPoints.value, scale))
61
+ })
62
+ function starFromValue(value: number) {
63
+ return scaledStars.value[5 - value]
64
+ }
65
+ function statFromIndex(index: number) {
66
+ return {
67
+ value: props.values ? props.values[index] ?? 1 : 1,
68
+ title: props.titles ? props.titles[index] ?? '' : ''
69
+ }
70
+ }
71
+ const firstStat = computed(() => statFromIndex(0))
72
+ const secondStat = computed(() => statFromIndex(1))
73
+ const thirdStat = computed(() => statFromIndex(2))
74
+ const forthStat = computed(() => statFromIndex(3))
75
+ const fifthStat = computed(() => statFromIndex(4))
76
+ </script>
77
+
78
+ <template>
79
+ <figure class="max-w-full">
80
+ <div class="stats__print-value">
81
+ <div class="stats__print-value__group-title">
82
+ {{ groupTitle }}
83
+ </div>
84
+ <div>
85
+ <div
86
+ v-for="(skill, index) in titles"
87
+ :key="skill"
88
+ class="stats__print-value__skill"
89
+ >
90
+ <div>{{ skill }}</div>
91
+ <div>
92
+ <Icon v-for="n in values[index]" :key="n" icon="ic:sharp-star" />
93
+ <Icon
94
+ v-for="n in 5 - values[index]"
95
+ :key="n"
96
+ icon="ic:sharp-star-border"
97
+ />
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ <div class="stats__print-value--small">
103
+ <span
104
+ v-for="(skill, index) in titles"
105
+ :key="skill"
106
+ class="stats__print-value--small__skill"
107
+ :class="{
108
+ 'stats__print-value--small__skill--hidden': values[index] < 3,
109
+ 'stats__print-value--small__skill--3': values[index] === 3,
110
+ 'stats__print-value--small__skill--4': values[index] === 4,
111
+ 'stats__print-value--small__skill--5': values[index] === 5
112
+ }"
113
+ >
114
+ {{ skill }}
115
+ </span>
116
+ </div>
117
+ <div class="stats">
118
+ <svg viewBox="-500 -500 2000 2000" xmlns="http://www.w3.org/2000/svg">
119
+ <polygon
120
+ points="100,-350 1500,-500 1000,1350 -500,1500"
121
+ class="stats__bg"
122
+ />
123
+ <polygon
124
+ :points="pointsToString(shrinkStar(fullStarPoints, 2))"
125
+ class="stats__bg-star--odd"
126
+ />
127
+ <!-- Stats bg -->
128
+ <g>
129
+ <polygon
130
+ v-for="(star, index) in scaledStars"
131
+ :key="index"
132
+ :points="pointsToString(star)"
133
+ :class="{
134
+ 'stats__bg-star--odd': index % 2,
135
+ 'stats__bg-star--even': !(index % 2)
136
+ }"
137
+ />
138
+ </g>
139
+ <!-- Stats value -->
140
+ <g>
141
+ <!-- 1 -->
142
+ <g class="stats__single-stat">
143
+ <polygon
144
+ :points="
145
+ pointsToString([
146
+ starFromValue(firstStat.value)[posToIndex['1']],
147
+ starFromValue(Math.min(firstStat.value, fifthStat.value))[
148
+ posToIndex['5-1']
149
+ ],
150
+ center
151
+ ])
152
+ "
153
+ class="stats__star--dark"
154
+ />
155
+ <polygon
156
+ :points="
157
+ pointsToString([
158
+ starFromValue(firstStat.value)[posToIndex['1']],
159
+ starFromValue(Math.min(firstStat.value, secondStat.value))[
160
+ posToIndex['1-2']
161
+ ],
162
+ center
163
+ ])
164
+ "
165
+ class="stats__star--light"
166
+ />
167
+ </g>
168
+ <!-- 2 -->
169
+ <g class="stats__single-stat">
170
+ <polygon
171
+ :points="
172
+ pointsToString([
173
+ starFromValue(secondStat.value)[posToIndex['2']],
174
+ starFromValue(Math.min(firstStat.value, secondStat.value))[
175
+ posToIndex['1-2']
176
+ ],
177
+ center
178
+ ])
179
+ "
180
+ class="stats__star--light"
181
+ />
182
+ <polygon
183
+ :points="
184
+ pointsToString([
185
+ starFromValue(secondStat.value)[posToIndex['2']],
186
+ starFromValue(Math.min(thirdStat.value, secondStat.value))[
187
+ posToIndex['2-3']
188
+ ],
189
+ center
190
+ ])
191
+ "
192
+ class="stats__star--dark"
193
+ />
194
+ </g>
195
+ <!-- 3 -->
196
+ <g class="stats__single-stat">
197
+ <polygon
198
+ :points="
199
+ pointsToString([
200
+ starFromValue(thirdStat.value)[posToIndex['3']],
201
+ starFromValue(Math.min(secondStat.value, thirdStat.value))[
202
+ posToIndex['2-3']
203
+ ],
204
+ center
205
+ ])
206
+ "
207
+ class="stats__star--light"
208
+ />
209
+ <polygon
210
+ :points="
211
+ pointsToString([
212
+ starFromValue(thirdStat.value)[posToIndex['3']],
213
+ starFromValue(Math.min(thirdStat.value, forthStat.value))[
214
+ posToIndex['3-4']
215
+ ],
216
+ center
217
+ ])
218
+ "
219
+ class="stats__star--dark"
220
+ />
221
+ </g>
222
+ <!-- 4 -->
223
+ <g class="stats__single-stat">
224
+ <polygon
225
+ :points="
226
+ pointsToString([
227
+ starFromValue(forthStat.value)[posToIndex['4']],
228
+ starFromValue(Math.min(thirdStat.value, forthStat.value))[
229
+ posToIndex['3-4']
230
+ ],
231
+ center
232
+ ])
233
+ "
234
+ class="stats__star--light"
235
+ />
236
+ <polygon
237
+ :points="
238
+ pointsToString([
239
+ starFromValue(forthStat.value)[posToIndex['4']],
240
+ starFromValue(Math.min(forthStat.value, fifthStat.value))[
241
+ posToIndex['4-5']
242
+ ],
243
+ center
244
+ ])
245
+ "
246
+ class="stats__star--dark"
247
+ />
248
+ </g>
249
+ <!-- 5 -->
250
+ <g class="stats__single-stat">
251
+ <polygon
252
+ :points="
253
+ pointsToString([
254
+ starFromValue(fifthStat.value)[posToIndex['5']],
255
+ starFromValue(Math.min(forthStat.value, fifthStat.value))[
256
+ posToIndex['4-5']
257
+ ],
258
+ center
259
+ ])
260
+ "
261
+ class="stats__star--dark"
262
+ />
263
+ <polygon
264
+ :points="
265
+ pointsToString([
266
+ starFromValue(fifthStat.value)[posToIndex['5']],
267
+ starFromValue(Math.min(fifthStat.value, firstStat.value))[
268
+ posToIndex['5-1']
269
+ ],
270
+ center
271
+ ])
272
+ "
273
+ class="stats__star--light"
274
+ />
275
+ </g>
276
+ </g>
277
+ </svg>
278
+ <div class="stats__images">
279
+ <div class="stats__image">
280
+ <slot name="icon-1" />
281
+ </div>
282
+ <div class="stats__image">
283
+ <slot name="icon-2" />
284
+ </div>
285
+ <div class="stats__image">
286
+ <slot name="icon-3" />
287
+ </div>
288
+ <div class="stats__image">
289
+ <slot name="icon-4" />
290
+ </div>
291
+ <div class="stats__image">
292
+ <slot name="icon-5" />
293
+ </div>
294
+ </div>
295
+ <svg
296
+ viewBox="-500 -500 2000 2000"
297
+ xmlns="http://www.w3.org/2000/svg"
298
+ class="stats_titles-layer"
299
+ >
300
+ <text x="-500" y="-300" class="stats__group-title">
301
+ {{ groupTitle }}
302
+ </text>
303
+ <g>
304
+ <text
305
+ :x="fullStarPoints[posToIndex['1']][0]"
306
+ :y="fullStarPoints[posToIndex['1']][1] - 100"
307
+ :transform-origin="`${fullStarPoints[posToIndex['1']][0]} ${
308
+ fullStarPoints[posToIndex['1']][1] - 100
309
+ }`"
310
+ class="stats__title"
311
+ >
312
+ {{ firstStat.title }}
313
+ <tspan class="stats__title__value">{{ firstStat.value }}</tspan>
314
+ </text>
315
+ <text
316
+ :x="fullStarPoints[posToIndex['2']][0] + 100"
317
+ :y="fullStarPoints[posToIndex['2']][1] - 100"
318
+ :transform-origin="`${fullStarPoints[posToIndex['2']][0] + 100} ${
319
+ fullStarPoints[posToIndex['2']][1] - 100
320
+ }`"
321
+ class="stats__title"
322
+ >
323
+ {{ secondStat.title }}
324
+ <tspan class="stats__title__value">{{ secondStat.value }}</tspan>
325
+ </text>
326
+ <text
327
+ dominant-baseline="hanging"
328
+ :x="fullStarPoints[posToIndex['3']][0] + 150"
329
+ :y="fullStarPoints[posToIndex['3']][1] + 150"
330
+ :transform-origin="`${fullStarPoints[posToIndex['3']][0] + 150} ${
331
+ fullStarPoints[posToIndex['3']][1] + 150
332
+ }`"
333
+ class="stats__title"
334
+ >
335
+ {{ thirdStat.title }}
336
+ <tspan class="stats__title__value">{{ thirdStat.value }}</tspan>
337
+ </text>
338
+ <text
339
+ dominant-baseline="hanging"
340
+ :x="fullStarPoints[posToIndex['4']][0] - 150"
341
+ :y="fullStarPoints[posToIndex['4']][1] + 150"
342
+ :transform-origin="`${fullStarPoints[posToIndex['4']][0] - 150} ${
343
+ fullStarPoints[posToIndex['4']][1] + 150
344
+ }`"
345
+ class="stats__title"
346
+ >
347
+ {{ forthStat.title }}
348
+ <tspan class="stats__title__value">{{ forthStat.value }}</tspan>
349
+ </text>
350
+ <text
351
+ :x="fullStarPoints[posToIndex['5']][0] - 100"
352
+ :y="fullStarPoints[posToIndex['5']][1] - 100"
353
+ :transform-origin="`${fullStarPoints[posToIndex['5']][0] - 100} ${
354
+ fullStarPoints[posToIndex['5']][1] - 100
355
+ }`"
356
+ class="stats__title"
357
+ >
358
+ {{ fifthStat.title }}
359
+ <tspan class="stats__title__value">{{ fifthStat.value }}</tspan>
360
+ </text>
361
+ </g>
362
+ </svg>
363
+ </div>
364
+ </figure>
365
+ </template>
366
+
367
+ <style>
368
+ .stats {
369
+ @apply relative print:hidden;
370
+ }
371
+
372
+ .stats__bg {
373
+ @apply fill-neutral-900;
374
+ }
375
+
376
+ .stats__bg-star--odd {
377
+ @apply fill-neutral-500;
378
+ }
379
+
380
+ .stats__bg-star--even {
381
+ @apply fill-neutral-800;
382
+ }
383
+
384
+ .stats__single-stat:hover {
385
+ animation: single-stat-hover 1.5s ease-in-out infinite;
386
+ }
387
+ .stats__star--light {
388
+ @apply fill-yellow-400;
389
+ }
390
+
391
+ .stats__star--dark {
392
+ @apply fill-yellow-600;
393
+ }
394
+ @keyframes single-stat-hover {
395
+ 0% {
396
+ filter: brightness(1);
397
+ }
398
+ 50% {
399
+ filter: brightness(1.35);
400
+ }
401
+ 100% {
402
+ filter: brightness(1);
403
+ }
404
+ }
405
+
406
+ .stats__images {
407
+ @apply absolute inset-0 pointer-events-none;
408
+ }
409
+
410
+ .stats__image {
411
+ width: 20%;
412
+ height: 20%;
413
+ @apply absolute;
414
+ }
415
+
416
+ .stats__image:nth-child(1) {
417
+ top: 2%;
418
+ left: 50%;
419
+ }
420
+
421
+ .stats__image:nth-child(2) {
422
+ top: 20%;
423
+ right: 6%;
424
+ }
425
+
426
+ .stats__image:nth-child(3) {
427
+ bottom: 8%;
428
+ right: 30%;
429
+ }
430
+
431
+ .stats__image:nth-child(4) {
432
+ bottom: 4%;
433
+ left: 10%;
434
+ }
435
+
436
+ .stats__image:nth-child(5) {
437
+ top: 30%;
438
+ left: 6%;
439
+ }
440
+
441
+ .stats_titles-layer {
442
+ @apply absolute inset-0 pointer-events-none;
443
+ }
444
+
445
+ .stats__group-title {
446
+ font-size: 150px;
447
+ paint-order: stroke;
448
+ text-anchor: start;
449
+ dominant-baseline: text-bottom;
450
+ font-weight: 900;
451
+ stroke-width: 20;
452
+ @apply fill-black font-sans stroke-yellow-500;
453
+ }
454
+
455
+ .stats__title {
456
+ font-size: 100px;
457
+ paint-order: stroke;
458
+ text-anchor: middle;
459
+ dominant-baseline: text-top;
460
+ font-weight: 900;
461
+ stroke-width: 20;
462
+ rotate: 5deg;
463
+ @apply fill-black font-sans stroke-yellow-500;
464
+ }
465
+
466
+ .stats__title__value {
467
+ font-size: 80px;
468
+ stroke-width: 20;
469
+ stroke-linejoin: round;
470
+ }
471
+ </style>
472
+
473
+ <style>
474
+ .stats__print-value {
475
+ @apply hidden print:block;
476
+ }
477
+ .stats__print-value__group-title {
478
+ @apply text-lg font-bold;
479
+ }
480
+ .stats__print-value__skill {
481
+ @apply grid grid-cols-[1fr_auto] items-center gap-x-4 gap-y-1;
482
+ }
483
+ .stats__print-value--small {
484
+ @apply hidden flex-wrap gap-2 items-center;
485
+ }
486
+
487
+ .stats__print-value--small__skill {
488
+ @apply rounded text-white p-[.3em];
489
+ }
490
+
491
+ .stats__print-value--small__skill--hidden {
492
+ @apply hidden;
493
+ }
494
+
495
+ .stats__print-value--small__skill--3 {
496
+ @apply bg-blue-500 text-xs;
497
+ }
498
+
499
+ .stats__print-value--small__skill--4 {
500
+ @apply bg-blue-600 text-sm;
501
+ }
502
+
503
+ .stats__print-value--small__skill--5 {
504
+ @apply bg-blue-700 text-base;
505
+ }
506
+
507
+ .small-print-stats .stats__print-value {
508
+ @apply print:hidden;
509
+ }
510
+
511
+ .small-print-stats .stats__print-value--small {
512
+ @apply print:flex;
513
+ }
514
+ </style>
@@ -0,0 +1,103 @@
1
+ <script lang="ts">
2
+ import DAnimationDefLetterD from './DAnimationDefLetterD.vue'
3
+
4
+ export default {
5
+ name: 'DAnimationAccordion',
6
+ components: {
7
+ DAnimationDefLetterD
8
+ }
9
+ }
10
+ </script>
11
+
12
+ <script setup lang="ts">
13
+ defineProps({
14
+ wigglePeriod: {
15
+ type: Number,
16
+ default: 10
17
+ },
18
+ delay: {
19
+ type: Number,
20
+ default: 1
21
+ }
22
+ })
23
+ </script>
24
+
25
+ <template>
26
+ <svg
27
+ viewBox="0 0 630 210"
28
+ xmlns="http://www.w3.org/2000/svg"
29
+ class="d-animation-accordion"
30
+ :style="{
31
+ '--d-accordion-wiggle-period': wigglePeriod + 's',
32
+ '--d-accordion-delay': delay + 's'
33
+ }"
34
+ >
35
+ <defs>
36
+ <DAnimationDefLetterD id="d-letter" />
37
+ <use id="d-accordion-section" href="#d-letter" transform="scale(0.33)" />
38
+ </defs>
39
+ <use href="#d-accordion-section" class="d-animation-accordion__section" />
40
+ <use href="#d-accordion-section" class="d-animation-accordion__section" />
41
+ <use href="#d-accordion-section" class="d-animation-accordion__section" />
42
+ <use href="#d-accordion-section" class="d-animation-accordion__section" />
43
+ <use href="#d-accordion-section" class="d-animation-accordion__section" />
44
+ <use href="#d-accordion-section" class="d-animation-accordion__section" />
45
+ </svg>
46
+ </template>
47
+
48
+ <style>
49
+ .d-animation-accordion > .d-animation-accordion__section {
50
+ --accordion-section-min-posion: translate(
51
+ calc(var(--accordion-section-count) * 50px),
52
+ 0
53
+ );
54
+ --accordion-section-max-posion: translate(
55
+ calc(var(--accordion-section-count) * 70px),
56
+ 0
57
+ );
58
+ transform: var(--accordion-section-min-posion);
59
+ animation: d-animation-accordion-section-wiggle
60
+ var(--d-accordion-wiggle-period) ease-in-out infinite alternate
61
+ calc((var(--accordion-section-count) - 1) * var(--d-accordion-delay));
62
+ }
63
+
64
+ .d-animation-accordion > .d-animation-accordion__section:nth-child(2n + 1) {
65
+ @apply fill-white;
66
+ }
67
+
68
+ .d-animation-accordion > .d-animation-accordion__section:nth-child(2) {
69
+ --accordion-section-count: 1;
70
+ }
71
+
72
+ .d-animation-accordion > .d-animation-accordion__section:nth-child(3) {
73
+ --accordion-section-count: 2;
74
+ }
75
+
76
+ .d-animation-accordion > .d-animation-accordion__section:nth-child(4) {
77
+ --accordion-section-count: 3;
78
+ }
79
+
80
+ .d-animation-accordion > .d-animation-accordion__section:nth-child(5) {
81
+ --accordion-section-count: 4;
82
+ }
83
+
84
+ .d-animation-accordion > .d-animation-accordion__section:nth-child(6) {
85
+ --accordion-section-count: 5;
86
+ }
87
+
88
+ .d-animation-accordion > .d-animation-accordion__section:nth-child(7) {
89
+ --accordion-section-count: 6;
90
+ }
91
+
92
+ @keyframes d-animation-accordion-section-wiggle {
93
+ 0% {
94
+ transform: var(--accordion-section-min-posion);
95
+ }
96
+ 50% {
97
+ transform: var(--accordion-section-max-posion);
98
+ }
99
+ 100% {
100
+ transform: var(--accordion-section-min-posion);
101
+ }
102
+ }
103
+ </style>
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ export default {
3
+ name: 'DAnimationDefLetterD'
4
+ }
5
+ </script>
6
+
7
+ <template>
8
+ <path
9
+ d="M200.242,139.244l137.207,-0c66.136,-0 112.859,17.192 140.169,51.576c27.31,34.384 33.562,84.973 18.755,151.767c-22.045,98.711 -85.878,148.066 -191.498,148.066l-179.16,-0l74.527,-351.409Zm184.588,179.159c12.175,-57.581 -7.732,-86.372 -59.72,-86.372l-33.068,0l-35.042,165.834l44.42,0c23.69,0 42.034,-6.169 55.031,-18.508c12.997,-12.339 22.457,-32.657 28.379,-60.954Z"
10
+ />
11
+ </template>
@@ -0,0 +1,58 @@
1
+ <script lang="ts">
2
+ import DAnimationDefLetterD from './DAnimationDefLetterD.vue'
3
+
4
+ export default {
5
+ name: 'DAnimationFloatingLetter',
6
+ components: {
7
+ DAnimationDefLetterD
8
+ }
9
+ }
10
+ </script>
11
+
12
+ <script setup lang="ts">
13
+ defineProps({
14
+ floatPeriod: {
15
+ type: Number,
16
+ default: 5
17
+ },
18
+ pathClass: {
19
+ type: [String, Object as () => Record<string, boolean>],
20
+ default: ''
21
+ }
22
+ })
23
+ </script>
24
+
25
+ <template>
26
+ <svg
27
+ viewBox="0 0 630 630"
28
+ xmlns="http://www.w3.org/2000/svg"
29
+ :style="{
30
+ '--d-floating-letter-float-period': floatPeriod + 's'
31
+ }"
32
+ >
33
+ <DAnimationDefLetterD
34
+ class="d-animation-floating-letter"
35
+ :class="pathClass"
36
+ />
37
+ </svg>
38
+ </template>
39
+
40
+ <style>
41
+ .d-animation-floating-letter {
42
+ animation: d-animation-floating-letter-float
43
+ var(--d-floating-letter-float-period) ease-in-out infinite;
44
+ transform-origin: 315px 315px;
45
+ }
46
+
47
+ @keyframes d-animation-floating-letter-float {
48
+ 0% {
49
+ transform: translate(0, 0);
50
+ }
51
+ 50% {
52
+ transform: translate(0, 40px);
53
+ }
54
+ 100% {
55
+ transform: translate(0, 0);
56
+ }
57
+ }
58
+ </style>