hys-ui 0.4.0 → 0.6.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 (152) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +3 -3
  3. package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +440 -119
  4. package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.js +7 -0
  5. package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas2.vue.js +166 -0
  6. package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.js +7 -0
  7. package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits2.vue.js +105 -0
  8. package/dist/components/HysAnimatedNumber/animation/digital.js +186 -0
  9. package/dist/components/HysAnimatedNumber/animation/morph.js +110 -0
  10. package/dist/components/HysAnimatedNumber/animation/paint.js +34 -0
  11. package/dist/components/HysAnimatedNumber/animation/particles.js +51 -0
  12. package/dist/components/HysAnimatedNumber/animation/paths.js +165 -0
  13. package/dist/components/HysAnimatedNumber/animation/physics.js +66 -0
  14. package/dist/components/HysAnimatedNumber/animation/render.js +89 -0
  15. package/dist/components/HysAnimatedNumber/animation/reveal.js +125 -0
  16. package/dist/components/HysAnimatedNumber/animation/rolling.js +66 -0
  17. package/dist/components/HysAnimatedNumber/animation/scenarios.js +217 -0
  18. package/dist/components/HysAnimatedNumber/animation/spatial.js +112 -0
  19. package/dist/components/HysAnimatedNumber/useNumberCountdown.js +58 -0
  20. package/dist/components/HysAnimatedNumber/useNumberVisuals.js +60 -0
  21. package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
  22. package/dist/components/HysDrawer/HysDrawer2.vue.js +2 -2
  23. package/dist/components/HysFormItem/HysFormItem.vue.js +1 -1
  24. package/dist/components/HysFormItem/HysFormItem2.vue.js +231 -229
  25. package/dist/components/HysInput/HysInput.vue.js +2 -2
  26. package/dist/components/HysInput/HysInput2.vue.js +327 -274
  27. package/dist/components/HysModal/HysModal.vue.js +2 -2
  28. package/dist/components/HysModal/HysModal2.vue.js +38 -38
  29. package/dist/components/HysSearch/HysSearch.vue.js +2 -2
  30. package/dist/components/HysSortableList/HysSortableList.vue.js +2 -2
  31. package/dist/components/HysSortableList/HysSortableList2.vue.js +498 -129
  32. package/dist/components/HysSortableList/SortableGhost/SortableGhost.vue.js +7 -0
  33. package/dist/components/HysSortableList/SortableGhost/SortableGhost2.vue.js +43 -0
  34. package/dist/components/HysSortableList/SortableGhost/useSortGhost.js +54 -0
  35. package/dist/components/HysSortableList/geometry.js +230 -0
  36. package/dist/components/HysSortableList/model.js +254 -0
  37. package/dist/components/HysSortableList/transactions.js +281 -0
  38. package/dist/components/HysSortableList/useSortDrag.js +270 -0
  39. package/dist/components/HysSortableList/useSortKeyboard.js +72 -0
  40. package/dist/components/HysSortableList/useSortWindow.js +144 -0
  41. package/dist/components/HysTextarea/HysTextarea.vue.js +56 -32
  42. package/dist/components/HysToast/HysToast.vue.js +3 -3
  43. package/dist/components/HysToast/HysToast2.vue.js +379 -107
  44. package/dist/components/HysToast/ToastViewport/ToastViewport.vue.js +7 -0
  45. package/dist/components/HysToast/ToastViewport/ToastViewport2.vue.js +211 -0
  46. package/dist/components/HysToast/ToastViewport/useToastStackDisclosure.js +71 -0
  47. package/dist/components/HysToast/toastPresentation.js +98 -0
  48. package/dist/components/HysToast/useToastActions.js +62 -0
  49. package/dist/components/HysToast/useToastSwipe.js +48 -0
  50. package/dist/components/HysToast/useToastTimer.js +90 -0
  51. package/dist/composables/animatedNumberDigits.js +106 -0
  52. package/dist/composables/animatedNumberFormat.js +222 -0
  53. package/dist/composables/animatedNumberTiming.js +66 -0
  54. package/dist/composables/numberAnimation.js +72 -0
  55. package/dist/composables/numberAnimationCatalog.js +301 -0
  56. package/dist/composables/numberAnimationSequence.js +45 -0
  57. package/dist/composables/popupReferenceBinding.js +41 -0
  58. package/dist/composables/textInput.js +23 -14
  59. package/dist/composables/toastEscape.js +18 -10
  60. package/dist/composables/toastQueue.js +276 -0
  61. package/dist/composables/toastQueueModel.js +86 -0
  62. package/dist/composables/toastTasks.js +58 -0
  63. package/dist/composables/useHysAnimatedNumber.js +264 -0
  64. package/dist/composables/useHysNumberAnimationGroup.js +23 -0
  65. package/dist/composables/useHysToast.js +117 -135
  66. package/dist/composables/usePopupSurface.js +190 -356
  67. package/dist/composables/usePopupSurfaceInteractions.js +172 -0
  68. package/dist/composables/useTextareaSize.js +62 -46
  69. package/dist/index.js +125 -111
  70. package/dist/style.css +1 -1
  71. package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +88 -49
  72. package/dist/types/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.d.ts +19 -0
  73. package/dist/types/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.d.ts +31 -0
  74. package/dist/types/components/HysAnimatedNumber/animation/digital.d.ts +3 -0
  75. package/dist/types/components/HysAnimatedNumber/animation/morph.d.ts +2 -0
  76. package/dist/types/components/HysAnimatedNumber/animation/paint.d.ts +44 -0
  77. package/dist/types/components/HysAnimatedNumber/animation/particles.d.ts +5 -0
  78. package/dist/types/components/HysAnimatedNumber/animation/paths.d.ts +12 -0
  79. package/dist/types/components/HysAnimatedNumber/animation/physics.d.ts +2 -0
  80. package/dist/types/components/HysAnimatedNumber/animation/render.d.ts +2 -0
  81. package/dist/types/components/HysAnimatedNumber/animation/reveal.d.ts +2 -0
  82. package/dist/types/components/HysAnimatedNumber/animation/rolling.d.ts +2 -0
  83. package/dist/types/components/HysAnimatedNumber/animation/scenarios.d.ts +4 -0
  84. package/dist/types/components/HysAnimatedNumber/animation/spatial.d.ts +2 -0
  85. package/dist/types/components/HysAnimatedNumber/useNumberCountdown.d.ts +8 -0
  86. package/dist/types/components/HysAnimatedNumber/useNumberVisuals.d.ts +12 -0
  87. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +11 -2
  88. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +2 -2
  89. package/dist/types/components/HysCard/HysCard.vue.d.ts +1 -1
  90. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +3 -3
  91. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
  92. package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +2 -2
  93. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +3 -3
  94. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +5 -5
  95. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +3 -3
  96. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -1
  97. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
  98. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +1 -1
  99. package/dist/types/components/HysInput/HysInput.vue.d.ts +13 -1
  100. package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
  101. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
  102. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +1 -1
  103. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +1 -1
  104. package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +2 -2
  105. package/dist/types/components/HysSortableList/HysSortableList.vue.d.ts +48 -25
  106. package/dist/types/components/HysSortableList/SortableGhost/SortableGhost.vue.d.ts +31 -0
  107. package/dist/types/components/HysSortableList/SortableGhost/useSortGhost.d.ts +23 -0
  108. package/dist/types/components/HysSortableList/geometry.d.ts +35 -0
  109. package/dist/types/components/HysSortableList/model.d.ts +61 -0
  110. package/dist/types/components/HysSortableList/sortableList.d.ts +151 -0
  111. package/dist/types/components/HysSortableList/transactions.d.ts +10 -0
  112. package/dist/types/components/HysSortableList/useSortDrag.d.ts +25 -0
  113. package/dist/types/components/HysSortableList/useSortKeyboard.d.ts +17 -0
  114. package/dist/types/components/HysSortableList/useSortWindow.d.ts +16 -0
  115. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
  116. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +1 -1
  117. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +1 -1
  118. package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +13 -2
  119. package/dist/types/components/HysToast/HysToast.vue.d.ts +44 -46
  120. package/dist/types/components/HysToast/ToastViewport/ToastViewport.vue.d.ts +25 -0
  121. package/dist/types/components/HysToast/ToastViewport/useToastStackDisclosure.d.ts +16 -0
  122. package/dist/types/components/HysToast/toastPresentation.d.ts +8 -0
  123. package/dist/types/components/HysToast/toastTypes.d.ts +212 -0
  124. package/dist/types/components/HysToast/useToastActions.d.ts +18 -0
  125. package/dist/types/components/HysToast/useToastSwipe.d.ts +11 -0
  126. package/dist/types/components/HysToast/useToastTimer.d.ts +22 -0
  127. package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +1 -1
  128. package/dist/types/components/HysTour/HysTour.vue.d.ts +1 -1
  129. package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +3 -3
  130. package/dist/types/components/HysUpload/HysUpload.vue.d.ts +2 -2
  131. package/dist/types/composables/animatedNumber.d.ts +220 -0
  132. package/dist/types/composables/animatedNumberDigits.d.ts +32 -0
  133. package/dist/types/composables/animatedNumberFormat.d.ts +16 -0
  134. package/dist/types/composables/animatedNumberTiming.d.ts +21 -0
  135. package/dist/types/composables/drawer.d.ts +1 -1
  136. package/dist/types/composables/numberAnimation.d.ts +29 -0
  137. package/dist/types/composables/numberAnimationCatalog.d.ts +58 -0
  138. package/dist/types/composables/numberAnimationSequence.d.ts +13 -0
  139. package/dist/types/composables/popupReferenceBinding.d.ts +9 -0
  140. package/dist/types/composables/textInput.d.ts +39 -4
  141. package/dist/types/composables/toastEscape.d.ts +1 -1
  142. package/dist/types/composables/toastQueue.d.ts +121 -0
  143. package/dist/types/composables/toastQueueModel.d.ts +116 -0
  144. package/dist/types/composables/toastTasks.d.ts +2 -0
  145. package/dist/types/composables/useHysAnimatedNumber.d.ts +37 -0
  146. package/dist/types/composables/useHysNumberAnimationGroup.d.ts +4 -0
  147. package/dist/types/composables/useHysToast.d.ts +4 -48
  148. package/dist/types/composables/usePopupSurface.d.ts +20 -20
  149. package/dist/types/composables/usePopupSurfaceInteractions.d.ts +33 -0
  150. package/dist/types/composables/useTextareaSize.d.ts +5 -2
  151. package/dist/types/index.d.ts +15 -6
  152. package/package.json +1 -1
@@ -0,0 +1,165 @@
1
+ import { clamp as g, mix as u } from "./paint.js";
2
+ const d = [
3
+ [
4
+ [0, -0.39],
5
+ [0.18, -0.35],
6
+ [0.25, -0.18],
7
+ [0.25, 0.2],
8
+ [0.16, 0.38],
9
+ [0, 0.42],
10
+ [-0.18, 0.36],
11
+ [-0.25, 0.17],
12
+ [-0.25, -0.19],
13
+ [-0.16, -0.35],
14
+ [0, -0.39]
15
+ ],
16
+ [
17
+ [-0.17, -0.25],
18
+ [0.04, -0.39],
19
+ [0.04, 0.39],
20
+ [-0.19, 0.39],
21
+ [0.23, 0.39]
22
+ ],
23
+ [
24
+ [-0.22, -0.24],
25
+ [-0.14, -0.36],
26
+ [0.04, -0.39],
27
+ [0.22, -0.3],
28
+ [0.23, -0.16],
29
+ [0.12, -0.01],
30
+ [-0.22, 0.33],
31
+ [-0.23, 0.39],
32
+ [0.24, 0.39]
33
+ ],
34
+ [
35
+ [-0.22, -0.33],
36
+ [0.06, -0.39],
37
+ [0.23, -0.29],
38
+ [0.22, -0.15],
39
+ [0.05, -0.02],
40
+ [-0.05, 0],
41
+ [0.17, 0.03],
42
+ [0.25, 0.16],
43
+ [0.22, 0.32],
44
+ [0.05, 0.41],
45
+ [-0.18, 0.36],
46
+ [-0.25, 0.27]
47
+ ],
48
+ [
49
+ [0.16, 0.41],
50
+ [0.16, -0.39],
51
+ [-0.26, 0.15],
52
+ [0.27, 0.15]
53
+ ],
54
+ [
55
+ [0.23, -0.39],
56
+ [-0.2, -0.39],
57
+ [-0.22, -0.02],
58
+ [0.04, -0.06],
59
+ [0.21, 0.03],
60
+ [0.25, 0.2],
61
+ [0.19, 0.36],
62
+ [0, 0.42],
63
+ [-0.2, 0.34],
64
+ [-0.24, 0.23]
65
+ ],
66
+ [
67
+ [0.21, -0.37],
68
+ [0.01, -0.4],
69
+ [-0.17, -0.25],
70
+ [-0.24, -0.02],
71
+ [-0.24, 0.24],
72
+ [-0.13, 0.38],
73
+ [0.04, 0.42],
74
+ [0.21, 0.32],
75
+ [0.24, 0.16],
76
+ [0.16, 0.01],
77
+ [-0.02, -0.05],
78
+ [-0.23, 0.05]
79
+ ],
80
+ [
81
+ [-0.25, -0.39],
82
+ [0.25, -0.39],
83
+ [0.09, -0.14],
84
+ [-0.03, 0.12],
85
+ [-0.11, 0.41]
86
+ ],
87
+ [
88
+ [0, -0.02],
89
+ [-0.21, -0.16],
90
+ [-0.21, -0.29],
91
+ [-0.06, -0.39],
92
+ [0.12, -0.37],
93
+ [0.23, -0.24],
94
+ [0.16, -0.1],
95
+ [0, -0.02],
96
+ [-0.2, 0.09],
97
+ [-0.25, 0.26],
98
+ [-0.12, 0.39],
99
+ [0.1, 0.4],
100
+ [0.24, 0.29],
101
+ [0.24, 0.13],
102
+ [0, -0.02]
103
+ ],
104
+ [
105
+ [0.24, -0.06],
106
+ [0.13, 0.05],
107
+ [-0.06, 0.05],
108
+ [-0.22, -0.04],
109
+ [-0.24, -0.22],
110
+ [-0.15, -0.36],
111
+ [0.04, -0.4],
112
+ [0.2, -0.31],
113
+ [0.24, -0.13],
114
+ [0.22, 0.15],
115
+ [0.11, 0.35],
116
+ [-0.08, 0.42],
117
+ [-0.2, 0.34]
118
+ ]
119
+ ];
120
+ function x(n) {
121
+ const l = [0];
122
+ for (let t = 1; t < n.length; t++)
123
+ l.push(
124
+ l[t - 1] + Math.hypot(n[t][0] - n[t - 1][0], n[t][1] - n[t - 1][1])
125
+ );
126
+ let r = 1;
127
+ return Array.from({ length: 35 }, (t, e) => {
128
+ const c = l[l.length - 1] * e / 34;
129
+ for (; c > l[r] && r < n.length - 1; ) r++;
130
+ const i = (c - l[r - 1]) / (l[r] - l[r - 1]);
131
+ return [
132
+ u(n[r - 1][0], n[r][0], i),
133
+ u(n[r - 1][1], n[r][1], i)
134
+ ];
135
+ });
136
+ }
137
+ const m = d.map(x);
138
+ function P(n) {
139
+ return m[n] ?? m[0];
140
+ }
141
+ function v(n, l, r = 1, t = {}) {
142
+ if (r <= 0) return;
143
+ const { ctx: e, size: c, color: i } = n, h = Math.min(
144
+ l.length,
145
+ Math.ceil(g(r) * (l.length - 1)) + 1
146
+ );
147
+ e.save(), e.strokeStyle = e.fillStyle = t.color ?? i, e.lineWidth = (t.width ?? 0.11) * c, e.lineCap = e.lineJoin = "round", e.globalAlpha *= t.alpha ?? 1, e.beginPath(), e.moveTo(l[0][0] * c, l[0][1] * c);
148
+ for (let o = 1; o < h; o++) {
149
+ const [a, f] = l[o];
150
+ if (t.smooth && o + 1 < h) {
151
+ const s = l[o + 1];
152
+ e.quadraticCurveTo(
153
+ a * c,
154
+ f * c,
155
+ (a + s[0]) * c / 2,
156
+ (f + s[1]) * c / 2
157
+ );
158
+ } else e.lineTo(a * c, f * c);
159
+ }
160
+ t.close && e.closePath(), t.fill ? e.fill() : e.stroke(), e.restore();
161
+ }
162
+ export {
163
+ P as digitPath,
164
+ v as tracePath
165
+ };
@@ -0,0 +1,66 @@
1
+ import { glyph as y, smooth as g, wave as r } from "./paint.js";
2
+ function b(a) {
3
+ return a < 1 / 2.75 ? 7.5625 * a ** 2 : a < 2 / 2.75 ? 7.5625 * (a - 1.5 / 2.75) ** 2 + 0.75 : a < 2.5 / 2.75 ? 7.5625 * (a - 2.25 / 2.75) ** 2 + 0.9375 : 7.5625 * (a - 2.625 / 2.75) ** 2 + 0.984375;
4
+ }
5
+ function p(a, e) {
6
+ const { p: t, strength: n, from: l, to: M, index: i } = a, h = 1 - t, s = Math.sin(2 * Math.PI * (a.plan.cycles ?? 3) * t) * h * n, o = r(t) * n, x = (Math.exp(-(((t - 0.3) * 12) ** 2)) + 0.55 * Math.exp(-(((t - 0.47) * 15) ** 2))) * n, c = [
7
+ { y: -(1 - t ** 2) * 0.82 * n },
8
+ { y: -(1 - t ** 3) * 0.98 * n, angle: -0.2 * h * n },
9
+ {
10
+ y: -(1 - b(t)) * 0.86 * n,
11
+ sx: 1 + 0.15 * s,
12
+ sy: 1 - 0.16 * s
13
+ },
14
+ { sy: 1 + s * 0.66, sx: 1 - s * 0.23 },
15
+ { sx: 1 + s * 0.48, sy: 1 - s * 0.48 },
16
+ {
17
+ x: s * 0.14,
18
+ sx: 1 + s * 0.28,
19
+ sy: 1 - s * 0.25,
20
+ angle: 0.12 * s
21
+ },
22
+ { sx: 1 + 0.35 * o, sy: 1 - 0.34 * o, y: 0.15 * o },
23
+ {
24
+ x: 0.24 * s,
25
+ y: 0.13 * Math.abs(s),
26
+ angle: 0.9 * s
27
+ },
28
+ { x: 0.28 * s, angle: 0.3 * s },
29
+ { x: -(h ** 3) * 0.95 * n, blur: 0.05 * h },
30
+ {
31
+ x: h ** 2 * 0.55 * n - s * 0.2,
32
+ sx: 1 + Math.abs(s) * 0.16
33
+ },
34
+ { y: Math.sin(t * Math.PI * 4 - i * 0.72) * 0.36 * o },
35
+ {
36
+ sx: 1 + 0.24 * Math.abs(s),
37
+ sy: 1 + 0.24 * Math.abs(s)
38
+ },
39
+ { sx: 1 + 0.25 * o, sy: 1 + 0.25 * o, alpha: 0.7 + 0.3 * t },
40
+ { sx: 1 + 0.25 * x, sy: 1 + 0.25 * x, glow: 0.16 * x },
41
+ {
42
+ x: 0.11 * Math.sin(18 * Math.PI * t) * o,
43
+ y: 0.08 * Math.cos(24 * Math.PI * t) * o
44
+ },
45
+ {
46
+ x: 0.12 * s,
47
+ sy: 1 - 0.34 * Math.abs(s),
48
+ glow: 0.22 * h * n
49
+ },
50
+ {
51
+ y: -Math.sin(Math.PI * g(t)) * 0.76 * n + h * 0.14,
52
+ x: -0.42 * h,
53
+ angle: -0.46 * h
54
+ },
55
+ {
56
+ angle: h * Math.PI * 2,
57
+ sx: 0.25 + 0.75 * t + 0.23 * o,
58
+ sy: 0.25 + 0.75 * t + 0.23 * o
59
+ },
60
+ { y: s * 0.38, x: h * 0.65 * n, angle: s * 0.42 }
61
+ ];
62
+ y(a, l, { alpha: h ** 3 }), y(a, M, { alpha: Math.min(1, t * 4 + 0.2), ...c[e] });
63
+ }
64
+ export {
65
+ p as paintPhysics
66
+ };
@@ -0,0 +1,89 @@
1
+ import { glyph as e, wave as p } from "./paint.js";
2
+ import { paintRoll as i } from "./rolling.js";
3
+ import { paintSpatial as o } from "./spatial.js";
4
+ import { paintMorph as d } from "./morph.js";
5
+ import { paintReveal as c } from "./reveal.js";
6
+ import { paintPhysics as s } from "./physics.js";
7
+ import { paintParticles as y } from "./particles.js";
8
+ import { paintDigital as l } from "./digital.js";
9
+ import { paintSpecial as b, paintSequence as w, paintData as v } from "./scenarios.js";
10
+ const S = {
11
+ rolling: i,
12
+ spatial: o,
13
+ morph: d,
14
+ reveal: c,
15
+ physics: s,
16
+ particles: y,
17
+ digital: l,
18
+ data: v,
19
+ sequence: w,
20
+ special: b
21
+ };
22
+ function j(t) {
23
+ const { plan: a, digit: n, from: u, to: h, p: r, strength: g } = t;
24
+ if (a.entry) {
25
+ S[a.entry.category](t, a.entry.variant);
26
+ return;
27
+ }
28
+ switch (a.effect) {
29
+ case "odometer":
30
+ i(t, 19);
31
+ return;
32
+ case "wheel":
33
+ i(t, 6);
34
+ return;
35
+ case "slot":
36
+ i(t, 10);
37
+ return;
38
+ case "random":
39
+ l(t, 9);
40
+ return;
41
+ case "scramble":
42
+ l(t, 6);
43
+ return;
44
+ case "flip":
45
+ o(t, 14);
46
+ return;
47
+ case "appear":
48
+ c(t, 0);
49
+ return;
50
+ case "disappear":
51
+ e(t, u, { alpha: 1 - r, y: -0.3 * r }), e(t, h, { alpha: r });
52
+ return;
53
+ case "fade":
54
+ e(t, u, { alpha: 1 - r }), e(t, h, { alpha: r });
55
+ return;
56
+ case "scale":
57
+ o(t, 10);
58
+ return;
59
+ case "bounce":
60
+ s(t, 2);
61
+ return;
62
+ case "spring":
63
+ s(t, 3);
64
+ return;
65
+ case "slide":
66
+ c(t, 7);
67
+ return;
68
+ case "blur":
69
+ e(t, n, { blur: (1 - r) * 0.16 * g });
70
+ return;
71
+ case "flash":
72
+ e(t, n, { alpha: 1 - 0.3 * p(r) });
73
+ return;
74
+ case "highlight":
75
+ e(t, n, { glow: 0.22 * p(r), color: t.accent });
76
+ return;
77
+ case "gradient":
78
+ e(t, n, {
79
+ color: r < 0.5 ? t.accent : t.color,
80
+ glow: 0.1 * p(r)
81
+ });
82
+ return;
83
+ default:
84
+ e(t, n);
85
+ }
86
+ }
87
+ export {
88
+ j as paintNumberAnimation
89
+ };
@@ -0,0 +1,125 @@
1
+ import { glyph as r, noise as T, clamp as g, rectangle as b, smooth as R, localProgress as k } from "./paint.js";
2
+ import { tracePath as v, digitPath as z } from "./paths.js";
3
+ function j(c, h) {
4
+ const { p: u, from: d, to: i, index: P, count: w, size: n, width: x, strength: p, ctx: s } = c, t = x / n * 0.54;
5
+ let e = R(u);
6
+ [0, 10, 18, 19].includes(h) && (e = k(e, P, w, h === 10 ? 0.8 : 0.58)), r(c, d, { alpha: (1 - u) ** 2 * 0.55 });
7
+ const o = (l, a, y, M, I = () => r(c, i)) => b(c, l, a, y, M, I);
8
+ switch (h) {
9
+ case 0:
10
+ r(c, i, { alpha: e, y: (1 - e) * 0.18 });
11
+ return;
12
+ case 1: {
13
+ s.save(), s.beginPath(), s.ellipse(0, 0, t * e * 1.5 * n, 0.85 * e * n, 0, 0, 2 * Math.PI), s.clip(), r(c, i), s.restore();
14
+ return;
15
+ }
16
+ case 2:
17
+ o(-t, -0.6, t * 2 * e, 1.2);
18
+ return;
19
+ case 3:
20
+ o(-t, -0.6, t * 2, 1.2 * e), o(
21
+ -t,
22
+ -0.6 + e * 1.2,
23
+ t * 2,
24
+ 0.05,
25
+ () => r(c, i, { color: c.accent, glow: 0.11 })
26
+ );
27
+ return;
28
+ case 4: {
29
+ s.save(), s.beginPath(), s.moveTo(-t * n, -0.62 * n), s.lineTo((-t + t * 4 * e) * n, -0.62 * n), s.lineTo((-t + t * 4 * e - t * 0.8) * n, 0.62 * n), s.lineTo(-t * n, 0.62 * n), s.clip(), r(c, i), s.restore();
30
+ return;
31
+ }
32
+ case 5:
33
+ o(-t * e, -0.6, 2 * t * e, 1.2);
34
+ return;
35
+ case 6:
36
+ o(-t, -0.6, t * e, 1.2), o(t * (1 - e), -0.6, t * e, 1.2);
37
+ return;
38
+ case 7:
39
+ o(
40
+ -t,
41
+ -0.6,
42
+ t * 2,
43
+ 1.2,
44
+ () => r(c, i, { y: (1 - e) * p })
45
+ );
46
+ return;
47
+ case 8:
48
+ o(
49
+ -t,
50
+ -0.6,
51
+ t * 2,
52
+ 1.2,
53
+ () => r(c, i, { y: (e - 1) * p })
54
+ );
55
+ return;
56
+ case 9:
57
+ for (let l = 0; l < 5; l++) o(-t, -0.6 + l * 0.24, t * 2, 0.24 * e);
58
+ return;
59
+ case 10:
60
+ e > 0.25 && r(c, i);
61
+ return;
62
+ case 11:
63
+ case 12:
64
+ v(c, z(c.toIndex), e, {
65
+ smooth: h === 11,
66
+ width: h === 11 ? 0.085 : 0.065,
67
+ color: c.accent
68
+ }), r(c, i, { alpha: g((e - 0.78) / 0.22) });
69
+ return;
70
+ case 13:
71
+ r(c, i, { stroke: 0.02 }), o(-t, 0.6 - e * 1.2, t * 2, e * 1.2);
72
+ return;
73
+ case 14:
74
+ o(-t, 0.6 - e * 1.2, t * 2, e * 1.2);
75
+ return;
76
+ case 15:
77
+ for (let l = 0; l < 12; l++) {
78
+ const a = g(
79
+ e + 0.13 * Math.sin(l / 2 + u * 10) * Math.sin(u * Math.PI)
80
+ );
81
+ o(-t + l * t / 6, 0.6 - a * 1.2, t / 6 + 5e-3, a * 1.2);
82
+ }
83
+ return;
84
+ case 16:
85
+ r(c, i, { alpha: 0.55 + e * 0.45 }), o(
86
+ -t + 2 * t * e,
87
+ -0.6,
88
+ 0.09,
89
+ 1.2,
90
+ () => r(c, i, { color: c.accent, glow: 0.2 })
91
+ );
92
+ return;
93
+ case 17:
94
+ o(-t, -0.6, e * t * 2, 1.2), s.save(), s.globalAlpha *= Math.sin(Math.PI * u) * 0.52, s.fillStyle = c.accent, s.fillRect(
95
+ (-t + t * 2 * e) * n,
96
+ -0.6 * n,
97
+ 0.022 * n,
98
+ 1.2 * n
99
+ ), s.restore();
100
+ return;
101
+ case 18:
102
+ for (let l = 0; l < 6; l++) {
103
+ const a = (T(c.seed, l) - 0.5) * (1 - e) * p;
104
+ o(
105
+ -t,
106
+ -0.6 + l * 0.2,
107
+ t * 2,
108
+ 0.2,
109
+ () => r(c, i, { x: a, alpha: e })
110
+ );
111
+ }
112
+ return;
113
+ default:
114
+ o(
115
+ -t,
116
+ -0.6,
117
+ t * 2 * e,
118
+ 1.2,
119
+ () => r(c, i, { y: 0.4 * (1 - e), alpha: e })
120
+ );
121
+ }
122
+ }
123
+ export {
124
+ j as paintReveal
125
+ };
@@ -0,0 +1,66 @@
1
+ import { rectangle as W, glyph as z, noise as j, rollingGlyph as k, smooth as h, localProgress as P, clamp as q, wave as B } from "./paint.js";
2
+ function F(c, t) {
3
+ const { p: o, index: n, count: a, fromIndex: p, toIndex: I, ctx: s, size: M, width: r, strength: A } = c, f = I < p ? -1 : 1, G = ((I - p) * f + 10) % 10, R = [
4
+ h(o),
5
+ o,
6
+ h(o),
7
+ P(o, n, a, 0.34),
8
+ o,
9
+ 1 - (1 - o) ** 4,
10
+ o ** 3,
11
+ 1 - (1 - o) ** 3,
12
+ 1 - (1 - o) ** 2 * Math.cos(o * Math.PI * 1.8),
13
+ 1 - Math.exp(-5 * o) * Math.cos(o * Math.PI * 5) * (1 - o),
14
+ o,
15
+ (Math.floor(o * 3) + h(o * 3 % 1)) / 3,
16
+ Math.floor(o * 8) / 8,
17
+ Math.floor(o * 5) / 5,
18
+ o ** (0.65 + n / Math.max(1, a - 1) * 1.45),
19
+ h(o),
20
+ P(o, n % 2, 2, 0.36),
21
+ P(o, n, a, 0.42),
22
+ h(o),
23
+ o
24
+ ][t] ?? o;
25
+ let x = (Math.round(
26
+ c.plan.cycles ?? (t === 10 ? 4 : [12, 13, 19].includes(t) ? 0 : 1)
27
+ ) * 10 + G) * f * R;
28
+ t === 13 && (x = Math.trunc(x / 2) * 2);
29
+ const y = Math.floor(x), w = x - y, g = t === 18 ? h(q((w - 0.65) / 0.35)) : w, d = c.axis === "horizontal" || t === 2, S = d ? r / M : 0.88, T = (l) => (l - g) * S, b = (l) => {
30
+ const e = T(l), i = t === 0 || t === 1, u = i ? Math.max(0.18, Math.cos((l - g) * 1.22)) : 1;
31
+ z(c, k(c, p + y + l), {
32
+ x: d ? e : t === 4 ? Math.sin(e * 4 + o * 10) * 0.22 * B(o) * A : 0,
33
+ y: d ? 0 : e,
34
+ sx: d ? u : 1,
35
+ sy: d ? 1 : u,
36
+ angle: t === 1 ? e * 0.45 : t === 4 ? e * 0.55 : 0,
37
+ alpha: i ? 0.45 + 0.55 * u : 1,
38
+ blur: t === 5 ? 0.045 * (1 - o) : 0
39
+ });
40
+ };
41
+ if (t === 1) {
42
+ s.save(), s.rotate(o * Math.PI * 2), s.strokeStyle = c.accent, s.globalAlpha *= 0.38, s.lineWidth = 0.035 * M, s.beginPath();
43
+ for (let l = 0; l <= 32; l++) {
44
+ const e = l / 32 * 2 * Math.PI, i = M * (l % 4 < 2 ? 0.56 : 0.47);
45
+ s.lineTo(Math.cos(e) * i, Math.sin(e) * i);
46
+ }
47
+ s.closePath(), s.stroke(), s.restore();
48
+ }
49
+ W(
50
+ c,
51
+ -r / M * 0.52,
52
+ -0.55,
53
+ r / M * 1.04,
54
+ 1.1,
55
+ () => {
56
+ b(0), [12, 13].includes(t) || b(1);
57
+ }
58
+ ), (t === 19 || t === 18 || t === 11) && z(c, k(c, p + y), {
59
+ color: c.accent,
60
+ alpha: 0.7 * (t === 19 ? (1 - g) ** 8 : g ** 6),
61
+ glow: 0.07 + 0.02 * j(c.seed, n)
62
+ });
63
+ }
64
+ export {
65
+ F as paintRoll
66
+ };