@fuxishi/vitepress-theme 2.0.0-alpha.2 → 2.0.0-alpha.20
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 +140 -140
- package/README_EN.md +140 -0
- package/dist/chunk/{FxCodeBlockFold-BZw-1rNl.js → FxCodeBlockFold-Da2J65N_.js} +1 -1
- package/dist/chunk/{FxConfetti-DFRD5KKS.js → FxConfetti-D2lYcsgF.js} +5 -5
- package/dist/chunk/{FxHeroImageBg-CiY3qciK.js → FxHeroImageBg-BsLzVdAq.js} +91 -103
- package/dist/chunk/FxHomeFeatureBefore-DcT06TxF.js +48 -0
- package/dist/chunk/{FxMusicBall-DwxRT1yK.js → FxMusicBall-Ck96b41c.js} +69 -66
- package/dist/chunk/{icons-DtAsNqxj.js → icons-CH79L9OV.js} +2 -2
- package/dist/config.d.ts +3 -1
- package/dist/config.js +143 -19
- package/dist/index.d.ts +15 -2
- package/dist/index.js +105 -53
- package/dist/style.css +1 -1
- package/package.json +68 -66
- package/dist/chunk/FxHomeFeatureBefore-Cd9m9wit.js +0 -40
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { defineComponent as e, nextTick as t, onBeforeUnmount as n, onMounted as r, watch as i } from "vue";
|
|
2
|
-
import { useData as a, useRoute as o } from "vitepress";
|
|
3
|
-
import { Vibrant as
|
|
2
|
+
import { useData as a, useRoute as o, withBase as s } from "vitepress";
|
|
3
|
+
import { Vibrant as c } from "node-vibrant/browser";
|
|
4
4
|
//#region .vitepress/components/FxHeroImageBg.ts
|
|
5
|
-
var
|
|
6
|
-
function
|
|
5
|
+
var l = "fx-hero-colors";
|
|
6
|
+
function u() {
|
|
7
7
|
try {
|
|
8
|
-
let e = localStorage.getItem(
|
|
8
|
+
let e = localStorage.getItem(l);
|
|
9
9
|
return e ? JSON.parse(e) : null;
|
|
10
10
|
} catch {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function d(e) {
|
|
15
15
|
try {
|
|
16
|
-
localStorage.setItem(
|
|
16
|
+
localStorage.setItem(l, JSON.stringify(e));
|
|
17
17
|
} catch {}
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function f(e) {
|
|
20
20
|
return [
|
|
21
21
|
e.Vibrant,
|
|
22
22
|
e.DarkVibrant,
|
|
@@ -26,63 +26,63 @@ function d(e) {
|
|
|
26
26
|
e.LightMuted
|
|
27
27
|
].filter(Boolean);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function p(e) {
|
|
30
30
|
return e.slice().sort((e, t) => e.hsl[0] - t.hsl[0]).map((e) => e.hex);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
let t =
|
|
32
|
+
function m(e) {
|
|
33
|
+
let t = f(e);
|
|
34
34
|
if (t.length === 0) return "-webkit-linear-gradient(-45deg, #bd34fe 50%, #47caff 50%)";
|
|
35
|
-
let n =
|
|
35
|
+
let n = p(t);
|
|
36
36
|
return `conic-gradient(from 0deg, ${[...n, n[0]].join(", ")})`;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function h(e, t) {
|
|
39
39
|
let n = Math.abs(e - t);
|
|
40
40
|
return Math.min(n, 360 - n);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
let t =
|
|
42
|
+
function g(e) {
|
|
43
|
+
let t = f(e);
|
|
44
44
|
if (t.length < 2) return "linear-gradient(120deg, #bd34fe, #41d1ff)";
|
|
45
45
|
let n = -1, r = [t[0].hex, t[1].hex];
|
|
46
46
|
for (let e = 0; e < t.length; e++) for (let i = e + 1; i < t.length; i++) {
|
|
47
|
-
let a =
|
|
47
|
+
let a = h(t[e].hsl[0], t[i].hsl[0]);
|
|
48
48
|
a > n && (n = a, r = [t[e].hex, t[i].hex]);
|
|
49
49
|
}
|
|
50
50
|
return `linear-gradient(120deg, ${r[0]}, ${r[1]})`;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function _(e) {
|
|
53
53
|
return `${parseInt(e.slice(1, 3), 16)}, ${parseInt(e.slice(3, 5), 16)}, ${parseInt(e.slice(5, 7), 16)}`;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
let t =
|
|
55
|
+
function v(e) {
|
|
56
|
+
let t = f(e);
|
|
57
57
|
if (t.length < 2) return ["189, 52, 254", "65, 209, 255"];
|
|
58
58
|
let n = -1, r = [t[0], t[1]];
|
|
59
59
|
for (let e = 0; e < t.length; e++) for (let i = e + 1; i < t.length; i++) {
|
|
60
|
-
let a =
|
|
60
|
+
let a = h(t[e].hsl[0], t[i].hsl[0]);
|
|
61
61
|
a > n && (n = a, r = [t[e], t[i]]);
|
|
62
62
|
}
|
|
63
|
-
return [
|
|
63
|
+
return [_(r[0].hex), _(r[1].hex)];
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function y() {
|
|
66
66
|
return document.documentElement.classList.contains("dark");
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
let [t, n] =
|
|
68
|
+
function b(e) {
|
|
69
|
+
let [t, n] = v(e);
|
|
70
70
|
return {
|
|
71
|
-
imageGradient:
|
|
72
|
-
nameGradient:
|
|
71
|
+
imageGradient: m(e),
|
|
72
|
+
nameGradient: g(e),
|
|
73
73
|
beamC1: t,
|
|
74
74
|
beamC2: n
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function x(e) {
|
|
78
78
|
let t = document.documentElement;
|
|
79
79
|
t.style.setProperty("--vp-home-hero-image-background-image", e.imageGradient), t.style.setProperty("--vp-home-hero-name-background", e.nameGradient), t.style.setProperty("--fx-beam-c1", e.beamC1), t.style.setProperty("--fx-beam-c2", e.beamC2);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function S(e) {
|
|
82
82
|
let t = document.documentElement;
|
|
83
83
|
t.style.setProperty("--fx-beam-c1", e.beamC1), t.style.setProperty("--fx-beam-c2", e.beamC2);
|
|
84
84
|
}
|
|
85
|
-
var
|
|
85
|
+
var C = e({
|
|
86
86
|
props: { heroImageColor: {
|
|
87
87
|
type: Boolean,
|
|
88
88
|
default: !1
|
|
@@ -90,127 +90,115 @@ var S = e({
|
|
|
90
90
|
render: () => null,
|
|
91
91
|
setup(e) {
|
|
92
92
|
if (!e.heroImageColor) return;
|
|
93
|
-
let
|
|
94
|
-
function
|
|
93
|
+
let f = null, p = o(), { frontmatter: m, site: h } = a();
|
|
94
|
+
function g() {
|
|
95
95
|
let e = document.documentElement;
|
|
96
96
|
e.style.removeProperty("--vp-home-hero-image-background-image"), e.style.removeProperty("--vp-home-hero-name-background"), e.style.removeProperty("--fx-beam-c1"), e.style.removeProperty("--fx-beam-c2");
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
return
|
|
98
|
+
function _(e) {
|
|
99
|
+
return y() ? e.dark || e.light : e.light || e.dark;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
function v(e) {
|
|
102
|
+
try {
|
|
103
|
+
let t = new URL(e, location.href);
|
|
104
|
+
if (t.origin !== location.origin) return t.href;
|
|
105
|
+
let n = decodeURIComponent(t.pathname), r = h.value.base;
|
|
106
|
+
return r && r !== "/" && n.startsWith(r) && (n = n.slice(r.length - 1)), n;
|
|
107
|
+
} catch {
|
|
108
|
+
return e;
|
|
109
|
+
}
|
|
104
110
|
}
|
|
105
|
-
function
|
|
106
|
-
let
|
|
107
|
-
|
|
108
|
-
let t = h(e);
|
|
109
|
-
return t ? (b(t), !0) : !1;
|
|
111
|
+
function C(e, t) {
|
|
112
|
+
let n = u();
|
|
113
|
+
return !!n?.[e] && n.images?.[e] === t;
|
|
110
114
|
}
|
|
111
|
-
function
|
|
112
|
-
let
|
|
115
|
+
function w(e) {
|
|
116
|
+
let t = u();
|
|
117
|
+
return !t || !t.images ? !1 : e && (e.light && t.images.light && e.light !== t.images.light || e.dark && t.images.dark && e.dark !== t.images.dark) ? (localStorage.removeItem(l), !0) : !1;
|
|
118
|
+
}
|
|
119
|
+
function T() {
|
|
120
|
+
let e = u();
|
|
113
121
|
if (!e) return !1;
|
|
114
|
-
let t =
|
|
122
|
+
let t = _(e);
|
|
115
123
|
return t ? (x(t), !0) : !1;
|
|
116
124
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
125
|
+
function E() {
|
|
126
|
+
let e = u();
|
|
127
|
+
if (!e) return !1;
|
|
128
|
+
let t = _(e);
|
|
129
|
+
return t ? (S(t), !0) : !1;
|
|
119
130
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
let e = await import(
|
|
123
|
-
/* @vite-ignore */
|
|
124
|
-
"/index.md"
|
|
125
|
-
), t = (typeof e.__pageData == "string" ? JSON.parse(e.__pageData) : e.__pageData)?.frontmatter?.hero?.image;
|
|
126
|
-
return t ? typeof t == "string" ? {
|
|
127
|
-
light: t,
|
|
128
|
-
dark: t
|
|
129
|
-
} : {
|
|
130
|
-
light: t.light,
|
|
131
|
-
dark: t.dark
|
|
132
|
-
} : null;
|
|
133
|
-
} catch {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
131
|
+
function D() {
|
|
132
|
+
return m.value.fxHeroImages || {};
|
|
136
133
|
}
|
|
137
|
-
async function
|
|
138
|
-
let n = e.src;
|
|
139
|
-
if (n) try {
|
|
140
|
-
let
|
|
141
|
-
(
|
|
142
|
-
let
|
|
143
|
-
|
|
134
|
+
async function O(e, t) {
|
|
135
|
+
let n = v(e.src);
|
|
136
|
+
if (e.src && n && !C(t, n)) try {
|
|
137
|
+
let r = b(await c.from(e.src).quality(1).getPalette());
|
|
138
|
+
(y() && t === "dark" || !y() && t === "light") && x(r);
|
|
139
|
+
let i = u() || {};
|
|
140
|
+
i[t] = r, i.images ||= {}, i.images[t] = n, d(i);
|
|
144
141
|
} catch {}
|
|
145
142
|
}
|
|
146
|
-
async function
|
|
143
|
+
async function k(e, t, n) {
|
|
144
|
+
if (C(t, n)) return u()?.[t] || null;
|
|
147
145
|
try {
|
|
148
|
-
let
|
|
149
|
-
return
|
|
146
|
+
let r = b(await c.from(e).quality(1).getPalette()), i = u() || {};
|
|
147
|
+
return i[t] = r, i.images ||= {}, i.images[t] = n, d(i), r;
|
|
150
148
|
} catch {
|
|
151
149
|
return null;
|
|
152
150
|
}
|
|
153
151
|
}
|
|
154
|
-
async function
|
|
152
|
+
async function A(e) {
|
|
155
153
|
if (!e.light && !e.dark) return;
|
|
156
154
|
let t = {};
|
|
157
155
|
if (e.light) {
|
|
158
|
-
let n =
|
|
159
|
-
|
|
156
|
+
let n = v(e.light), r = await k(s(n), "light", n);
|
|
157
|
+
r && (t.light = r);
|
|
160
158
|
}
|
|
161
159
|
if (e.dark) {
|
|
162
|
-
let n =
|
|
163
|
-
|
|
160
|
+
let n = v(e.dark), r = await k(s(n), "dark", n);
|
|
161
|
+
r && (t.dark = r);
|
|
164
162
|
}
|
|
165
163
|
if (t.light || t.dark) {
|
|
166
|
-
let e =
|
|
167
|
-
e &&
|
|
164
|
+
let e = y() ? t.dark || t.light : t.light || t.dark;
|
|
165
|
+
e && x(e);
|
|
168
166
|
}
|
|
169
167
|
}
|
|
170
|
-
async function
|
|
171
|
-
let e =
|
|
168
|
+
async function j() {
|
|
169
|
+
let e = D();
|
|
172
170
|
if (e.light || e.dark) {
|
|
173
|
-
await
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
let t = await w();
|
|
177
|
-
if (t) {
|
|
178
|
-
await D(t);
|
|
171
|
+
await A(e);
|
|
179
172
|
return;
|
|
180
173
|
}
|
|
181
174
|
try {
|
|
182
|
-
let e = await (await fetch(window.location.origin +
|
|
175
|
+
let e = await (await fetch(window.location.origin + h.value.base)).text(), t = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".VPHero .image-container img.VPImage"), n = {};
|
|
183
176
|
t.forEach((e) => {
|
|
184
177
|
let t = e.getAttribute("src");
|
|
185
178
|
t && (e.classList.contains("dark") ? n.dark = t : n.light = t);
|
|
186
|
-
}), (n.light || n.dark) && await
|
|
179
|
+
}), (n.light || n.dark) && await A(n);
|
|
187
180
|
} catch {}
|
|
188
181
|
}
|
|
189
|
-
function
|
|
182
|
+
function M() {
|
|
190
183
|
let e = document.querySelector(".VPHero .image-container img.VPImage.light"), t = document.querySelector(".VPHero .image-container img.VPImage.dark");
|
|
191
|
-
e || t ? (e && e.complete && e.naturalWidth > 0 ?
|
|
192
|
-
if (e && (e.light || e.dark)) {
|
|
193
|
-
let t = l();
|
|
194
|
-
t?.images && (e.light && t.images.light && e.light !== t.images.light || e.dark && t.images.dark && e.dark !== t.images.dark) && (localStorage.removeItem(c), D(e));
|
|
195
|
-
}
|
|
196
|
-
}), O());
|
|
184
|
+
e || t ? (e && e.complete && e.naturalWidth > 0 ? O(e, "light") : e && e.addEventListener("load", () => O(e, "light"), { once: !0 }), t && t.complete && t.naturalWidth > 0 ? O(t, "dark") : t && t.addEventListener("load", () => O(t, "dark"), { once: !0 })) : (g(), E(), j());
|
|
197
185
|
}
|
|
198
186
|
r(() => {
|
|
199
|
-
|
|
187
|
+
w(D()), T() || j(), M(), f = new MutationObserver((e) => {
|
|
200
188
|
for (let t of e) if (t.attributeName === "class") {
|
|
201
|
-
|
|
189
|
+
E(), M();
|
|
202
190
|
break;
|
|
203
191
|
}
|
|
204
|
-
}),
|
|
192
|
+
}), f.observe(document.documentElement, {
|
|
205
193
|
attributes: !0,
|
|
206
194
|
attributeFilter: ["class"]
|
|
207
195
|
});
|
|
208
|
-
}), i(() =>
|
|
209
|
-
t(
|
|
196
|
+
}), i(() => p.path, () => {
|
|
197
|
+
t(M);
|
|
210
198
|
}), n(() => {
|
|
211
|
-
|
|
199
|
+
f?.disconnect(), g();
|
|
212
200
|
});
|
|
213
201
|
}
|
|
214
202
|
});
|
|
215
203
|
//#endregion
|
|
216
|
-
export {
|
|
204
|
+
export { C as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as e, nextTick as t, onBeforeUnmount as n, onMounted as r, watch as i } from "vue";
|
|
2
|
+
import { useRoute as a } from "vitepress";
|
|
3
|
+
//#region .vitepress/components/FxHomeFeatureBefore.ts
|
|
4
|
+
var o = e({ setup() {
|
|
5
|
+
let e = [
|
|
6
|
+
"#f00",
|
|
7
|
+
"#0f0",
|
|
8
|
+
"#f0f",
|
|
9
|
+
"#0ff",
|
|
10
|
+
"#FE7300",
|
|
11
|
+
"#008EFF",
|
|
12
|
+
"#8B5CF6",
|
|
13
|
+
"#10B981"
|
|
14
|
+
], o = 0;
|
|
15
|
+
function s(e) {
|
|
16
|
+
cancelAnimationFrame(o), o = requestAnimationFrame(() => {
|
|
17
|
+
let t = e.target.closest(".VPFeature");
|
|
18
|
+
if (!t) return;
|
|
19
|
+
let n = t.getBoundingClientRect();
|
|
20
|
+
t.style.setProperty("--x", e.clientX - n.left + "px"), t.style.setProperty("--y", e.clientY - n.top + "px");
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function c() {
|
|
24
|
+
document.querySelectorAll(".VPHomeFeatures .VPFeature").forEach((t, n) => {
|
|
25
|
+
t.style.setProperty("--color", e[n % e.length]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
let l = null;
|
|
29
|
+
function u() {
|
|
30
|
+
l?.disconnect(), l = null;
|
|
31
|
+
let e = document.querySelector(".VPHomeFeatures");
|
|
32
|
+
e && (l = new MutationObserver(c), l.observe(e, {
|
|
33
|
+
childList: !0,
|
|
34
|
+
subtree: !0
|
|
35
|
+
})), c();
|
|
36
|
+
}
|
|
37
|
+
r(() => {
|
|
38
|
+
document.addEventListener("mousemove", s), u();
|
|
39
|
+
});
|
|
40
|
+
let d = a();
|
|
41
|
+
return i(() => d.path, () => {
|
|
42
|
+
t(u);
|
|
43
|
+
}), n(() => {
|
|
44
|
+
cancelAnimationFrame(o), document.removeEventListener("mousemove", s), l?.disconnect();
|
|
45
|
+
}), () => null;
|
|
46
|
+
} });
|
|
47
|
+
//#endregion
|
|
48
|
+
export { o as default };
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { t as e } from "./icons-
|
|
2
|
-
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, nextTick as
|
|
3
|
-
import { useData as
|
|
4
|
-
import { ElSlider as
|
|
1
|
+
import { t as e } from "./icons-CH79L9OV.js";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, nextTick as ee, normalizeClass as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, vShow as g, watchEffect as _, withDirectives as v } from "vue";
|
|
3
|
+
import { useData as y, withBase as b } from "vitepress";
|
|
4
|
+
import { ElSlider as x } from "element-plus";
|
|
5
5
|
//#region .vitepress/components/FxMusicBall.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var S = [
|
|
7
7
|
"src",
|
|
8
8
|
"autoplay",
|
|
9
9
|
"loop"
|
|
10
|
-
],
|
|
10
|
+
], C = ["src", "autoplay"], w = { class: "fx-music-ball__inner" }, T = { class: "fx-play-pause" }, E = ["innerHTML"], D = ["innerHTML"], O = { class: "fx-time" }, k = { class: "fx-duration" }, te = { class: "fx-volume" }, ne = ["innerHTML"], re = ["innerHTML"], ie = ["innerHTML"], ae = {
|
|
11
11
|
id: "fx-progress-gradient",
|
|
12
12
|
x1: "0%",
|
|
13
13
|
y1: "0%",
|
|
14
14
|
x2: "100%",
|
|
15
15
|
y2: "100%"
|
|
16
|
-
},
|
|
16
|
+
}, oe = ["stop-color"], se = ["stop-color"], ce = ["stroke-dasharray"], le = {
|
|
17
17
|
key: 2,
|
|
18
18
|
class: "fx-orbit-ring"
|
|
19
|
-
},
|
|
19
|
+
}, ue = {
|
|
20
20
|
key: 3,
|
|
21
21
|
class: "fx-music-list"
|
|
22
|
-
},
|
|
22
|
+
}, de = ["onClick"], fe = ["d"], A = /* @__PURE__ */ s({
|
|
23
23
|
__name: "FxMusicBall",
|
|
24
24
|
setup(s) {
|
|
25
|
-
let
|
|
25
|
+
let A = [
|
|
26
26
|
"M123.252 73.826h111.169v790.935h-111.169z",
|
|
27
27
|
"M346.361 465.952h111.169v395.467h-111.169z",
|
|
28
28
|
"M569.466 229.325h111.169v636.444h-111.169z",
|
|
29
29
|
"M792.574 391.584h111.169v475.788h-111.169z"
|
|
30
|
-
], { site:
|
|
30
|
+
], { site: j } = y(), M = j.value.themeConfig.musicBall, N = f(null), P = f(0), F = f(0), I = f(0), L = f(!1), R = f(50), z = f(!1), B = f(0), V = f(!!M.autoplay), H = f(!1), U = 2 * Math.PI * 22, W = f("#bd34fe"), G = f("#41d1ff");
|
|
31
31
|
function K() {
|
|
32
32
|
let e = getComputedStyle(document.documentElement), t = e.getPropertyValue("--fx-beam-c1").trim(), n = e.getPropertyValue("--fx-beam-c2").trim();
|
|
33
33
|
t && (W.value = `rgb(${t})`), n && (G.value = `rgb(${n})`);
|
|
34
34
|
}
|
|
35
35
|
let q = null;
|
|
36
|
-
|
|
36
|
+
u(() => {
|
|
37
37
|
K(), q = new MutationObserver((e) => {
|
|
38
38
|
for (let t of e) if (t.attributeName === "style") {
|
|
39
39
|
K();
|
|
@@ -43,27 +43,30 @@ var x = [
|
|
|
43
43
|
attributes: !0,
|
|
44
44
|
attributeFilter: ["style"]
|
|
45
45
|
});
|
|
46
|
-
}),
|
|
46
|
+
}), l(() => {
|
|
47
47
|
q?.disconnect();
|
|
48
48
|
});
|
|
49
|
-
let
|
|
49
|
+
let pe = n(() => {
|
|
50
50
|
let e = U - X.value / 100 * U;
|
|
51
51
|
return `${U - e} ${e}`;
|
|
52
|
-
}), J = n(() => M.src || M.list?.length === 1),
|
|
52
|
+
}), J = n(() => M.src || M.list?.length === 1), me = n(() => b(M.src || M.list?.[0]?.src || "")), Y = n(() => (M.list || []).map((e) => ({
|
|
53
|
+
...e,
|
|
54
|
+
src: b(e.src)
|
|
55
|
+
}))), X = n({
|
|
53
56
|
get() {
|
|
54
57
|
return I.value / P.value * 100 || 0;
|
|
55
58
|
},
|
|
56
59
|
set(e) {
|
|
57
60
|
F.value = P.value * e / 100, !L.value && N.value && (N.value.currentTime = F.value);
|
|
58
61
|
}
|
|
59
|
-
}),
|
|
60
|
-
|
|
62
|
+
}), he = n(() => $(P.value)), Z = n(() => $(I.value));
|
|
63
|
+
_(() => {
|
|
61
64
|
N.value && (z.value = !1, N.value.volume = R.value / 100);
|
|
62
|
-
}),
|
|
65
|
+
}), _(() => {
|
|
63
66
|
N.value && (N.value.muted = z.value);
|
|
64
67
|
});
|
|
65
68
|
let Q = {};
|
|
66
|
-
|
|
69
|
+
u(() => {
|
|
67
70
|
let e = N.value;
|
|
68
71
|
if (!e) return;
|
|
69
72
|
let t = {
|
|
@@ -87,47 +90,47 @@ var x = [
|
|
|
87
90
|
}
|
|
88
91
|
B.value = 0;
|
|
89
92
|
} else B.value++;
|
|
90
|
-
|
|
93
|
+
ee(() => e.play());
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
96
|
for (let [n, r] of Object.entries(t)) e.addEventListener(n, r);
|
|
94
97
|
Q = t;
|
|
95
|
-
}),
|
|
98
|
+
}), l(() => {
|
|
96
99
|
let e = N.value;
|
|
97
100
|
if (e) {
|
|
98
101
|
for (let [t, n] of Object.entries(Q)) e.removeEventListener(t, n);
|
|
99
102
|
Q = {};
|
|
100
103
|
}
|
|
101
104
|
});
|
|
102
|
-
let
|
|
105
|
+
let ge = () => {
|
|
103
106
|
L.value = !L.value, L.value ? N.value?.play() : N.value?.pause(), !J.value && !V.value && (V.value = !0);
|
|
104
|
-
},
|
|
107
|
+
}, _e = () => {
|
|
105
108
|
N.value && (N.value.currentTime = F.value);
|
|
106
|
-
},
|
|
109
|
+
}, ve = (e) => {
|
|
107
110
|
V.value = !0, B.value = e;
|
|
108
|
-
},
|
|
111
|
+
}, ye = () => {
|
|
109
112
|
H.value = !1;
|
|
110
113
|
};
|
|
111
114
|
function $(e) {
|
|
112
115
|
return e = Math.max(0, Number(e) || 0), `${Math.floor(e % 3600 / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
113
116
|
}
|
|
114
|
-
return (n, s) => (
|
|
115
|
-
class:
|
|
117
|
+
return (n, s) => (d(), i("div", {
|
|
118
|
+
class: c(["fx-music-ball", {
|
|
116
119
|
active: H.value,
|
|
117
120
|
"is-playing": L.value
|
|
118
121
|
}]),
|
|
119
|
-
onMouseleave:
|
|
122
|
+
onMouseleave: ye
|
|
120
123
|
}, [
|
|
121
|
-
J.value ? (
|
|
124
|
+
J.value ? (d(), i("audio", {
|
|
122
125
|
key: 0,
|
|
123
126
|
class: "audio",
|
|
124
|
-
src:
|
|
125
|
-
autoplay:
|
|
126
|
-
loop:
|
|
127
|
+
src: me.value,
|
|
128
|
+
autoplay: h(M).autoplay,
|
|
129
|
+
loop: h(M).loop,
|
|
127
130
|
style: { display: "none" },
|
|
128
131
|
ref_key: "audioRef",
|
|
129
132
|
ref: N
|
|
130
|
-
}, null, 8,
|
|
133
|
+
}, null, 8, S)) : (d(), i("audio", {
|
|
131
134
|
key: 1,
|
|
132
135
|
class: "audio",
|
|
133
136
|
src: Y.value[B.value]?.src,
|
|
@@ -135,55 +138,55 @@ var x = [
|
|
|
135
138
|
style: { display: "none" },
|
|
136
139
|
ref_key: "audioRef",
|
|
137
140
|
ref: N
|
|
138
|
-
}, null, 8,
|
|
139
|
-
a("div",
|
|
140
|
-
a("div",
|
|
141
|
-
a("div",
|
|
142
|
-
a("div",
|
|
141
|
+
}, null, 8, C)),
|
|
142
|
+
a("div", w, [
|
|
143
|
+
a("div", T, [v(a("span", { innerHTML: h(e)("music-ball/playfill", 20) }, null, 8, E), [[g, !L.value]]), v(a("span", { innerHTML: h(e)("music-ball/pause", 26) }, null, 8, D), [[g, L.value]])]),
|
|
144
|
+
a("div", O, m(Z.value) + "\xA0/\xA0" + m(he.value), 1),
|
|
145
|
+
a("div", k, [o(h(x), {
|
|
143
146
|
style: { width: "100%" },
|
|
144
147
|
"show-tooltip": !1,
|
|
145
148
|
modelValue: X.value,
|
|
146
149
|
"onUpdate:modelValue": s[0] ||= (e) => X.value = e,
|
|
147
|
-
onChange:
|
|
150
|
+
onChange: _e
|
|
148
151
|
}, null, 8, ["modelValue"])]),
|
|
149
|
-
a("div",
|
|
150
|
-
o(
|
|
152
|
+
a("div", te, [
|
|
153
|
+
o(h(x), {
|
|
151
154
|
style: { width: "100%" },
|
|
152
155
|
"show-tooltip": !1,
|
|
153
156
|
modelValue: R.value,
|
|
154
157
|
"onUpdate:modelValue": s[1] ||= (e) => R.value = e
|
|
155
158
|
}, null, 8, ["modelValue"]),
|
|
156
|
-
|
|
159
|
+
v(a("span", {
|
|
157
160
|
class: "fx-icon-volume",
|
|
158
161
|
onClick: s[2] ||= (e) => z.value = !z.value,
|
|
159
|
-
innerHTML:
|
|
160
|
-
}, null, 8,
|
|
161
|
-
|
|
162
|
+
innerHTML: h(e)("music-ball/volume_off", 20)
|
|
163
|
+
}, null, 8, ne), [[g, z.value]]),
|
|
164
|
+
v(a("span", {
|
|
162
165
|
class: "fx-icon-volume",
|
|
163
166
|
onClick: s[3] ||= (e) => z.value = !z.value,
|
|
164
|
-
innerHTML:
|
|
165
|
-
}, null, 8,
|
|
167
|
+
innerHTML: h(e)("music-ball/volume_up", 20)
|
|
168
|
+
}, null, 8, re), [[g, !z.value]])
|
|
166
169
|
]),
|
|
167
|
-
J.value ? r("", !0) : (
|
|
170
|
+
J.value ? r("", !0) : (d(), i("div", {
|
|
168
171
|
key: 0,
|
|
169
172
|
class: "fx-music-list-button",
|
|
170
173
|
onClick: s[4] ||= (e) => H.value = !H.value
|
|
171
|
-
}, [a("span", { innerHTML:
|
|
174
|
+
}, [a("span", { innerHTML: h(e)("music-ball/music_list", 20) }, null, 8, ie)]))
|
|
172
175
|
]),
|
|
173
|
-
(
|
|
176
|
+
(d(), i("svg", {
|
|
174
177
|
class: "fx-progress-ring",
|
|
175
178
|
width: "50",
|
|
176
179
|
height: "50",
|
|
177
180
|
viewBox: "0 0 50 50",
|
|
178
|
-
onClick:
|
|
181
|
+
onClick: ge
|
|
179
182
|
}, [
|
|
180
|
-
a("defs", null, [a("linearGradient",
|
|
183
|
+
a("defs", null, [a("linearGradient", ae, [a("stop", {
|
|
181
184
|
offset: "0%",
|
|
182
185
|
"stop-color": W.value
|
|
183
|
-
}, null, 8,
|
|
186
|
+
}, null, 8, oe), a("stop", {
|
|
184
187
|
offset: "100%",
|
|
185
188
|
"stop-color": G.value
|
|
186
|
-
}, null, 8,
|
|
189
|
+
}, null, 8, se)])]),
|
|
187
190
|
s[5] ||= a("circle", {
|
|
188
191
|
class: "fx-progress-track",
|
|
189
192
|
cx: "25",
|
|
@@ -201,26 +204,26 @@ var x = [
|
|
|
201
204
|
stroke: "url(#fx-progress-gradient)",
|
|
202
205
|
"stroke-width": "2.5",
|
|
203
206
|
"stroke-linecap": "round",
|
|
204
|
-
"stroke-dasharray":
|
|
205
|
-
}, null, 8,
|
|
207
|
+
"stroke-dasharray": pe.value
|
|
208
|
+
}, null, 8, ce)
|
|
206
209
|
])),
|
|
207
|
-
L.value ? (
|
|
208
|
-
H.value ? (
|
|
209
|
-
class:
|
|
210
|
+
L.value ? (d(), i("div", le)) : r("", !0),
|
|
211
|
+
H.value ? (d(), i("div", ue, [(d(!0), i(t, null, p(Y.value, (e, n) => (d(), i("div", {
|
|
212
|
+
class: c(["fx-music-list-item", B.value === n ? "active" : ""]),
|
|
210
213
|
key: n,
|
|
211
|
-
onClick: (e) =>
|
|
212
|
-
}, [B.value === n ? (
|
|
214
|
+
onClick: (e) => ve(n)
|
|
215
|
+
}, [B.value === n ? (d(), i("svg", {
|
|
213
216
|
key: 0,
|
|
214
|
-
class:
|
|
217
|
+
class: c(["image-live", { playing: L.value }]),
|
|
215
218
|
viewBox: "0 0 1024 1024",
|
|
216
219
|
xmlns: "http://www.w3.org/2000/svg"
|
|
217
|
-
}, [(
|
|
220
|
+
}, [(d(), i(t, null, p(A, (e, t) => a("path", {
|
|
218
221
|
key: t,
|
|
219
222
|
d: e,
|
|
220
|
-
class:
|
|
221
|
-
}, null, 10,
|
|
223
|
+
class: c(["bar", `bar-${t + 1}`])
|
|
224
|
+
}, null, 10, fe)), 64))], 2)) : r("", !0), a("span", null, m(e.name), 1)], 10, de))), 128)), s[6] ||= a("div", { class: "fx-music-list-sep" }, null, -1)])) : r("", !0)
|
|
222
225
|
], 34));
|
|
223
226
|
}
|
|
224
227
|
});
|
|
225
228
|
//#endregion
|
|
226
|
-
export {
|
|
229
|
+
export { A as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#endregion
|
|
2
2
|
//#region .vitepress/utils/icons.ts
|
|
3
|
-
var e = /*
|
|
3
|
+
var e = /* #__PURE__ */ Object.assign({
|
|
4
4
|
"../assets/svg/fold.svg": "<svg t=\"1777001773348\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"15732\" width=\"200\" height=\"200\"><path d=\"M736 480c-12.5-12.5-32.8-12.5-45.3 0L523.3 647.4c-6.2 6.2-16.4 6.2-22.6 0L333.3 480c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L466.7 704c25 25 65.5 25 90.5 0L736 525.3c12.5-12.5 12.5-32.8 0-45.3z\" p-id=\"15733\"></path></svg>",
|
|
5
5
|
"../assets/svg/music-ball/music_list.svg": "<svg t=\"1777001773348\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"15732\" width=\"200\" height=\"200\"><path d=\"M128 128h384v85.333333H128zM128 298.666667h384v85.333333H128zM128 469.333333h209.066667v85.333334H128zM725.333333 170.666667v418.133333c-34.133333-21.333333-81.066667-34.133333-128-34.133333-119.466667 0-213.333333 76.8-213.333333 170.666666s93.866667 170.666667 213.333333 170.666667 213.333333-76.8 213.333334-170.666667V256h128V170.666667h-213.333334z\" ></path></svg>",
|
|
6
6
|
"../assets/svg/music-ball/pause.svg": "<svg t=\"1777001773348\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"15732\" width=\"200\" height=\"200\"><path d=\"M426.666667 288v448a32.426667 32.426667 0 0 1-32 32h-64a32.426667 32.426667 0 0 1-32-32V288A32.426667 32.426667 0 0 1 330.666667 256h64a32.426667 32.426667 0 0 1 32 32zM693.333333 256h-64a32.426667 32.426667 0 0 0-32 32v448a32.426667 32.426667 0 0 0 32 32h64a32.426667 32.426667 0 0 0 32-32V288a32.426667 32.426667 0 0 0-32-32z\" ></path></svg>",
|
|
@@ -15,7 +15,7 @@ for (let n in e) {
|
|
|
15
15
|
}
|
|
16
16
|
function n(e, n = 14) {
|
|
17
17
|
let r = t[e];
|
|
18
|
-
return r ? r.replace(
|
|
18
|
+
return r ? r.replace(/\swidth=(['"]?)\d+\1/, ` width="${n}"`).replace(/\sheight=(['"]?)\d+\1/, ` height="${n}"`) : "";
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
export { n as t };
|
package/dist/config.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export interface FxThemeCustomConfig {
|
|
|
38
38
|
declare const fxConfig: {
|
|
39
39
|
markdown?: { lineNumbers?: boolean }
|
|
40
40
|
transformPageData?: (pageData: any) => any
|
|
41
|
-
|
|
41
|
+
/** 预设包含 outline / musicBall / confetti 默认值;索引签名兼容 DefaultTheme.Config 的其余字段 */
|
|
42
|
+
themeConfig?: FxThemeCustomConfig & { [key: string]: any }
|
|
43
|
+
vite?: { ssr?: { noExternal?: string[] }; plugins?: any[] }
|
|
42
44
|
}
|
|
43
45
|
export default fxConfig
|