@voidzero-dev/vitepress-theme 0.0.18 → 0.1.33
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.
- package/README.md +60 -0
- package/dist/assets/clients/bolt.svg +5 -0
- package/dist/assets/clients/cloudflare.svg +26 -0
- package/dist/assets/clients/framer.svg +16 -0
- package/dist/assets/clients/hugging-face.svg +9 -0
- package/dist/assets/clients/linear.svg +7 -0
- package/dist/assets/clients/mercedes.svg +2865 -0
- package/dist/assets/clients/openai.svg +1 -0
- package/dist/assets/clients/plaid.svg +7 -0
- package/dist/assets/clients/ramp.svg +1 -0
- package/dist/assets/clients/shopify.svg +30 -0
- package/dist/assets/icons/oxc-dark.svg +124 -0
- package/dist/assets/icons/oxc-light.svg +124 -0
- package/dist/assets/icons/oxc-mono.svg +5 -0
- package/dist/assets/icons/rolldown-dark.svg +92 -0
- package/dist/assets/icons/rolldown-light.svg +92 -0
- package/dist/assets/icons/rolldown-mono.svg +5 -0
- package/dist/assets/icons/vite-dark.svg +132 -0
- package/dist/assets/icons/vite-light.svg +132 -0
- package/dist/assets/icons/vite-mono.svg +5 -0
- package/dist/assets/icons/viteplus-dark.svg +133 -0
- package/dist/assets/icons/viteplus-light.svg +133 -0
- package/dist/assets/icons/viteplus-mono.svg +6 -0
- package/dist/assets/icons/vitest-dark.svg +52 -0
- package/dist/assets/icons/vitest-light.svg +52 -0
- package/dist/assets/icons/vitest-mono.svg +5 -0
- package/dist/assets/logos/oxc-dark.svg +125 -0
- package/dist/assets/logos/oxc-light.svg +125 -0
- package/dist/assets/logos/rolldown-dark.svg +93 -0
- package/dist/assets/logos/rolldown-light.svg +93 -0
- package/dist/assets/logos/vite-dark.svg +133 -0
- package/dist/assets/logos/vite-light.svg +133 -0
- package/dist/assets/logos/viteplus-dark.svg +133 -0
- package/dist/assets/logos/viteplus-light.svg +133 -0
- package/dist/assets/logos/vitest-dark.svg +53 -0
- package/dist/assets/logos/vitest-light.svg +53 -0
- package/dist/assets/logos/voidzero-dark.svg +3 -0
- package/dist/assets/logos/voidzero-light.svg +3 -0
- package/dist/assets/social/github.svg +3 -0
- package/dist/assets/terminal-background.jpg +0 -0
- package/dist/assets/viteplus/logo.svg +1 -0
- package/dist/assets/voidzero/animations/1280_x_552_homepage.riv +0 -0
- package/dist/assets/voidzero/animations/480_x_480_build_tool_for_web.riv +0 -0
- package/dist/assets/voidzero/animations/480_x_480_fastest_javascript_bundler.riv +0 -0
- package/dist/assets/voidzero/animations/480_x_480_language_toolchain.riv +0 -0
- package/dist/assets/voidzero/animations/480_x_480_next_generation_runner.riv +0 -0
- package/dist/assets/voidzero/backgrounds/casestudies.jpg +0 -0
- package/dist/assets/voidzero/backgrounds/oxc.jpg +0 -0
- package/dist/assets/voidzero/backgrounds/rolldown.jpg +0 -0
- package/dist/assets/voidzero/backgrounds/vite.jpg +0 -0
- package/dist/assets/voidzero/backgrounds/vitest.jpg +0 -0
- package/dist/assets/voidzero/logo.svg +3 -0
- package/dist/assets/voidzero/terminals/rolldown.svg +7 -0
- package/dist/assets/voidzero/terminals/vite.svg +9 -0
- package/dist/assets/voidzero/terminals/vitest.svg +49 -0
- package/dist/index.css +1 -346
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -3
- package/dist/index10.js +7 -0
- package/dist/index11.js +13 -0
- package/dist/index12.js +13 -0
- package/dist/index13.js +13 -0
- package/dist/index14.js +7 -0
- package/dist/index15.js +12 -0
- package/dist/index16.js +7 -0
- package/dist/index17.js +12 -0
- package/dist/index18.js +7 -0
- package/dist/index19.js +22 -0
- package/dist/index2.js +29 -0
- package/dist/index21.js +4 -0
- package/dist/index22.js +4 -0
- package/dist/index23.js +4 -0
- package/dist/index24.js +4 -0
- package/dist/index25.js +4 -0
- package/dist/index26.js +4 -0
- package/dist/index27.js +23 -0
- package/dist/index29.js +9 -0
- package/dist/index3.js +75 -0
- package/dist/index30.js +107 -0
- package/dist/index32.js +4 -0
- package/dist/index33.js +4 -0
- package/dist/index34.js +297 -0
- package/dist/index36.js +149 -0
- package/dist/index38.js +116 -0
- package/dist/index4.js +157 -0
- package/dist/index40.js +4 -0
- package/dist/index41.js +28 -0
- package/dist/index42.js +32 -0
- package/dist/index43.js +28 -0
- package/dist/index44.js +28 -0
- package/dist/index45.js +28 -0
- package/dist/index46.js +28 -0
- package/dist/index47.js +4 -0
- package/dist/index48.js +4 -0
- package/dist/index49.js +4 -0
- package/dist/index5.js +15 -0
- package/dist/index50.js +4 -0
- package/dist/index51.js +4 -0
- package/dist/index52.js +4 -0
- package/dist/index53.js +4 -0
- package/dist/index54.js +4 -0
- package/dist/index55.js +4 -0
- package/dist/index56.js +4 -0
- package/dist/index57.js +4 -0
- package/dist/index58.js +20 -0
- package/dist/index59.js +20 -0
- package/dist/index6.js +75 -0
- package/dist/index60.js +20 -0
- package/dist/index61.js +4 -0
- package/dist/index62.js +51 -0
- package/dist/index63.js +45 -0
- package/dist/index64.js +2589 -0
- package/dist/index65.js +53 -0
- package/dist/index66.js +7209 -0
- package/dist/index67.js +16 -0
- package/dist/index68.js +36 -0
- package/dist/index69.js +4 -0
- package/dist/index7.js +36 -0
- package/dist/index70.js +4 -0
- package/dist/index71.js +4 -0
- package/dist/index72.js +4 -0
- package/dist/index73.js +4 -0
- package/dist/index74.js +4 -0
- package/dist/index75.js +4 -0
- package/dist/index76.js +4 -0
- package/dist/index77.js +4 -0
- package/dist/index78.js +4 -0
- package/dist/index79.js +4 -0
- package/dist/index8.js +35 -0
- package/dist/index80.js +24 -0
- package/dist/index81.js +126 -0
- package/dist/index82.js +4 -0
- package/dist/index83.js +441 -0
- package/dist/index84.js +1737 -0
- package/dist/index85.js +4 -0
- package/dist/index86.js +4 -0
- package/dist/index87.js +4 -0
- package/dist/index88.js +4 -0
- package/dist/index89.js +4 -0
- package/dist/index9.js +7 -0
- package/dist/index90.js +4 -0
- package/dist/index91.js +35 -0
- package/dist/index92.js +1204 -0
- package/dist/index93.js +448 -0
- package/dist/index94.js +7 -0
- package/dist/index95.js +4 -0
- package/dist/index96.js +317 -0
- package/dist/index97.js +4 -0
- package/dist/index98.js +6 -0
- package/dist/vitepress/components/shared/Eyebrow.vue.d.ts +5 -0
- package/dist/vitepress/components/shared/Footer.vue.d.ts +2 -0
- package/dist/vitepress/components/shared/RiveAnimation.vue.d.ts +20 -0
- package/dist/vitepress/components/shared/Terminal.vue.d.ts +4 -0
- package/dist/vitepress/components/shared/icons/VZIconBluesky.vue.d.ts +2 -0
- package/dist/vitepress/components/shared/icons/VZIconGitHub.vue.d.ts +2 -0
- package/dist/vitepress/components/shared/icons/VZIconTwitter.vue.d.ts +2 -0
- package/dist/vitepress/components/shared/terminal-animations/TerminalAnimation1.vue.d.ts +5 -0
- package/dist/vitepress/components/shared/terminal-animations/TerminalAnimation2.vue.d.ts +5 -0
- package/dist/vitepress/components/shared/terminal-animations/TerminalAnimation3.vue.d.ts +5 -0
- package/dist/vitepress/components/shared/terminal-animations/TerminalAnimation4.vue.d.ts +5 -0
- package/dist/vitepress/components/shared/terminal-animations/TerminalAnimation5.vue.d.ts +5 -0
- package/dist/vitepress/components/shared/terminal-animations/TerminalAnimation6.vue.d.ts +5 -0
- package/dist/vitepress/components/viteplus/Header.vue.d.ts +17 -0
- package/dist/vitepress/components/voidzero/CaseStudySlider.vue.d.ts +5 -0
- package/dist/vitepress/components/voidzero/CustomersSectionHeading.vue.d.ts +2 -0
- package/dist/vitepress/components/voidzero/GitHubStats.vue.d.ts +7 -0
- package/dist/vitepress/components/voidzero/Header.vue.d.ts +2 -0
- package/dist/vitepress/components/voidzero/Hero.vue.d.ts +2 -0
- package/dist/vitepress/components/voidzero/OpenSourceSectionHeading.vue.d.ts +2 -0
- package/dist/vitepress/components/voidzero/OpenSourceSectionProjects.vue.d.ts +2 -0
- package/dist/vitepress/components/voidzero/Statistics.vue.d.ts +7 -0
- package/dist/vitepress/components/voidzero/StatisticsSectionHeading.vue.d.ts +2 -0
- package/dist/vitepress/components/voidzero/TeamCTA.vue.d.ts +2 -0
- package/dist/vitepress/components/voidzero/TrustedBy.vue.d.ts +2 -0
- package/dist/vitepress/components/voidzero/VitePlusSectionFeatures.vue.d.ts +2 -0
- package/dist/vitepress/components/voidzero/VitePlusSectionHeading.vue.d.ts +2 -0
- package/dist/vitepress/index.d.ts +4 -32
- package/package.json +13 -3
- package/dist/_virtual/_/plugin-vue/export-helper.js +0 -11
- package/dist/assets/cta-background-CgYtVhnO.jpg +0 -1
- package/dist/vitepress/assets/cta-background.js +0 -5
- package/dist/vitepress/components/Eyebrow.js +0 -18
- package/dist/vitepress/components/Footer.js +0 -72
- package/dist/vitepress/components/Header.js +0 -34
- package/dist/vitepress/components/RiveAnimation.js +0 -117
- package/dist/vitepress/components/Terminal.js +0 -161
- package/dist/vitepress/components/icons/VZIconBluesky.js +0 -21
- package/dist/vitepress/components/icons/VZIconGitHub.js +0 -21
- package/dist/vitepress/components/icons/VZIconLogo.js +0 -24
- package/dist/vitepress/components/icons/VZIconTwitter.js +0 -21
- package/dist/vitepress/components/terminal-animations/TerminalAnimation1.js +0 -37
- package/dist/vitepress/components/terminal-animations/TerminalAnimation2.js +0 -44
- package/dist/vitepress/components/terminal-animations/TerminalAnimation3.js +0 -37
- package/dist/vitepress/components/terminal-animations/TerminalAnimation4.js +0 -37
- package/dist/vitepress/components/terminal-animations/TerminalAnimation5.js +0 -37
- package/dist/vitepress/components/terminal-animations/TerminalAnimation6.js +0 -37
- package/dist/vitepress/index.js +0 -21
package/dist/index83.js
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
const m = (n, t, e) => {
|
|
2
|
+
const i = document.createElement(n), [s, r] = Array.isArray(t) ? [void 0, t] : [t, e];
|
|
3
|
+
return s && Object.assign(i, s), r?.forEach((a) => i.appendChild(a)), i;
|
|
4
|
+
}, V = (n, t) => {
|
|
5
|
+
var e;
|
|
6
|
+
return t === "left" ? n.offsetLeft : (((e = n.offsetParent instanceof HTMLElement ? n.offsetParent : null) == null ? void 0 : e.offsetWidth) ?? 0) - n.offsetWidth - n.offsetLeft;
|
|
7
|
+
}, B = (n) => n.offsetWidth > 0 && n.offsetHeight > 0, G = (n, t) => {
|
|
8
|
+
!customElements.get(n) && customElements.define(n, t);
|
|
9
|
+
};
|
|
10
|
+
function X(n, t, { reverse: e = !1 } = {}) {
|
|
11
|
+
const i = n.length;
|
|
12
|
+
for (let s = e ? i - 1 : 0; e ? s >= 0 : s < i; e ? s-- : s++)
|
|
13
|
+
t(n[s], s);
|
|
14
|
+
}
|
|
15
|
+
function J(n, t, e, i) {
|
|
16
|
+
const s = t.formatToParts(n);
|
|
17
|
+
e && s.unshift({ type: "prefix", value: e }), i && s.push({ type: "suffix", value: i });
|
|
18
|
+
const r = [], a = [], o = [], c = [], d = {}, p = (h) => `${h}:${d[h] = (d[h] ?? -1) + 1}`;
|
|
19
|
+
let $ = "", g = !1, v = !1;
|
|
20
|
+
for (const h of s) {
|
|
21
|
+
$ += h.value;
|
|
22
|
+
const l = h.type === "minusSign" || h.type === "plusSign" ? "sign" : h.type;
|
|
23
|
+
l === "integer" ? (g = !0, a.push(...h.value.split("").map((S) => ({ type: l, value: parseInt(S) })))) : l === "group" ? a.push({ type: l, value: h.value }) : l === "decimal" ? (v = !0, o.push({ type: l, value: h.value, key: p(l) })) : l === "fraction" ? o.push(...h.value.split("").map((S) => ({
|
|
24
|
+
type: l,
|
|
25
|
+
value: parseInt(S),
|
|
26
|
+
key: p(l),
|
|
27
|
+
pos: -1 - d[l]
|
|
28
|
+
}))) : (g || v ? c : r).push({
|
|
29
|
+
type: l,
|
|
30
|
+
value: h.value,
|
|
31
|
+
key: p(l)
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const R = [];
|
|
35
|
+
for (let h = a.length - 1; h >= 0; h--) {
|
|
36
|
+
const l = a[h];
|
|
37
|
+
R.unshift(l.type === "integer" ? {
|
|
38
|
+
...l,
|
|
39
|
+
key: p(l.type),
|
|
40
|
+
pos: d[l.type]
|
|
41
|
+
} : {
|
|
42
|
+
...l,
|
|
43
|
+
key: p(l.type)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
pre: r,
|
|
48
|
+
integer: R,
|
|
49
|
+
fraction: o,
|
|
50
|
+
post: c,
|
|
51
|
+
valueAsString: $,
|
|
52
|
+
value: typeof n == "string" ? parseFloat(n) : n
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const F = String.raw, W = (() => {
|
|
56
|
+
try {
|
|
57
|
+
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
58
|
+
} catch {
|
|
59
|
+
return !1;
|
|
60
|
+
}
|
|
61
|
+
return !0;
|
|
62
|
+
})(), O = typeof CSS < "u" && CSS.supports && CSS.supports("line-height", "mod(1,1)"), j = typeof matchMedia < "u" ? matchMedia("(prefers-reduced-motion: reduce)") : null, w = "--_number-flow-d-opacity", A = "--_number-flow-d-width", b = "--_number-flow-dx", E = "--_number-flow-d", D = (() => {
|
|
63
|
+
try {
|
|
64
|
+
return CSS.registerProperty({
|
|
65
|
+
name: w,
|
|
66
|
+
syntax: "<number>",
|
|
67
|
+
inherits: !1,
|
|
68
|
+
initialValue: "0"
|
|
69
|
+
}), CSS.registerProperty({
|
|
70
|
+
name: b,
|
|
71
|
+
syntax: "<length>",
|
|
72
|
+
inherits: !0,
|
|
73
|
+
initialValue: "0px"
|
|
74
|
+
}), CSS.registerProperty({
|
|
75
|
+
name: A,
|
|
76
|
+
syntax: "<number>",
|
|
77
|
+
inherits: !1,
|
|
78
|
+
initialValue: "0"
|
|
79
|
+
}), CSS.registerProperty({
|
|
80
|
+
name: E,
|
|
81
|
+
syntax: "<number>",
|
|
82
|
+
inherits: !0,
|
|
83
|
+
initialValue: "0"
|
|
84
|
+
}), !0;
|
|
85
|
+
} catch {
|
|
86
|
+
return !1;
|
|
87
|
+
}
|
|
88
|
+
})(), I = "var(--number-flow-char-height, 1em)", u = "var(--number-flow-mask-height, 0.25em)", k = `calc(${u} / 2)`, x = "var(--number-flow-mask-width, 0.5em)", f = `calc(${x} / var(--scale-x))`, y = "#000 0, transparent 71%", U = F`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${I} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${A}) / var(--width));transform:translateX(var(${b})) scaleX(var(--scale-x));margin:0 calc(-1 * ${x});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${f},#000 calc(100% - ${f}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${u},#000 calc(100% - ${u}),transparent 100% ),radial-gradient(at bottom right,${y}),radial-gradient(at bottom left,${y}),radial-gradient(at top left,${y}),radial-gradient(at top right,${y});-webkit-mask-size:100% calc(100% - ${u} * 2),calc(100% - ${f} * 2) 100%,${f} ${u},${f} ${u},${f} ${u},${f} ${u};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${k} ${x};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${b})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${E})}.digit__num,.number .section::after{padding:${k} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${w}))}`, z = HTMLElement, H = O && W && D;
|
|
89
|
+
let _;
|
|
90
|
+
class Y extends z {
|
|
91
|
+
constructor() {
|
|
92
|
+
super(), this.created = !1, this.batched = !1;
|
|
93
|
+
const { animated: t, ...e } = this.constructor.defaultProps;
|
|
94
|
+
this._animated = this.computedAnimated = t, Object.assign(this, e);
|
|
95
|
+
}
|
|
96
|
+
get animated() {
|
|
97
|
+
return this._animated;
|
|
98
|
+
}
|
|
99
|
+
set animated(t) {
|
|
100
|
+
var e;
|
|
101
|
+
this.animated !== t && (this._animated = t, (e = this.shadowRoot) == null || e.getAnimations().forEach((i) => i.finish()));
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
set data(t) {
|
|
107
|
+
var e;
|
|
108
|
+
if (t == null)
|
|
109
|
+
return;
|
|
110
|
+
const { pre: i, integer: s, fraction: r, post: a, value: o } = t;
|
|
111
|
+
if (this.created) {
|
|
112
|
+
const c = this._data;
|
|
113
|
+
this._data = t, this.computedTrend = typeof this.trend == "function" ? this.trend(c.value, o) : this.trend, this.computedAnimated = H && this._animated && (!this.respectMotionPreference || !(j != null && j.matches)) && // https://github.com/barvian/number-flow/issues/9
|
|
114
|
+
B(this), (e = this.plugins) == null || e.forEach((d) => {
|
|
115
|
+
var p;
|
|
116
|
+
return (p = d.onUpdate) == null ? void 0 : p.call(d, t, c, this);
|
|
117
|
+
}), this.batched || this.willUpdate(), this._pre.update(i), this._num.update({ integer: s, fraction: r }), this._post.update(a), this.batched || this.didUpdate();
|
|
118
|
+
} else {
|
|
119
|
+
this._data = t, this.attachShadow({ mode: "open" });
|
|
120
|
+
try {
|
|
121
|
+
this._internals ?? (this._internals = this.attachInternals()), this._internals.role = "img";
|
|
122
|
+
} catch {
|
|
123
|
+
}
|
|
124
|
+
if (typeof CSSStyleSheet < "u" && this.shadowRoot.adoptedStyleSheets)
|
|
125
|
+
_ || (_ = new CSSStyleSheet(), _.replaceSync(U)), this.shadowRoot.adoptedStyleSheets = [_];
|
|
126
|
+
else {
|
|
127
|
+
const c = document.createElement("style");
|
|
128
|
+
c.textContent = U, this.shadowRoot.appendChild(c);
|
|
129
|
+
}
|
|
130
|
+
this._pre = new T(this, i, {
|
|
131
|
+
justify: "right",
|
|
132
|
+
part: "left"
|
|
133
|
+
}), this.shadowRoot.appendChild(this._pre.el), this._num = new Z(this, s, r), this.shadowRoot.appendChild(this._num.el), this._post = new T(this, a, {
|
|
134
|
+
justify: "left",
|
|
135
|
+
part: "right"
|
|
136
|
+
}), this.shadowRoot.appendChild(this._post.el), this.created = !0;
|
|
137
|
+
}
|
|
138
|
+
try {
|
|
139
|
+
this._internals.ariaLabel = t.valueAsString;
|
|
140
|
+
} catch {
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
willUpdate() {
|
|
147
|
+
this._pre.willUpdate(), this._num.willUpdate(), this._post.willUpdate();
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
didUpdate() {
|
|
153
|
+
if (!this.computedAnimated)
|
|
154
|
+
return;
|
|
155
|
+
this._abortAnimationsFinish ? this._abortAnimationsFinish.abort() : this.dispatchEvent(new Event("animationsstart")), this._pre.didUpdate(), this._num.didUpdate(), this._post.didUpdate();
|
|
156
|
+
const t = new AbortController();
|
|
157
|
+
Promise.all(this.shadowRoot.getAnimations().map((e) => e.finished)).then(() => {
|
|
158
|
+
t.signal.aborted || (this.dispatchEvent(new Event("animationsfinish")), this._abortAnimationsFinish = void 0);
|
|
159
|
+
}), this._abortAnimationsFinish = t;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
Y.defaultProps = {
|
|
163
|
+
transformTiming: {
|
|
164
|
+
duration: 900,
|
|
165
|
+
// Make sure to keep this minified:
|
|
166
|
+
easing: "linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"
|
|
167
|
+
},
|
|
168
|
+
spinTiming: void 0,
|
|
169
|
+
opacityTiming: { duration: 450, easing: "ease-out" },
|
|
170
|
+
animated: !0,
|
|
171
|
+
trend: (n, t) => Math.sign(t - n),
|
|
172
|
+
respectMotionPreference: !0,
|
|
173
|
+
plugins: void 0,
|
|
174
|
+
digits: void 0
|
|
175
|
+
};
|
|
176
|
+
class Z {
|
|
177
|
+
constructor(t, e, i, { className: s, ...r } = {}) {
|
|
178
|
+
this.flow = t, this._integer = new P(t, e, {
|
|
179
|
+
justify: "right",
|
|
180
|
+
part: "integer"
|
|
181
|
+
}), this._fraction = new P(t, i, {
|
|
182
|
+
justify: "left",
|
|
183
|
+
part: "fraction"
|
|
184
|
+
}), this._inner = m("span", {
|
|
185
|
+
className: "number__inner"
|
|
186
|
+
}, [this._integer.el, this._fraction.el]), this.el = m("span", {
|
|
187
|
+
...r,
|
|
188
|
+
part: "number",
|
|
189
|
+
className: `number ${s ?? ""}`
|
|
190
|
+
}, [this._inner]);
|
|
191
|
+
}
|
|
192
|
+
willUpdate() {
|
|
193
|
+
this._prevWidth = this.el.offsetWidth, this._prevLeft = this.el.getBoundingClientRect().left, this._integer.willUpdate(), this._fraction.willUpdate();
|
|
194
|
+
}
|
|
195
|
+
update({ integer: t, fraction: e }) {
|
|
196
|
+
this._integer.update(t), this._fraction.update(e);
|
|
197
|
+
}
|
|
198
|
+
didUpdate() {
|
|
199
|
+
const t = this.el.getBoundingClientRect();
|
|
200
|
+
this._integer.didUpdate(), this._fraction.didUpdate();
|
|
201
|
+
const e = this._prevLeft - t.left, i = this.el.offsetWidth, s = this._prevWidth - i;
|
|
202
|
+
this.el.style.setProperty("--width", String(i)), this.el.animate({
|
|
203
|
+
[b]: [`${e}px`, "0px"],
|
|
204
|
+
[A]: [s, 0]
|
|
205
|
+
}, {
|
|
206
|
+
...this.flow.transformTiming,
|
|
207
|
+
composite: "accumulate"
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
class N {
|
|
212
|
+
constructor(t, e, { justify: i, className: s, ...r }, a) {
|
|
213
|
+
this.flow = t, this.children = /* @__PURE__ */ new Map(), this.onCharRemove = (c) => () => {
|
|
214
|
+
this.children.delete(c);
|
|
215
|
+
}, this.justify = i;
|
|
216
|
+
const o = e.map((c) => this.addChar(c).el);
|
|
217
|
+
this.el = m("span", {
|
|
218
|
+
...r,
|
|
219
|
+
className: `section section--justify-${i} ${s ?? ""}`
|
|
220
|
+
}, a ? a(o) : o);
|
|
221
|
+
}
|
|
222
|
+
addChar(t, { startDigitsAtZero: e = !1, ...i } = {}) {
|
|
223
|
+
const s = t.type === "integer" || t.type === "fraction" ? new L(this, t.type, e ? 0 : t.value, t.pos, {
|
|
224
|
+
...i,
|
|
225
|
+
onRemove: this.onCharRemove(t.key)
|
|
226
|
+
}) : new q(this, t.type, t.value, {
|
|
227
|
+
...i,
|
|
228
|
+
onRemove: this.onCharRemove(t.key)
|
|
229
|
+
});
|
|
230
|
+
return this.children.set(t.key, s), s;
|
|
231
|
+
}
|
|
232
|
+
unpop(t) {
|
|
233
|
+
t.el.removeAttribute("inert"), t.el.style.top = "", t.el.style[this.justify] = "";
|
|
234
|
+
}
|
|
235
|
+
pop(t) {
|
|
236
|
+
t.forEach((e) => {
|
|
237
|
+
e.el.style.top = `${e.el.offsetTop}px`, e.el.style[this.justify] = `${V(e.el, this.justify)}px`;
|
|
238
|
+
}), t.forEach((e) => {
|
|
239
|
+
e.el.setAttribute("inert", ""), e.present = !1;
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
addNewAndUpdateExisting(t) {
|
|
243
|
+
const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = this.justify === "left", r = s ? "prepend" : "append";
|
|
244
|
+
if (X(t, (a) => {
|
|
245
|
+
let o;
|
|
246
|
+
this.children.has(a.key) ? (o = this.children.get(a.key), i.set(a, o), this.unpop(o), o.present = !0) : (o = this.addChar(a, { startDigitsAtZero: !0, animateIn: !0 }), e.set(a, o)), this.el[r](o.el);
|
|
247
|
+
}, { reverse: s }), this.flow.computedAnimated) {
|
|
248
|
+
const a = this.el.getBoundingClientRect();
|
|
249
|
+
e.forEach((o) => {
|
|
250
|
+
o.willUpdate(a);
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
e.forEach((a, o) => {
|
|
254
|
+
a.update(o.value);
|
|
255
|
+
}), i.forEach((a, o) => {
|
|
256
|
+
a.update(o.value);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
willUpdate() {
|
|
260
|
+
const t = this.el.getBoundingClientRect();
|
|
261
|
+
this._prevOffset = t[this.justify], this.children.forEach((e) => e.willUpdate(t));
|
|
262
|
+
}
|
|
263
|
+
didUpdate() {
|
|
264
|
+
const t = this.el.getBoundingClientRect();
|
|
265
|
+
this.children.forEach((s) => s.didUpdate(t));
|
|
266
|
+
const e = t[this.justify], i = this._prevOffset - e;
|
|
267
|
+
i && this.children.size && this.el.animate({
|
|
268
|
+
transform: [`translateX(${i}px)`, "none"]
|
|
269
|
+
}, {
|
|
270
|
+
...this.flow.transformTiming,
|
|
271
|
+
composite: "accumulate"
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
class P extends N {
|
|
276
|
+
update(t) {
|
|
277
|
+
const e = /* @__PURE__ */ new Map();
|
|
278
|
+
this.children.forEach((i, s) => {
|
|
279
|
+
t.find((r) => r.key === s) || e.set(s, i), this.unpop(i);
|
|
280
|
+
}), this.addNewAndUpdateExisting(t), e.forEach((i) => {
|
|
281
|
+
i instanceof L && i.update(0);
|
|
282
|
+
}), this.pop(e);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
class T extends N {
|
|
286
|
+
update(t) {
|
|
287
|
+
const e = /* @__PURE__ */ new Map();
|
|
288
|
+
this.children.forEach((i, s) => {
|
|
289
|
+
t.find((r) => r.key === s) || e.set(s, i);
|
|
290
|
+
}), this.pop(e), this.addNewAndUpdateExisting(t);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
class C {
|
|
294
|
+
constructor(t, e, { onRemove: i, animateIn: s = !1 } = {}) {
|
|
295
|
+
this.flow = t, this.el = e, this._present = !0, this._remove = () => {
|
|
296
|
+
var r;
|
|
297
|
+
this.el.remove(), (r = this._onRemove) == null || r.call(this);
|
|
298
|
+
}, this.el.classList.add("animate-presence"), this.flow.computedAnimated && s && this.el.animate({
|
|
299
|
+
[w]: [-0.9999, 0]
|
|
300
|
+
}, {
|
|
301
|
+
...this.flow.opacityTiming,
|
|
302
|
+
composite: "accumulate"
|
|
303
|
+
}), this._onRemove = i;
|
|
304
|
+
}
|
|
305
|
+
get present() {
|
|
306
|
+
return this._present;
|
|
307
|
+
}
|
|
308
|
+
set present(t) {
|
|
309
|
+
if (this._present !== t) {
|
|
310
|
+
if (this._present = t, t ? this.el.removeAttribute("inert") : this.el.setAttribute("inert", ""), !this.flow.computedAnimated) {
|
|
311
|
+
t || this._remove();
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
this.el.style.setProperty("--_number-flow-d-opacity", t ? "0" : "-.999"), this.el.animate({
|
|
315
|
+
[w]: t ? [-0.9999, 0] : [0.999, 0]
|
|
316
|
+
}, {
|
|
317
|
+
...this.flow.opacityTiming,
|
|
318
|
+
composite: "accumulate"
|
|
319
|
+
}), t ? this.flow.removeEventListener("animationsfinish", this._remove) : this.flow.addEventListener("animationsfinish", this._remove, {
|
|
320
|
+
once: !0
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
class M extends C {
|
|
326
|
+
constructor(t, e, i, s) {
|
|
327
|
+
super(t.flow, i, s), this.section = t, this.value = e, this.el = i;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
class L extends M {
|
|
331
|
+
constructor(t, e, i, s, r) {
|
|
332
|
+
var a, o;
|
|
333
|
+
const c = (((o = (a = t.flow.digits) == null ? void 0 : a[s]) == null ? void 0 : o.max) ?? 9) + 1, d = Array.from({ length: c }).map(($, g) => {
|
|
334
|
+
const v = m("span", { className: "digit__num" }, [
|
|
335
|
+
document.createTextNode(String(g))
|
|
336
|
+
]);
|
|
337
|
+
return g !== i && v.setAttribute("inert", ""), v.style.setProperty("--n", String(g)), v;
|
|
338
|
+
}), p = m("span", {
|
|
339
|
+
part: `digit ${e}-digit`,
|
|
340
|
+
className: "digit"
|
|
341
|
+
}, d);
|
|
342
|
+
p.style.setProperty("--current", String(i)), p.style.setProperty("--length", String(c)), super(t, i, p, r), this.pos = s, this._onAnimationsFinish = () => {
|
|
343
|
+
this.el.classList.remove("is-spinning");
|
|
344
|
+
}, this._numbers = d, this.length = c;
|
|
345
|
+
}
|
|
346
|
+
willUpdate(t) {
|
|
347
|
+
const e = this.el.getBoundingClientRect();
|
|
348
|
+
this._prevValue = this.value;
|
|
349
|
+
const i = e[this.section.justify] - t[this.section.justify], s = e.width / 2;
|
|
350
|
+
this._prevCenter = this.section.justify === "left" ? i + s : i - s;
|
|
351
|
+
}
|
|
352
|
+
update(t) {
|
|
353
|
+
this.el.style.setProperty("--current", String(t)), this._numbers.forEach((e, i) => i === t ? e.removeAttribute("inert") : e.setAttribute("inert", "")), this.value = t;
|
|
354
|
+
}
|
|
355
|
+
didUpdate(t) {
|
|
356
|
+
const e = this.el.getBoundingClientRect(), i = e[this.section.justify] - t[this.section.justify], s = e.width / 2, r = this.section.justify === "left" ? i + s : i - s, a = this._prevCenter - r;
|
|
357
|
+
a && this.el.animate({
|
|
358
|
+
transform: [`translateX(${a}px)`, "none"]
|
|
359
|
+
}, {
|
|
360
|
+
...this.flow.transformTiming,
|
|
361
|
+
composite: "accumulate"
|
|
362
|
+
});
|
|
363
|
+
const o = this.getDelta();
|
|
364
|
+
o && (this.el.classList.add("is-spinning"), this.el.animate({
|
|
365
|
+
[E]: [-o, 0]
|
|
366
|
+
}, {
|
|
367
|
+
...this.flow.spinTiming ?? this.flow.transformTiming,
|
|
368
|
+
composite: "accumulate"
|
|
369
|
+
}), this.flow.addEventListener("animationsfinish", this._onAnimationsFinish, { once: !0 }));
|
|
370
|
+
}
|
|
371
|
+
getDelta() {
|
|
372
|
+
var t;
|
|
373
|
+
if (this.flow.plugins)
|
|
374
|
+
for (const s of this.flow.plugins) {
|
|
375
|
+
const r = (t = s.getDelta) == null ? void 0 : t.call(s, this.value, this._prevValue, this);
|
|
376
|
+
if (r != null)
|
|
377
|
+
return r;
|
|
378
|
+
}
|
|
379
|
+
const e = this.value - this._prevValue, i = this.flow.computedTrend || Math.sign(e);
|
|
380
|
+
return i < 0 && this.value > this._prevValue ? this.value - this.length - this._prevValue : i > 0 && this.value < this._prevValue ? this.length - this._prevValue + this.value : e;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
class q extends M {
|
|
384
|
+
constructor(t, e, i, s) {
|
|
385
|
+
const r = m("span", {
|
|
386
|
+
className: "symbol__value",
|
|
387
|
+
textContent: i
|
|
388
|
+
});
|
|
389
|
+
super(t, i, m("span", {
|
|
390
|
+
part: `symbol ${e}`,
|
|
391
|
+
className: "symbol"
|
|
392
|
+
}, [r]), s), this.type = e, this._children = /* @__PURE__ */ new Map(), this._onChildRemove = (a) => () => {
|
|
393
|
+
this._children.delete(a);
|
|
394
|
+
}, this._children.set(i, new C(this.flow, r, {
|
|
395
|
+
onRemove: this._onChildRemove(i)
|
|
396
|
+
}));
|
|
397
|
+
}
|
|
398
|
+
willUpdate(t) {
|
|
399
|
+
if (this.type === "decimal")
|
|
400
|
+
return;
|
|
401
|
+
const e = this.el.getBoundingClientRect();
|
|
402
|
+
this._prevOffset = e[this.section.justify] - t[this.section.justify];
|
|
403
|
+
}
|
|
404
|
+
update(t) {
|
|
405
|
+
if (this.value !== t) {
|
|
406
|
+
const e = this._children.get(this.value);
|
|
407
|
+
e && (e.present = !1);
|
|
408
|
+
const i = this._children.get(t);
|
|
409
|
+
if (i)
|
|
410
|
+
i.present = !0;
|
|
411
|
+
else {
|
|
412
|
+
const s = m("span", {
|
|
413
|
+
className: "symbol__value",
|
|
414
|
+
textContent: t
|
|
415
|
+
});
|
|
416
|
+
this.el.appendChild(s), this._children.set(t, new C(this.flow, s, {
|
|
417
|
+
animateIn: !0,
|
|
418
|
+
onRemove: this._onChildRemove(t)
|
|
419
|
+
}));
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
this.value = t;
|
|
423
|
+
}
|
|
424
|
+
didUpdate(t) {
|
|
425
|
+
if (this.type === "decimal")
|
|
426
|
+
return;
|
|
427
|
+
const e = this.el.getBoundingClientRect()[this.section.justify] - t[this.section.justify], i = this._prevOffset - e;
|
|
428
|
+
i && this.el.animate({
|
|
429
|
+
transform: [`translateX(${i}px)`, "none"]
|
|
430
|
+
}, { ...this.flow.transformTiming, composite: "accumulate" });
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
export {
|
|
434
|
+
L as D,
|
|
435
|
+
Y as N,
|
|
436
|
+
z as S,
|
|
437
|
+
H as c,
|
|
438
|
+
G as d,
|
|
439
|
+
J as f,
|
|
440
|
+
j as p
|
|
441
|
+
};
|