hys-ui 0.3.0 → 0.5.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 (168) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +68 -73
  3. package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
  4. package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +467 -2
  5. package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.js +7 -0
  6. package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas2.vue.js +166 -0
  7. package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.js +7 -0
  8. package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits2.vue.js +105 -0
  9. package/dist/components/HysAnimatedNumber/animation/digital.js +186 -0
  10. package/dist/components/HysAnimatedNumber/animation/morph.js +110 -0
  11. package/dist/components/HysAnimatedNumber/animation/paint.js +34 -0
  12. package/dist/components/HysAnimatedNumber/animation/particles.js +51 -0
  13. package/dist/components/HysAnimatedNumber/animation/paths.js +165 -0
  14. package/dist/components/HysAnimatedNumber/animation/physics.js +66 -0
  15. package/dist/components/HysAnimatedNumber/animation/render.js +89 -0
  16. package/dist/components/HysAnimatedNumber/animation/reveal.js +125 -0
  17. package/dist/components/HysAnimatedNumber/animation/rolling.js +66 -0
  18. package/dist/components/HysAnimatedNumber/animation/scenarios.js +217 -0
  19. package/dist/components/HysAnimatedNumber/animation/spatial.js +112 -0
  20. package/dist/components/HysAnimatedNumber/useNumberCountdown.js +58 -0
  21. package/dist/components/HysAnimatedNumber/useNumberVisuals.js +60 -0
  22. package/dist/components/HysButton/HysButton.vue.js +2 -2
  23. package/dist/components/HysButton/HysButton2.vue.js +227 -60
  24. package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
  25. package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
  26. package/dist/components/HysFormItem/HysFormItem.vue.js +1 -1
  27. package/dist/components/HysFormItem/HysFormItem2.vue.js +231 -229
  28. package/dist/components/HysInput/HysInput.vue.js +2 -2
  29. package/dist/components/HysInput/HysInput2.vue.js +327 -274
  30. package/dist/components/HysMention/HysMention.vue.js +1 -1
  31. package/dist/components/HysMention/HysMention2.vue.js +1092 -154
  32. package/dist/components/HysModal/HysModal.vue.js +3 -3
  33. package/dist/components/HysModal/HysModal2.vue.js +81 -80
  34. package/dist/components/HysPagination/HysPagination.vue.js +2 -2
  35. package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
  36. package/dist/components/HysSearch/HysSearch.vue.js +5 -82
  37. package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
  38. package/dist/components/HysSelect/HysSelect.vue.js +2 -2
  39. package/dist/components/HysSelect/HysSelect2.vue.js +472 -443
  40. package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
  41. package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
  42. package/dist/components/HysTable/HysTable.vue.js +2 -2
  43. package/dist/components/HysTable/HysTable2.vue.js +1418 -1150
  44. package/dist/components/HysTextarea/HysTextarea.vue.js +56 -32
  45. package/dist/components/HysTour/HysTour.vue.js +291 -67
  46. package/dist/components/HysTour/HysTour3.vue.js +5 -0
  47. package/dist/composables/animatedNumberDigits.js +106 -0
  48. package/dist/composables/animatedNumberFormat.js +222 -0
  49. package/dist/composables/animatedNumberTiming.js +66 -0
  50. package/dist/composables/buttonGroup.js +12 -0
  51. package/dist/composables/floatingPosition.js +18 -0
  52. package/dist/composables/mentionDocument.js +79 -0
  53. package/dist/composables/mentionEditor.js +58 -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/selectOptions.js +44 -38
  58. package/dist/composables/splitPaneSizes.js +58 -0
  59. package/dist/composables/table.js +128 -105
  60. package/dist/composables/textInput.js +23 -14
  61. package/dist/composables/useDialog.js +50 -50
  62. package/dist/composables/useFloating.js +107 -103
  63. package/dist/composables/useHysAnimatedNumber.js +264 -0
  64. package/dist/composables/useHysNumberAnimationGroup.js +23 -0
  65. package/dist/composables/useMentionCaret.js +81 -0
  66. package/dist/composables/useMentionList.js +81 -0
  67. package/dist/composables/useMentionModel.js +90 -0
  68. package/dist/composables/useMentionOptions.js +421 -0
  69. package/dist/composables/useSplitPaneDrag.js +52 -0
  70. package/dist/composables/useSplitPaneStorage.js +38 -0
  71. package/dist/composables/useTable.js +344 -312
  72. package/dist/composables/useTableSticky.js +79 -0
  73. package/dist/composables/useTextareaSize.js +62 -46
  74. package/dist/composables/useTourLayout.js +129 -0
  75. package/dist/config.js +11 -11
  76. package/dist/index.js +183 -152
  77. package/dist/internal/MultiSplitPane.vue.js +305 -0
  78. package/dist/internal/MultiSplitPane2.vue.js +4 -0
  79. package/dist/style.css +1 -1
  80. package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +99 -6
  81. package/dist/types/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.d.ts +19 -0
  82. package/dist/types/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.d.ts +31 -0
  83. package/dist/types/components/HysAnimatedNumber/animation/digital.d.ts +3 -0
  84. package/dist/types/components/HysAnimatedNumber/animation/morph.d.ts +2 -0
  85. package/dist/types/components/HysAnimatedNumber/animation/paint.d.ts +44 -0
  86. package/dist/types/components/HysAnimatedNumber/animation/particles.d.ts +5 -0
  87. package/dist/types/components/HysAnimatedNumber/animation/paths.d.ts +12 -0
  88. package/dist/types/components/HysAnimatedNumber/animation/physics.d.ts +2 -0
  89. package/dist/types/components/HysAnimatedNumber/animation/render.d.ts +2 -0
  90. package/dist/types/components/HysAnimatedNumber/animation/reveal.d.ts +2 -0
  91. package/dist/types/components/HysAnimatedNumber/animation/rolling.d.ts +2 -0
  92. package/dist/types/components/HysAnimatedNumber/animation/scenarios.d.ts +4 -0
  93. package/dist/types/components/HysAnimatedNumber/animation/spatial.d.ts +2 -0
  94. package/dist/types/components/HysAnimatedNumber/useNumberCountdown.d.ts +8 -0
  95. package/dist/types/components/HysAnimatedNumber/useNumberVisuals.d.ts +12 -0
  96. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +12 -3
  97. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +2 -2
  98. package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
  99. package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
  100. package/dist/types/components/HysCard/HysCard.vue.d.ts +1 -1
  101. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +3 -3
  102. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +3 -3
  103. package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +3 -3
  104. package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +2 -2
  105. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +3 -3
  106. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +6 -6
  107. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +3 -3
  108. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +2 -2
  109. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
  110. package/dist/types/components/HysInput/HysInput.vue.d.ts +13 -1
  111. package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -40
  112. package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
  113. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
  114. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
  115. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +1 -1
  116. package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
  117. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +46 -8
  118. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +6 -1
  119. package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +2 -2
  120. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
  121. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
  122. package/dist/types/components/HysTable/HysTable.vue.d.ts +1740 -3
  123. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +1 -1
  124. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +1 -1
  125. package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +13 -2
  126. package/dist/types/components/HysToast/HysToast.vue.d.ts +1 -1
  127. package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +1 -1
  128. package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -9
  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/buttonGroup.d.ts +9 -0
  136. package/dist/types/composables/drawer.d.ts +1 -1
  137. package/dist/types/composables/floatingPosition.d.ts +14 -0
  138. package/dist/types/composables/mention.d.ts +284 -0
  139. package/dist/types/composables/mentionDocument.d.ts +15 -0
  140. package/dist/types/composables/mentionEditor.d.ts +7 -0
  141. package/dist/types/composables/modal.d.ts +2 -0
  142. package/dist/types/composables/numberAnimation.d.ts +29 -0
  143. package/dist/types/composables/numberAnimationCatalog.d.ts +58 -0
  144. package/dist/types/composables/numberAnimationSequence.d.ts +13 -0
  145. package/dist/types/composables/selectOptions.d.ts +5 -0
  146. package/dist/types/composables/splitPaneSizes.d.ts +11 -0
  147. package/dist/types/composables/table.d.ts +116 -6
  148. package/dist/types/composables/textInput.d.ts +39 -4
  149. package/dist/types/composables/tour.d.ts +68 -0
  150. package/dist/types/composables/useFloating.d.ts +1 -1
  151. package/dist/types/composables/useHysAnimatedNumber.d.ts +37 -0
  152. package/dist/types/composables/useHysNumberAnimationGroup.d.ts +4 -0
  153. package/dist/types/composables/useMentionCaret.d.ts +6 -0
  154. package/dist/types/composables/useMentionList.d.ts +23 -0
  155. package/dist/types/composables/useMentionModel.d.ts +14 -0
  156. package/dist/types/composables/useMentionOptions.d.ts +26 -0
  157. package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
  158. package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
  159. package/dist/types/composables/useTable.d.ts +7 -3
  160. package/dist/types/composables/useTableSticky.d.ts +22 -0
  161. package/dist/types/composables/useTextareaSize.d.ts +5 -2
  162. package/dist/types/composables/useTourLayout.d.ts +33 -0
  163. package/dist/types/config.d.ts +1 -0
  164. package/dist/types/index.d.ts +46 -1
  165. package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
  166. package/package.json +3 -2
  167. package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
  168. package/dist/components/HysTour/HysTour2.vue.js +0 -4
@@ -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
+ };
@@ -0,0 +1,217 @@
1
+ import { rectangle as D, wave as k, glyph as g, clamp as w, noise as S, smooth as T, localProgress as W } from "./paint.js";
2
+ import { paintRoll as I } from "./rolling.js";
3
+ import { paintSpatial as z } from "./spatial.js";
4
+ import { paintPhysics as A } from "./physics.js";
5
+ import { paintReveal as x } from "./reveal.js";
6
+ import { paintParticles as C } from "./particles.js";
7
+ import { paintDigital as q } from "./digital.js";
8
+ function b(e, o, s) {
9
+ const { ctx: l, size: n, width: h, accent: t } = e;
10
+ l.save(), l.strokeStyle = l.fillStyle = t, l.lineWidth = 0.025 * n, l.lineCap = "round", l.globalAlpha *= 0.8;
11
+ const d = h / n * 0.48;
12
+ if (s === 17 || s === 18)
13
+ l.beginPath(), l.arc(0, 0, 0.53 * n, -Math.PI / 2, Math.PI * (2 * o - 0.5)), l.stroke(), s === 18 && (l.beginPath(), l.moveTo(0, 0.42 * n), l.lineTo(
14
+ Math.cos(Math.PI * (o - 1)) * 0.33 * n,
15
+ (0.42 + Math.sin(Math.PI * (o - 1)) * 0.33) * n
16
+ ), l.stroke());
17
+ else if (s === 19 || s === 20) {
18
+ l.beginPath(), l.moveTo(-d * n, 0.64 * n);
19
+ for (let M = 1; M <= 8; M++) {
20
+ const i = M / 8, f = s === 19 ? 0.62 - 0.17 * i - Math.sin(i * 11) * 0.08 : 0.64 - i * 0.21;
21
+ l.lineTo((-d + d * 2 * i * o) * n, f * n);
22
+ }
23
+ l.stroke();
24
+ } else l.fillRect(-d * n, 0.58 * n, d * 2 * o * n, 0.028 * n);
25
+ l.restore();
26
+ }
27
+ function K(e, o) {
28
+ const { p: s, from: l, to: n, digit: h, index: t, strength: d, accent: M, ctx: i, size: f } = e;
29
+ if (o === 2 && e.section === "integer") {
30
+ g(e, h);
31
+ return;
32
+ }
33
+ if (o < 3 || o === 28 || o === 29) {
34
+ I(e, [17, 7, 15][o] ?? (o === 28 ? 13 : 19));
35
+ return;
36
+ }
37
+ if (o === 3 || o === 4) {
38
+ z(e, o === 3 ? 6 : 14);
39
+ return;
40
+ }
41
+ if (o === 5) {
42
+ x(e, 19);
43
+ return;
44
+ }
45
+ if (o === 10 || o === 11) {
46
+ x(e, o === 10 ? 5 : 14);
47
+ return;
48
+ }
49
+ if (o >= 16 && o <= 20) {
50
+ g(e, h), b(e, s, o);
51
+ return;
52
+ }
53
+ if ([21, 22, 23, 24].includes(o)) {
54
+ A(
55
+ e,
56
+ o === 22 ? 19 : o === 23 ? 0 : o === 24 ? 12 : 11
57
+ );
58
+ return;
59
+ }
60
+ const c = k(s) * d, p = [6, 8, 12, 13, 14, 15, 26].includes(o), y = o === 25 || o === 27 ? "#df5268" : M, P = [6, 7, 12, 13, 14, 15, 25, 26, 27].includes(o);
61
+ if (g(e, l, { y: (p ? 0.28 : -0.28) * s, alpha: (1 - s) ** 2 }), g(e, n, {
62
+ y: (p ? -0.23 : 0.23) * (1 - s) * d,
63
+ sx: 1 + (P ? 0.18 * c : 0),
64
+ sy: 1 + (P ? 0.18 * c : 0),
65
+ alpha: Math.min(1, 0.35 + s),
66
+ color: P && s > 0.28 ? y : void 0,
67
+ glow: P ? c * 0.2 : 0
68
+ }), (o === 8 || o === 9) && t === e.count - 1 && g(e, o === 8 ? "↑" : "↓", {
69
+ x: 0.57,
70
+ y: (1 - s) * 0.17,
71
+ sx: 0.47,
72
+ sy: 0.47,
73
+ color: y,
74
+ alpha: c
75
+ }), [6, 12, 26].includes(o)) {
76
+ i.save(), i.fillStyle = y, i.globalAlpha *= c * 0.7;
77
+ const u = o === 6 ? e.width * 0.52 : e.width * 0.72 * s;
78
+ i.fillRect(
79
+ -u / 2,
80
+ f * (o === 26 ? -0.58 : 0.54),
81
+ u,
82
+ f * 0.022
83
+ ), i.restore();
84
+ }
85
+ if (o === 13 || o === 14 || o === 15 || o === 25) {
86
+ i.save(), i.strokeStyle = y, i.lineWidth = 0.022 * f, i.globalAlpha *= c * 0.7;
87
+ const u = (0.42 + c * 0.16) * f;
88
+ o === 13 ? (i.setLineDash([f * 0.045, f * 0.045]), i.strokeRect(-u / 2, -u, u, u * 2)) : o === 14 || o === 15 ? (i.beginPath(), i.ellipse(
89
+ 0,
90
+ 0,
91
+ u * 0.62,
92
+ u * 1.16,
93
+ 0,
94
+ -Math.PI / 2,
95
+ (s * 2 - 0.5) * Math.PI
96
+ ), i.stroke(), o === 15 && b(e, s, 16)) : i.strokeRect(-u / 2, -u, u, u * 2), i.restore();
97
+ }
98
+ }
99
+ function B(e, o) {
100
+ const { p: s, from: l, to: n, size: h, ctx: t, seed: d, strength: M, accent: i } = e, f = [i, "#e9903d", "#d8649e", "#23aa85"];
101
+ g(e, l, { alpha: (1 - s) ** 3 }), g(e, n, { alpha: w(s * 1.7), glow: 0.17 * k(s) });
102
+ const c = w((s - 0.17) / 0.83);
103
+ if (c)
104
+ for (let p = 0; p < 18; p++) {
105
+ const y = p / 18 * Math.PI * 2 + S(d, p) * 0.19, P = (0.3 + S(d + 7, p) * 0.69) * T(c) * M, u = Math.cos(y) * P, R = Math.sin(y) * P + c ** 2 * (o ? 0.58 : 0.19);
106
+ t.save(), t.globalAlpha *= (1 - c) * 0.9, t.fillStyle = t.strokeStyle = f[p % f.length], o ? (t.translate(u * h, R * h), t.rotate(y + c * Math.PI * 3), t.fillRect(-0.023 * h, -0.046 * h, 0.047 * h, 0.095 * h)) : (t.shadowColor = t.strokeStyle, t.shadowBlur = h * 0.08, t.lineWidth = h * 0.021, t.beginPath(), t.moveTo(
107
+ (u - Math.cos(y) * 0.13 * (1 - c)) * h,
108
+ (R - Math.sin(y) * 0.13 * (1 - c)) * h
109
+ ), t.lineTo(u * h, R * h), t.stroke()), t.restore();
110
+ }
111
+ }
112
+ function N(e, o) {
113
+ const { p: s, index: l, count: n, seed: h } = e, t = Math.abs(l - (n - 1) / 2), d = Math.min(l, n - l - 1), M = [
114
+ l,
115
+ l,
116
+ Math.floor(l / 2),
117
+ t * 2,
118
+ d * 2,
119
+ S(h, l) * (n - 1),
120
+ 0,
121
+ l,
122
+ l % 2,
123
+ l,
124
+ l,
125
+ l % 3,
126
+ l,
127
+ d * 2,
128
+ Math.floor(l / 3),
129
+ Math.floor(l / 3) + l % 3,
130
+ l,
131
+ S(h + 37, l) * (n - 1),
132
+ Math.floor(l / 3),
133
+ l % 3
134
+ ][o], f = W(s, M, n, o === 6 ? 0 : o === 9 ? 0.75 : o === 10 ? 0.62 : o === 12 ? 0.54 : 0.45), c = { ...e, p: f };
135
+ if (f === 0) {
136
+ g(e, e.from);
137
+ return;
138
+ }
139
+ if (f === 1) {
140
+ g(e, e.to);
141
+ return;
142
+ }
143
+ o === 1 || o === 13 ? A(c, o === 1 ? 11 : 8) : o === 8 || o === 9 || o === 6 || o === 7 ? I(
144
+ { ...c, axis: l % 2 === 0 ? e.axis : "horizontal" },
145
+ o === 7 ? 17 : 15
146
+ ) : o === 10 ? x(c, 16) : o === 12 ? x(c, 8) : x(c, [2, 15, 16, 18, 19].includes(o) ? 18 : 2);
147
+ }
148
+ function O(e, o) {
149
+ const { p: s, from: l, to: n, size: h, ctx: t, seed: d, accent: M, width: i, strength: f } = e;
150
+ if (o === 0) {
151
+ z(e, 8);
152
+ return;
153
+ }
154
+ if (o <= 4) {
155
+ I(e, [0, 5, 10, 17, 6][o]);
156
+ return;
157
+ }
158
+ if (o === 9) {
159
+ C(e, 19), b(e, s, 17);
160
+ return;
161
+ }
162
+ if (o === 10 || o === 11) {
163
+ B(e, o === 11);
164
+ return;
165
+ }
166
+ if (o >= 14) {
167
+ if (o === 17 || o === 19)
168
+ b(e, s, o === 17 ? 18 : 16);
169
+ else {
170
+ const c = T(s) * 0.94, p = i / h * 0.47;
171
+ D(
172
+ e,
173
+ -p,
174
+ 0.49 - c,
175
+ p * 2,
176
+ c,
177
+ () => g(e, n, { color: M, glow: 0.1 })
178
+ ), t.save(), t.globalAlpha *= 0.38 * k(s), t.fillStyle = M, o === 15 && t.fillRect(
179
+ -i * 0.58,
180
+ (0.42 - c) * h,
181
+ 0.04 * h,
182
+ c * h
183
+ ), o === 16 && t.fillRect(-i * 0.5, -0.54 * h, i * s, 0.055 * h), o === 18 && t.fillRect(-i * 0.5, (0.55 - c) * h, i, 0.038 * h), t.restore();
184
+ }
185
+ g(e, n, { alpha: 0.38 + 0.62 * s });
186
+ return;
187
+ }
188
+ if (o === 7 || o === 8) {
189
+ g(e, l, { alpha: (1 - s) ** 3 }), g(e, n, { alpha: w(s * 1.4) });
190
+ for (let c = 0; c < 6; c++) {
191
+ const p = w(s * 1.6 - c * 0.09);
192
+ !p || p === 1 && o === 7 || (t.save(), t.globalAlpha *= k(s), t.fillStyle = c % 2 ? "#f1a52f" : "#ffd67a", t.beginPath(), t.ellipse(
193
+ (S(d, c) - 0.5) * i * 1.3,
194
+ (o === 7 ? -1 + p ** 2 * 1.55 : 0.48 - c * 0.085 - (1 - p) * 0.72) * h,
195
+ 0.11 * h,
196
+ (0.04 + Math.abs(Math.sin(p * 12)) * 0.035) * h,
197
+ 0,
198
+ 0,
199
+ Math.PI * 2
200
+ ), t.fill(), t.restore());
201
+ }
202
+ return;
203
+ }
204
+ if (o === 13) {
205
+ q(e, 27), b(e, s, 17);
206
+ return;
207
+ }
208
+ A(
209
+ { ...e, strength: f * 0.9 },
210
+ o === 12 ? 18 : o === 6 ? 14 : 2
211
+ ), b(e, s, 17);
212
+ }
213
+ export {
214
+ K as paintData,
215
+ N as paintSequence,
216
+ O as paintSpecial
217
+ };
@@ -0,0 +1,112 @@
1
+ import { glyph as w, wave as h, rectangle as d, smooth as S, mix as R } from "./paint.js";
2
+ function k(o, s, c, g = !1) {
3
+ const { p: t, from: M, to: l, ctx: y, size: p, strength: u } = o, x = [
4
+ { text: M, angle: t * 2 * Math.PI / s },
5
+ { text: l, angle: (t - 1) * 2 * Math.PI / s }
6
+ ];
7
+ s > 4 && (x.push({
8
+ text: o.glyphs[(o.fromIndex + 9) % 10],
9
+ angle: (t + 1) * 2 * Math.PI / s
10
+ }), x.push({
11
+ text: o.glyphs[(o.toIndex + 1) % 10],
12
+ angle: (t - 2) * 2 * Math.PI / s
13
+ }));
14
+ for (const q of x.sort(
15
+ (n, I) => Math.cos(n.angle) - Math.cos(I.angle)
16
+ )) {
17
+ const n = Math.cos(q.angle);
18
+ if (n <= 0) continue;
19
+ const I = (s > 4 ? 0.62 : 0.43) * (0.7 + u * 0.3), f = Math.sin(q.angle) * I, e = g ? Math.sqrt(n) : n;
20
+ y.save(), y.globalAlpha *= n * 0.28 * h(t), y.fillStyle = o.accent;
21
+ const A = (c ? f - 0.33 * e : -0.33) * p, b = (c ? -0.51 : f - 0.51 * e) * p;
22
+ y.fillRect(
23
+ A,
24
+ b,
25
+ 0.66 * p * (c ? e : 1),
26
+ 1.02 * p * (c ? 1 : e)
27
+ ), y.restore(), w(o, q.text, {
28
+ x: c ? f : 0,
29
+ y: c ? 0 : f,
30
+ sx: c ? e : g ? 0.88 + 0.12 * n : 1,
31
+ sy: c ? g ? 0.88 + 0.12 * n : 1 : e,
32
+ alpha: 0.38 + n * 0.62
33
+ });
34
+ }
35
+ }
36
+ function B(o, s) {
37
+ const { p: c, from: g, to: t, width: M, size: l, ctx: y } = o, p = s === 5 || s === 14 && o.axis === "horizontal", u = s === 9 ? 5 : s === 8 || s === 4 || s === 5 ? 2 : 1, x = M / l, q = Math.cos(c * Math.PI), n = c < 0.5, I = n ? g : t, f = s === 6 ? (n ? c : c - 1) * 0.36 : 0;
38
+ s === 8 && (d(
39
+ o,
40
+ -x / 2,
41
+ -0.57,
42
+ x,
43
+ 0.57,
44
+ () => w(o, n ? t : I)
45
+ ), d(
46
+ o,
47
+ -x / 2,
48
+ 0,
49
+ x,
50
+ 0.57,
51
+ () => w(o, n ? I : g)
52
+ ));
53
+ for (let e = 0; e < u; e++) {
54
+ const A = p ? x / u * e - x / 2 : 1.12 / u * e - 0.56, b = p ? [A, -0.56, x / u, 1.12] : [-x / 2, A, x, 1.12 / u], P = s === 9 ? S(c * 1.25 - e * 0.055) : c, F = Math.abs(s === 9 ? Math.cos(P * Math.PI) : q), j = s === 7 ? -0.62 * h(P) : s === 8 ? 0.25 * h(P) * (n ? -1 : 1) : 0;
55
+ d(o, b[0], b[1], b[2], b[3], () => {
56
+ y.globalAlpha *= s === 8 ? 0.92 : 1, w(o, P < 0.5 ? g : t, {
57
+ x: p && s === 5 ? (e - 0.5) * 0.25 * h(P) : 0,
58
+ y: j + (s === 4 ? (e - 0.5) * 0.3 * h(P) : 0),
59
+ sx: p ? F : 1,
60
+ sy: p ? 1 : F,
61
+ angle: f
62
+ });
63
+ });
64
+ }
65
+ }
66
+ function D(o, s) {
67
+ const { from: c, to: g, p: t, strength: M } = o;
68
+ if (s < 4 || s === 15) {
69
+ k(
70
+ o,
71
+ [4, 8, 10, 6][s] ?? 3,
72
+ s === 0 || s === 2 || s === 15,
73
+ s === 2
74
+ );
75
+ return;
76
+ }
77
+ if (s <= 9 || s === 14) {
78
+ B(o, s);
79
+ return;
80
+ }
81
+ const l = (1 - t) * M, y = {
82
+ 10: {
83
+ sx: 0.5 + S(t) * 0.5 + h(t) * 0.32,
84
+ sy: 0.5 + S(t) * 0.5 + h(t) * 0.32
85
+ },
86
+ 11: { sx: 1 + l * 0.75, sy: 1 + l * 0.75, blur: 0.045 * l },
87
+ 12: { sx: 0.25 + 0.75 * t, sy: 1 + 0.16 * l, angle: l * 0.5, x: -0.3 * l },
88
+ 13: {
89
+ sx: R(0.25, 1, t),
90
+ sy: R(0.25, 1, t),
91
+ x: 0.6 * l,
92
+ y: -0.32 * l,
93
+ blur: 0.06 * l
94
+ },
95
+ 16: {
96
+ y: -0.28 * h(t) * M,
97
+ sx: 1 + h(t) * 0.12,
98
+ sy: 1 + h(t) * 0.12,
99
+ glow: 0.2 * h(t)
100
+ },
101
+ 17: { angle: -0.48 * l, sx: 1 - 0.28 * l, sy: 1 + 0.12 * l },
102
+ 18: { sx: 1 + 0.4 * h(t) * M, sy: 1 - 0.42 * h(t) * M },
103
+ 19: { sx: 0.14 + 0.86 * S(t), sy: 0.42 + 0.58 * t, angle: l * 0.28 }
104
+ };
105
+ w(o, c, { alpha: (1 - t) ** 2, sx: 1 + t * 0.3, sy: 1 + t * 0.3 }), w(o, g, {
106
+ ...y[s],
107
+ alpha: t ** 0.5
108
+ });
109
+ }
110
+ export {
111
+ D as paintSpatial
112
+ };