geekin-devtoys 0.2.22 → 0.3.2
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/lib/GCard/index.js +1 -0
- package/lib/GCard/index.mjs +227 -0
- package/lib/GCard/style.css +1 -0
- package/lib/GCard.d.ts +1 -0
- package/lib/GDialog/index.js +1 -1
- package/lib/GDialog/index.mjs +2 -2
- package/lib/GDialog/style.css +1 -1
- package/lib/GFuzzyText/index.js +1 -0
- package/lib/GFuzzyText/index.mjs +171 -0
- package/lib/GFuzzyText.d.ts +1 -0
- package/lib/GInputTreeTag/index.js +1 -1
- package/lib/GInputTreeTag/index.mjs +152 -130
- package/lib/GInputTreeTag/style.css +1 -1
- package/lib/GTable/index.js +1 -1
- package/lib/GTable/index.mjs +13 -11
- package/lib/GTable/style.css +1 -1
- package/lib/components/GCard/index.d.ts +46 -0
- package/lib/components/GDialog/index.d.ts +24 -8
- package/lib/components/GFuzzyText/index.d.ts +61 -0
- package/lib/components/GInputTreeTag/index.d.ts +25 -11
- package/lib/components/GTable/index.d.ts +3 -119
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +20 -14
- package/lib/{index-il5JtS6o.js → index-B1MYKy3L.js} +1 -1
- package/lib/{index-CzamRrBC.mjs → index-Dxw2pU4z.mjs} +12 -27
- package/lib/index.d.ts +3 -1
- package/package.json +17 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),U=require("../_plugin-vue_export-helper-BHFhmbuH.js"),H={class:"g-card__content"},W=t.defineComponent({__name:"index",props:{className:{default:""},edgeSensitivity:{default:30},glowColor:{default:"40 80 80"},backgroundColor:{default:"#060010"},borderRadius:{default:28},glowRadius:{default:40},glowIntensity:{default:1},coneSpread:{default:25},animated:{type:Boolean,default:!1},colors:{default:()=>["#c084fc","#f472b6","#38bdf8"]},fillOpacity:{default:.5}},setup(k){function R(e){const a=e.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);return a?{h:parseFloat(a[1]),s:parseFloat(a[2]),l:parseFloat(a[3])}:{h:40,s:80,l:80}}function O(e,a){const{h:n,s:l,l:o}=R(e),s=`${n}deg ${l}% ${o}%`;return[[0,0,0,1,100,!0],[0,0,1,0,60,!0],[0,0,3,0,50,!0],[0,0,6,0,40,!0],[0,0,15,0,30,!0],[0,0,25,2,20,!0],[0,0,50,2,10,!0],[0,0,1,0,60,!1],[0,0,3,0,50,!1],[0,0,6,0,40,!1],[0,0,15,0,30,!1],[0,0,25,2,20,!1],[0,0,50,2,10,!1]].map(([d,i,h,v,G,T])=>{const q=Math.min(G*a,100);return`${T?"inset ":""}${d}px ${i}px ${h}px ${v}px hsl(${s} / ${q}%)`}).join(", ")}function S(e){return 1-Math.pow(1-e,3)}function x(e){return e*e*e}function b({start:e=0,end:a=100,duration:n=1e3,delay:l=0,ease:o=S,onUpdate:s,onEnd:c}){const d=performance.now()+l;function i(){const h=performance.now()-d,v=Math.min(h/n,1);s(e+(a-e)*o(v)),v<1?requestAnimationFrame(i):c&&c()}setTimeout(()=>requestAnimationFrame(i),l)}const E=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],P=[0,1,2,0,1,2,1];function N(e){const a=[];for(let n=0;n<7;n++){const l=e[Math.min(P[n],e.length-1)];a.push(`radial-gradient(at ${E[n]}, ${l} 0px, transparent 50%)`)}return a.push(`linear-gradient(${e[0]} 0 100%)`),a}const r=k,_=t.useTemplateRef("cardRef"),y=t.ref(!1),p=t.ref(45),g=t.ref(0),$=t.ref(!1),M=e=>{const{width:a,height:n}=e.getBoundingClientRect();return[a/2,n/2]},B=(e,a,n)=>{const[l,o]=M(e),s=a-l,c=n-o;let d=1/0,i=1/0;return s!==0&&(d=l/Math.abs(s)),c!==0&&(i=o/Math.abs(c)),Math.min(Math.max(1/Math.min(d,i),0),1)},V=(e,a,n)=>{const[l,o]=M(e),s=a-l,c=n-o;if(s===0&&c===0)return 0;let i=Math.atan2(c,s)*(180/Math.PI)+90;return i<0&&(i+=360),i},A=e=>{const a=_.value;if(!a)return;const n=a.getBoundingClientRect(),l=e.clientX-n.left,o=e.clientY-n.top;g.value=B(a,l,o),p.value=V(a,l,o)};t.watch(()=>r.animated,()=>{if(!r.animated)return;const e=110,a=465;$.value=!0,p.value=e,b({duration:500,onUpdate:n=>g.value=n/100}),b({ease:x,duration:1500,end:50,onUpdate:n=>{p.value=(a-e)*(n/100)+e}}),b({ease:S,delay:1500,duration:2250,start:50,end:100,onUpdate:n=>{p.value=(a-e)*(n/100)+e}}),b({ease:x,delay:2500,duration:1500,start:100,end:0,onUpdate:n=>g.value=n/100,onEnd:()=>$.value=!1})},{immediate:!0});const w=t.computed(()=>r.edgeSensitivity+20),m=t.computed(()=>y.value||$.value),C=t.computed(()=>m.value?Math.max(0,(g.value*100-w.value)/(100-w.value)):0),j=t.computed(()=>m.value?Math.max(0,(g.value*100-r.edgeSensitivity)/(100-r.edgeSensitivity)):0),I=t.computed(()=>N(r.colors)),z=t.computed(()=>I.value.map(e=>`${e} border-box`)),F=t.computed(()=>I.value.map(e=>`${e} padding-box`)),u=t.computed(()=>`${p.value.toFixed(3)}deg`);return(e,a)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"cardRef",ref:_,onPointermove:A,onPointerenter:a[0]||(a[0]=n=>y.value=!0),onPointerleave:a[1]||(a[1]=n=>y.value=!1),class:t.normalizeClass(["g-card",r.className]),style:t.normalizeStyle({background:r.backgroundColor,borderRadius:r.borderRadius+"px"})},[t.createElementVNode("div",{class:"g-card__border",style:t.normalizeStyle({background:[`linear-gradient(${r.backgroundColor} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...z.value].join(", "),opacity:C.value,maskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,transition:m.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),t.createElementVNode("div",{class:"g-card__fill",style:t.normalizeStyle({background:F.value.join(", "),maskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),WebkitMaskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),opacity:C.value*r.fillOpacity,transition:m.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),t.createElementVNode("span",{class:"g-card__glow",style:t.normalizeStyle({inset:`-${r.glowRadius}px`,maskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,opacity:j.value,transition:m.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},[t.createElementVNode("span",{class:"g-card__glow-inner",style:t.normalizeStyle({inset:`${r.glowRadius}px`,boxShadow:O(r.glowColor,r.glowIntensity)})},null,4)],4),t.createElementVNode("div",H,[t.renderSlot(e.$slots,"default",{},void 0,!0)])],38))}}),f=U._export_sfc(W,[["__scopeId","data-v-22c04b33"]]);f.install=k=>{k.component(f.name,f)};exports.GCard=f;exports.default=f;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { defineComponent as H, useTemplateRef as L, ref as y, watch as X, computed as c, createElementBlock as Y, openBlock as J, normalizeStyle as m, normalizeClass as K, createElementVNode as b, renderSlot as Q } from "vue";
|
|
2
|
+
import { _ as Z } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
3
|
+
const ee = { class: "g-card__content" }, ae = /* @__PURE__ */ H({
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
className: { default: "" },
|
|
7
|
+
edgeSensitivity: { default: 30 },
|
|
8
|
+
glowColor: { default: "40 80 80" },
|
|
9
|
+
backgroundColor: { default: "#060010" },
|
|
10
|
+
borderRadius: { default: 28 },
|
|
11
|
+
glowRadius: { default: 40 },
|
|
12
|
+
glowIntensity: { default: 1 },
|
|
13
|
+
coneSpread: { default: 25 },
|
|
14
|
+
animated: { type: Boolean, default: !1 },
|
|
15
|
+
colors: { default: () => ["#c084fc", "#f472b6", "#38bdf8"] },
|
|
16
|
+
fillOpacity: { default: 0.5 }
|
|
17
|
+
},
|
|
18
|
+
setup($) {
|
|
19
|
+
function B(e) {
|
|
20
|
+
const a = e.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);
|
|
21
|
+
return a ? { h: parseFloat(a[1]), s: parseFloat(a[2]), l: parseFloat(a[3]) } : { h: 40, s: 80, l: 80 };
|
|
22
|
+
}
|
|
23
|
+
function A(e, a) {
|
|
24
|
+
const { h: t, s: r, l } = B(e), s = `${t}deg ${r}% ${l}%`;
|
|
25
|
+
return [
|
|
26
|
+
[0, 0, 0, 1, 100, !0],
|
|
27
|
+
[0, 0, 1, 0, 60, !0],
|
|
28
|
+
[0, 0, 3, 0, 50, !0],
|
|
29
|
+
[0, 0, 6, 0, 40, !0],
|
|
30
|
+
[0, 0, 15, 0, 30, !0],
|
|
31
|
+
[0, 0, 25, 2, 20, !0],
|
|
32
|
+
[0, 0, 50, 2, 10, !0],
|
|
33
|
+
[0, 0, 1, 0, 60, !1],
|
|
34
|
+
[0, 0, 3, 0, 50, !1],
|
|
35
|
+
[0, 0, 6, 0, 40, !1],
|
|
36
|
+
[0, 0, 15, 0, 30, !1],
|
|
37
|
+
[0, 0, 25, 2, 20, !1],
|
|
38
|
+
[0, 0, 50, 2, 10, !1]
|
|
39
|
+
].map(([d, o, S, k, q, z]) => {
|
|
40
|
+
const D = Math.min(q * a, 100);
|
|
41
|
+
return `${z ? "inset " : ""}${d}px ${o}px ${S}px ${k}px hsl(${s} / ${D}%)`;
|
|
42
|
+
}).join(", ");
|
|
43
|
+
}
|
|
44
|
+
function M(e) {
|
|
45
|
+
return 1 - Math.pow(1 - e, 3);
|
|
46
|
+
}
|
|
47
|
+
function w(e) {
|
|
48
|
+
return e * e * e;
|
|
49
|
+
}
|
|
50
|
+
function v({
|
|
51
|
+
start: e = 0,
|
|
52
|
+
end: a = 100,
|
|
53
|
+
duration: t = 1e3,
|
|
54
|
+
delay: r = 0,
|
|
55
|
+
ease: l = M,
|
|
56
|
+
onUpdate: s,
|
|
57
|
+
onEnd: i
|
|
58
|
+
}) {
|
|
59
|
+
const d = performance.now() + r;
|
|
60
|
+
function o() {
|
|
61
|
+
const S = performance.now() - d, k = Math.min(S / t, 1);
|
|
62
|
+
s(e + (a - e) * l(k)), k < 1 ? requestAnimationFrame(o) : i && i();
|
|
63
|
+
}
|
|
64
|
+
setTimeout(() => requestAnimationFrame(o), r);
|
|
65
|
+
}
|
|
66
|
+
const E = [
|
|
67
|
+
"80% 55%",
|
|
68
|
+
"69% 34%",
|
|
69
|
+
"8% 6%",
|
|
70
|
+
"41% 38%",
|
|
71
|
+
"86% 85%",
|
|
72
|
+
"82% 18%",
|
|
73
|
+
"51% 4%"
|
|
74
|
+
], F = [0, 1, 2, 0, 1, 2, 1];
|
|
75
|
+
function j(e) {
|
|
76
|
+
const a = [];
|
|
77
|
+
for (let t = 0; t < 7; t++) {
|
|
78
|
+
const r = e[Math.min(F[t], e.length - 1)];
|
|
79
|
+
a.push(`radial-gradient(at ${E[t]}, ${r} 0px, transparent 50%)`);
|
|
80
|
+
}
|
|
81
|
+
return a.push(`linear-gradient(${e[0]} 0 100%)`), a;
|
|
82
|
+
}
|
|
83
|
+
const n = $, I = L("cardRef"), h = y(!1), p = y(45), g = y(0), x = y(!1), C = (e) => {
|
|
84
|
+
const { width: a, height: t } = e.getBoundingClientRect();
|
|
85
|
+
return [a / 2, t / 2];
|
|
86
|
+
}, N = (e, a, t) => {
|
|
87
|
+
const [r, l] = C(e), s = a - r, i = t - l;
|
|
88
|
+
let d = 1 / 0, o = 1 / 0;
|
|
89
|
+
return s !== 0 && (d = r / Math.abs(s)), i !== 0 && (o = l / Math.abs(i)), Math.min(Math.max(1 / Math.min(d, o), 0), 1);
|
|
90
|
+
}, G = (e, a, t) => {
|
|
91
|
+
const [r, l] = C(e), s = a - r, i = t - l;
|
|
92
|
+
if (s === 0 && i === 0) return 0;
|
|
93
|
+
let o = Math.atan2(i, s) * (180 / Math.PI) + 90;
|
|
94
|
+
return o < 0 && (o += 360), o;
|
|
95
|
+
}, T = (e) => {
|
|
96
|
+
const a = I.value;
|
|
97
|
+
if (!a) return;
|
|
98
|
+
const t = a.getBoundingClientRect(), r = e.clientX - t.left, l = e.clientY - t.top;
|
|
99
|
+
g.value = N(a, r, l), p.value = G(a, r, l);
|
|
100
|
+
};
|
|
101
|
+
X(
|
|
102
|
+
() => n.animated,
|
|
103
|
+
() => {
|
|
104
|
+
if (!n.animated) return;
|
|
105
|
+
const e = 110, a = 465;
|
|
106
|
+
x.value = !0, p.value = e, v({ duration: 500, onUpdate: (t) => g.value = t / 100 }), v({
|
|
107
|
+
ease: w,
|
|
108
|
+
duration: 1500,
|
|
109
|
+
end: 50,
|
|
110
|
+
onUpdate: (t) => {
|
|
111
|
+
p.value = (a - e) * (t / 100) + e;
|
|
112
|
+
}
|
|
113
|
+
}), v({
|
|
114
|
+
ease: M,
|
|
115
|
+
delay: 1500,
|
|
116
|
+
duration: 2250,
|
|
117
|
+
start: 50,
|
|
118
|
+
end: 100,
|
|
119
|
+
onUpdate: (t) => {
|
|
120
|
+
p.value = (a - e) * (t / 100) + e;
|
|
121
|
+
}
|
|
122
|
+
}), v({
|
|
123
|
+
ease: w,
|
|
124
|
+
delay: 2500,
|
|
125
|
+
duration: 1500,
|
|
126
|
+
start: 100,
|
|
127
|
+
end: 0,
|
|
128
|
+
onUpdate: (t) => g.value = t / 100,
|
|
129
|
+
onEnd: () => x.value = !1
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
{ immediate: !0 }
|
|
133
|
+
);
|
|
134
|
+
const R = c(() => n.edgeSensitivity + 20), f = c(() => h.value || x.value), O = c(
|
|
135
|
+
() => f.value ? Math.max(
|
|
136
|
+
0,
|
|
137
|
+
(g.value * 100 - R.value) / (100 - R.value)
|
|
138
|
+
) : 0
|
|
139
|
+
), U = c(
|
|
140
|
+
() => f.value ? Math.max(
|
|
141
|
+
0,
|
|
142
|
+
(g.value * 100 - n.edgeSensitivity) / (100 - n.edgeSensitivity)
|
|
143
|
+
) : 0
|
|
144
|
+
), P = c(() => j(n.colors)), V = c(() => P.value.map((e) => `${e} border-box`)), W = c(() => P.value.map((e) => `${e} padding-box`)), u = c(() => `${p.value.toFixed(3)}deg`);
|
|
145
|
+
return (e, a) => (J(), Y("div", {
|
|
146
|
+
ref_key: "cardRef",
|
|
147
|
+
ref: I,
|
|
148
|
+
onPointermove: T,
|
|
149
|
+
onPointerenter: a[0] || (a[0] = (t) => h.value = !0),
|
|
150
|
+
onPointerleave: a[1] || (a[1] = (t) => h.value = !1),
|
|
151
|
+
class: K(["g-card", n.className]),
|
|
152
|
+
style: m({
|
|
153
|
+
background: n.backgroundColor,
|
|
154
|
+
borderRadius: n.borderRadius + "px"
|
|
155
|
+
})
|
|
156
|
+
}, [
|
|
157
|
+
b("div", {
|
|
158
|
+
class: "g-card__border",
|
|
159
|
+
style: m({
|
|
160
|
+
background: [
|
|
161
|
+
`linear-gradient(${n.backgroundColor} 0 100%) padding-box`,
|
|
162
|
+
"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",
|
|
163
|
+
...V.value
|
|
164
|
+
].join(", "),
|
|
165
|
+
opacity: O.value,
|
|
166
|
+
maskImage: `conic-gradient(from ${u.value} at center, black ${n.coneSpread}%, transparent ${n.coneSpread + 15}%, transparent ${100 - n.coneSpread - 15}%, black ${100 - n.coneSpread}%)`,
|
|
167
|
+
WebkitMaskImage: `conic-gradient(from ${u.value} at center, black ${n.coneSpread}%, transparent ${n.coneSpread + 15}%, transparent ${100 - n.coneSpread - 15}%, black ${100 - n.coneSpread}%)`,
|
|
168
|
+
transition: f.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
|
|
169
|
+
})
|
|
170
|
+
}, null, 4),
|
|
171
|
+
b("div", {
|
|
172
|
+
class: "g-card__fill",
|
|
173
|
+
style: m({
|
|
174
|
+
background: W.value.join(", "),
|
|
175
|
+
maskImage: [
|
|
176
|
+
"linear-gradient(to bottom, black, black)",
|
|
177
|
+
"radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)",
|
|
178
|
+
"radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)",
|
|
179
|
+
"radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)",
|
|
180
|
+
"radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)",
|
|
181
|
+
"radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",
|
|
182
|
+
`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`
|
|
183
|
+
].join(", "),
|
|
184
|
+
WebkitMaskImage: [
|
|
185
|
+
"linear-gradient(to bottom, black, black)",
|
|
186
|
+
"radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)",
|
|
187
|
+
"radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)",
|
|
188
|
+
"radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)",
|
|
189
|
+
"radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)",
|
|
190
|
+
"radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",
|
|
191
|
+
`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`
|
|
192
|
+
].join(", "),
|
|
193
|
+
opacity: O.value * n.fillOpacity,
|
|
194
|
+
transition: f.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
|
|
195
|
+
})
|
|
196
|
+
}, null, 4),
|
|
197
|
+
b("span", {
|
|
198
|
+
class: "g-card__glow",
|
|
199
|
+
style: m({
|
|
200
|
+
inset: `-${n.glowRadius}px`,
|
|
201
|
+
maskImage: `conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,
|
|
202
|
+
WebkitMaskImage: `conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,
|
|
203
|
+
opacity: U.value,
|
|
204
|
+
transition: f.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
|
|
205
|
+
})
|
|
206
|
+
}, [
|
|
207
|
+
b("span", {
|
|
208
|
+
class: "g-card__glow-inner",
|
|
209
|
+
style: m({
|
|
210
|
+
inset: `${n.glowRadius}px`,
|
|
211
|
+
boxShadow: A(n.glowColor, n.glowIntensity)
|
|
212
|
+
})
|
|
213
|
+
}, null, 4)
|
|
214
|
+
], 4),
|
|
215
|
+
b("div", ee, [
|
|
216
|
+
Q(e.$slots, "default", {}, void 0, !0)
|
|
217
|
+
])
|
|
218
|
+
], 38));
|
|
219
|
+
}
|
|
220
|
+
}), _ = /* @__PURE__ */ Z(ae, [["__scopeId", "data-v-22c04b33"]]);
|
|
221
|
+
_.install = ($) => {
|
|
222
|
+
$.component(_.name, _);
|
|
223
|
+
};
|
|
224
|
+
export {
|
|
225
|
+
_ as GCard,
|
|
226
|
+
_ as default
|
|
227
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.g-card[data-v-22c04b33]{position:relative;display:grid;isolation:isolate;border:1px solid rgba(255,255,255,.15);transform:translateZ(.01px);box-shadow:#0000001a 0 1px 2px,#0000001a 0 2px 4px,#0000001a 0 4px 8px,#0000001a 0 8px 16px,#0000001a 0 16px 32px,#0000001a 0 32px 64px}.g-card__border[data-v-22c04b33],.g-card__fill[data-v-22c04b33]{position:absolute;inset:0;z-index:-1;border:1px solid transparent;border-radius:inherit}.g-card__fill[data-v-22c04b33]{mask-composite:subtract,add,add,add,add,add;-webkit-mask-composite:source-out,source-over,source-over,source-over,source-over,source-over;mix-blend-mode:soft-light}.g-card__glow[data-v-22c04b33]{position:absolute;z-index:1;border-radius:inherit;pointer-events:none;mix-blend-mode:plus-lighter}.g-card__glow-inner[data-v-22c04b33]{position:absolute;border-radius:inherit}.g-card__content[data-v-22c04b33]{position:relative;z-index:1;display:flex;flex-direction:column;overflow:auto}
|
package/lib/GCard.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/lib/GDialog/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../index-B1MYKy3L.js"),S=require("../_plugin-vue_export-helper-BHFhmbuH.js"),N=Symbol("GDialogManager"),M={small:"380px",medium:"480px",large:"580px"},T={ICON_WIDTH:92,ICON_HEIGHT:34,GAP:8,BOTTOM_OFFSET:18,RIGHT_OFFSET:18,MAX_PER_ROW:8};function q(s){const m=new Map,{ICON_WIDTH:a,ICON_HEIGHT:r,GAP:f,BOTTOM_OFFSET:g,RIGHT_OFFSET:l,MAX_PER_ROW:o}=T;return s.forEach((c,u)=>{const n=Math.floor(u/o),i=u%o;m.set(c,{right:l+i*(a+f),bottom:g+n*(r+f)})}),m}function W(){const s=e.reactive(new Map),m=e.computed(()=>{const n=[];return s.forEach(i=>{i.isMinimized&&n.push(i.id)}),n}),a=e.computed(()=>q(m.value));function r(n){s.set(n.id,{attentionTick:0,...n})}function f(n){s.delete(n)}function g(n){const i=s.get(n);if(i){if(i.isMinimized){i.attentionTick=(i.attentionTick??0)+1;return}i.isMinimized=!0}}function l(n){const i=s.get(n);i?.isMinimized&&(i.attentionTick=(i.attentionTick??0)+1)}function o(n){const i=s.get(n);i&&(i.isMinimized=!1)}function c(n){return e.computed(()=>a.value.get(n)??{right:T.RIGHT_OFFSET,bottom:T.BOTTOM_OFFSET})}const u=e.computed(()=>m.value.map(n=>s.get(n)).filter(Boolean));return{dialogs:s,register:r,unregister:f,minimize:g,remindMinimized:l,restore:o,getPosition:c,minimizedList:u}}function O(){return e.inject(N,null)}const Y=["title","aria-label"],Z={class:"g-dialog-minimized-icon__icon","aria-hidden":"true"},j={class:"g-dialog-minimized-icon__title"},K=e.defineComponent({name:"GDialogMinimizedIcon",__name:"GDialogMinimizedIcon",props:{title:{},position:{},attentionTick:{default:0}},emits:["restore"],setup(s,{emit:m}){const a=s,r=m,f=e.computed(()=>a.title||"弹窗"),g=e.computed(()=>`恢复 ${f.value}`),l=e.computed(()=>({position:"fixed",right:`${a.position.right}px`,bottom:`${a.position.bottom}px`})),o=e.ref(!1);let c;e.watch(()=>a.attentionTick,(n,i)=>{i===void 0||n===i||(o.value=!1,window.clearTimeout(c),window.requestAnimationFrame(()=>{o.value=!0,c=window.setTimeout(()=>{o.value=!1},580)}))}),e.onUnmounted(()=>{window.clearTimeout(c)});function u(){r("restore")}return(n,i)=>{const w=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{class:e.normalizeClass(["g-dialog-minimized-icon",{"is-attention":o.value}]),type:"button",style:e.normalizeStyle(l.value),title:g.value,"aria-label":g.value,onClick:u},[i[0]||(i[0]=e.createElementVNode("span",{class:"g-dialog-minimized-icon__glow","aria-hidden":"true"},null,-1)),i[1]||(i[1]=e.createElementVNode("span",{class:"g-dialog-minimized-icon__wave","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Z,[e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(e.unref(y.chat_dot_round_default))]),_:1})]),e.createElementVNode("span",j,e.toDisplayString(f.value),1)],14,Y)])}}}),C=S._export_sfc(K,[["__scopeId","data-v-5195816e"]]),X={class:"g-dialog-header"},J={class:"g-dialog-title"},Q={class:"g-dialog-operation-container","aria-label":"弹窗操作"},ee=["aria-label","title"],te=["onClick"],oe={class:"g-dialog-footer"},B="关闭",ie=e.defineComponent({name:"GDialog",inheritAttrs:!1,__name:"index",props:{title:{default:""},size:{default:"medium"},modelValue:{type:Boolean},hideFooter:{type:Boolean,default:!1},actions:{},showCancel:{type:Boolean,default:!0},showReset:{type:Boolean,default:!0},showSave:{type:Boolean,default:!0},cancelText:{default:"取消"},resetText:{default:"重置"},saveText:{default:"保存"},saveLoading:{type:Boolean,default:!1},saveDisabled:{type:Boolean,default:!1},beforeClose:{}},emits:["cancel","reset","save","minimize","action","update:modelValue"],setup(s,{emit:m}){const a=s,r=m,f=e.computed(()=>a.modelValue);function g(t){r("update:modelValue",t)}const l=e.useId?e.useId():`g-dialog-${Date.now()}-${Math.random().toString(36).slice(2)}`,o=O(),c=e.ref(!1),u=e.ref(!0),n=e.ref(0),i=e.ref(!1),w=e.computed(()=>o?o.dialogs.get(l)?.isMinimized??!1:c.value),D=e.computed(()=>o?o.dialogs.get(l)?.attentionTick??0:n.value),G=e.computed(()=>o?!(o.dialogs.get(l)?.isMinimized??!1):u.value),A=e.computed(()=>o?o.getPosition(l).value:{right:20,bottom:20});e.onMounted(()=>{o?.register({id:l,title:a.title,isMinimized:!1})}),e.onUnmounted(()=>{o?.unregister(l)}),e.watch(()=>a.title,t=>{if(o){const p=o.dialogs.get(l);p&&(p.title=t)}}),e.watch(()=>a.modelValue,t=>{if(t===!1){if(i.value){i.value=!1;return}o?o.restore(l):(u.value=!0,c.value=!1)}t===!0&&(o?.dialogs.get(l)?.isMinimized?o.remindMinimized(l):c.value&&(n.value+=1))});const F=e.computed(()=>Object.prototype.hasOwnProperty.call(M,a.size)?M[a.size]:a.size);async function v(t){if(!a.beforeClose)return!0;try{return await a.beforeClose(t)!==!1}catch{return!1}}async function L(t){const p=await v("close");t(!p)}async function $(){await v("close")&&r("update:modelValue",!1)}async function b(){await v("cancel")&&r("cancel")}function V(){r("reset")}async function E(){await v("save")&&r("save")}const z=e.reactive({});async function R(t){if(await v("action")&&(r("action",t.key),!!t.onClick))try{const p=t.onClick();p instanceof Promise&&(z[t.key]=!0,await p)}finally{z[t.key]=!1}}const k=e.ref(!1),P=()=>{k.value=!k.value},I=e.computed(()=>k.value?"退出全屏":"全屏"),x=async()=>{if(await v("minimize")){if(i.value=!0,o)o.minimize(l);else{if(c.value){n.value+=1,r("minimize",{id:l});return}u.value=!1,c.value=!0}r("update:modelValue",!1),r("minimize",{id:l})}},H=()=>{o?o.restore(l):(u.value=!0,c.value=!1),r("update:modelValue",!0)};return(t,p)=>{const h=e.resolveComponent("el-button"),U=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[G.value?(e.openBlock(),e.createBlock(U,e.mergeProps({key:0},t.$attrs,{"model-value":f.value,width:F.value,"lock-scroll":!1,"show-close":!1,fullscreen:k.value,"before-close":L,class:"g-dialog","onUpdate:modelValue":g}),e.createSlots({header:e.withCtx(({close:d})=>[e.createElementVNode("div",X,[e.createElementVNode("p",J,e.toDisplayString(t.title),1),e.createElementVNode("div",Q,[e.createElementVNode("button",{type:"button",class:"g-dialog-control g-dialog-control--minimize","aria-label":"最小化",title:"最小化",onClick:x}),e.createElementVNode("button",{type:"button",class:"g-dialog-control g-dialog-control--fullscreen","aria-label":I.value,title:I.value,onClick:P},null,8,ee),e.createElementVNode("button",{type:"button",class:"g-dialog-control g-dialog-control--close","aria-label":B,title:B,onClick:d},null,8,te)])])]),default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},void 0,!0)]),_:2},[t.hideFooter?void 0:{name:"footer",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"footer",{cancel:b,reset:V,save:E,close:$,loading:t.saveLoading},()=>[e.createElementVNode("div",oe,[t.actions&&t.actions.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.actions,d=>(e.openBlock(),e.createBlock(h,{key:d.key,type:d.type,icon:d.icon,loading:d.loading||z[d.key],disabled:d.disabled,plain:d.plain,size:"small",onClick:ne=>R(d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["type","icon","loading","disabled","plain","onClick"]))),128)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.showCancel?(e.openBlock(),e.createBlock(h,{key:0,icon:e.unref(y.remove_default),size:"small",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelText),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),t.showReset?(e.openBlock(),e.createBlock(h,{key:1,icon:e.unref(y.refresh_default),size:"small",onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.resetText),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),t.showSave?(e.openBlock(),e.createBlock(h,{key:2,type:"primary",icon:e.unref(y.circle_check_default),loading:t.saveLoading,disabled:t.saveDisabled,size:"small",onClick:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.saveText),1)]),_:1},8,["icon","loading","disabled"])):e.createCommentVNode("",!0)],64)),e.renderSlot(t.$slots,"moreOperations",{},void 0,!0)])],!0)]),key:"0"}]),1040,["model-value","width","fullscreen"])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createBlock(C,{key:1,title:t.title,position:A.value,"attention-tick":D.value,onRestore:H},null,8,["title","position","attention-tick"])):e.createCommentVNode("",!0)])}}}),_=S._export_sfc(ie,[["__scopeId","data-v-0cb7c4e3"]]);_.install=s=>{s.component(_.name,_),s.component(C.name,C)};exports.DIALOG_MANAGER_KEY=N;exports.DIALOG_SIZES=M;exports.GDialog=_;exports.GDialogMinimizedIcon=C;exports.MINIMIZED_LAYOUT=T;exports.createDialogManager=W;exports.default=_;exports.useDialogManager=O;
|
package/lib/GDialog/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject as re, reactive as X, computed as c, defineComponent as Y, ref as T, watch as F, onUnmounted as Z, resolveComponent as B, createBlock as y, openBlock as m, Teleport as q, createElementVNode as u, normalizeStyle as ce, normalizeClass as ue, createVNode as P, withCtx as h, unref as I, toDisplayString as k, useId as N, onMounted as de, createCommentVNode as b, mergeProps as fe, createSlots as me, renderSlot as E, createElementBlock as H, Fragment as W, renderList as ge, createTextVNode as C } from "vue";
|
|
2
|
-
import { c as pe, r as ve, a as _e, b as ye } from "../index-
|
|
2
|
+
import { c as pe, r as ve, a as _e, b as ye } from "../index-Dxw2pU4z.mjs";
|
|
3
3
|
import { _ as K } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const he = /* @__PURE__ */ Symbol("GDialogManager"), U = {
|
|
5
5
|
small: "380px",
|
|
@@ -378,7 +378,7 @@ const ke = ["title", "aria-label"], be = {
|
|
|
378
378
|
]);
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
}), D = /* @__PURE__ */ K(Fe, [["__scopeId", "data-v-
|
|
381
|
+
}), D = /* @__PURE__ */ K(Fe, [["__scopeId", "data-v-0cb7c4e3"]]);
|
|
382
382
|
D.install = (a) => {
|
|
383
383
|
a.component(D.name, D), a.component(V.name, V);
|
|
384
384
|
};
|
package/lib/GDialog/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.g-dialog-minimized-icon[data-v-5195816e]{width:78px;height:34px;padding:0 6px;border-radius:10px 18px;background:linear-gradient(90deg,rgba(106,210,255,.18) 1px,transparent 1px) 0 0/8px 8px,linear-gradient(180deg,rgba(255,255,255,.16),transparent 42%),linear-gradient(135deg,#10294c,var(--el-color-primary) 58%,#00d1ff);color:#f4fbff;display:flex;align-items:center;justify-content:flex-start;gap:6px;cursor:pointer;z-index:999;overflow:hidden;isolation:isolate;clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);transition:right .3s ease,bottom .3s ease,transform .18s ease,box-shadow .18s ease,filter .18s ease;animation:g-dialog-minimized-enter-5195816e .28s cubic-bezier(.2,.8,.2,1) both}.g-dialog-minimized-icon[data-v-5195816e]:before{content:"";position:absolute;inset:3px;border:1px solid rgba(163,232,255,.24);clip-path:inherit;pointer-events:none}.g-dialog-minimized-icon[data-v-5195816e]:after{content:"";position:absolute;top:-32%;left:-38%;width:32px;height:62px;background:linear-gradient(90deg,transparent,rgba(180,244,255,.64),transparent);transform:rotate(18deg) translate(-16px);opacity:0;pointer-events:none}.g-dialog-minimized-icon[data-v-5195816e]:hover{transform:translateY(-2px);filter:saturate(1.2) brightness(1.08)}.g-dialog-minimized-icon[data-v-5195816e]:hover:after{opacity:1;animation:g-dialog-minimized-shine-5195816e .62s ease}.g-dialog-minimized-icon:hover .g-dialog-minimized-icon__wave[data-v-5195816e]{opacity:1;animation:g-dialog-minimized-wave-5195816e 1.45s ease-in-out infinite}.g-dialog-minimized-icon:hover .g-dialog-minimized-icon__icon[data-v-5195816e]{transform:scale(1.08)}.g-dialog-minimized-icon[data-v-5195816e]:active{transform:translateY(0) scale(.98);box-shadow:0 0 0 1px #ffffff14 inset,0 5px 14px #0092ff3d,0 2px 6px #0003}.g-dialog-minimized-icon[data-v-5195816e]:focus-visible{outline:2px solid rgba(0,209,255,.72);outline-offset:3px}.g-dialog-minimized-icon.is-attention[data-v-5195816e]{animation:g-dialog-minimized-attention-5195816e .58s ease both;filter:saturate(1.22) brightness(1.08)}.g-dialog-minimized-icon.is-attention[data-v-5195816e]:after{opacity:1;animation:g-dialog-minimized-shine-5195816e .58s ease}.g-dialog-minimized-icon.is-attention .g-dialog-minimized-icon__wave[data-v-5195816e]{opacity:1;animation:g-dialog-minimized-wave-5195816e .58s ease-in-out}.g-dialog-minimized-icon.is-attention .g-dialog-minimized-icon__icon[data-v-5195816e]{animation:g-dialog-minimized-icon-pop-5195816e .58s ease both}.g-dialog-minimized-icon__glow[data-v-5195816e]{position:absolute;inset:auto 8px -14px auto;width:38px;height:28px;border-radius:50%;background:#00d1ff7a;filter:blur(13px);pointer-events:none;z-index:-1}.g-dialog-minimized-icon__wave[data-v-5195816e]{position:absolute;inset:-18px -24px;background:radial-gradient(ellipse at 22% 62%,rgba(173,243,255,.62) 0 9%,transparent 26%),radial-gradient(ellipse at 52% 78%,rgba(0,209,255,.58) 0 12%,transparent 30%),radial-gradient(ellipse at 82% 58%,rgba(67,170,255,.5) 0 10%,transparent 28%),linear-gradient(90deg,#147bff14,#00d1ff5c,#147bff14);background-size:72px 46px,86px 42px,70px 48px,100% 100%;background-position:-10px 16px,18px 20px,58px 14px,0 0;filter:blur(1px) saturate(1.25);opacity:0;pointer-events:none;transform:translate(-18px) translateY(6px) rotate(-2deg);transition:opacity .18s ease;z-index:-1}.g-dialog-minimized-icon__icon[data-v-5195816e]{width:20px;height:20px;border:1px solid rgba(203,246,255,.32);border-radius:7px;background:linear-gradient(135deg,rgba(255,255,255,.2),transparent),#00132b2e;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:inset 0 0 10px #00d1ff3d;transition:transform .18s ease}.g-dialog-minimized-icon__icon .el-icon[data-v-5195816e]{font-size:13px}.g-dialog-minimized-icon__title[data-v-5195816e]{min-width:0;max-width:50px;font-size:10px;font-weight:600;line-height:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes g-dialog-minimized-enter-5195816e{0%{transform:translateY(8px) scale(.92);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}@keyframes g-dialog-minimized-shine-5195816e{0%{transform:rotate(18deg) translate(-16px)}to{transform:rotate(18deg) translate(116px)}}@keyframes g-dialog-minimized-wave-5195816e{0%{background-position:-18px 18px,8px 22px,54px 14px,0 0;transform:translate(-14px) translateY(7px) rotate(-3deg) scaleY(.82)}45%{background-position:18px 8px,42px 18px,88px 10px,0 0;transform:translate(0) translateY(0) rotate(1deg) scaleY(1.05)}to{background-position:58px 17px,82px 22px,126px 15px,0 0;transform:translate(14px) translateY(5px) rotate(3deg) scaleY(.9)}}@keyframes g-dialog-minimized-attention-5195816e{0%,to{transform:translateY(0) scale(1)}18%{transform:translateY(-5px) scale(1.04)}36%{transform:translateY(0) scale(.98)}54%{transform:translateY(-3px) scale(1.02)}72%{transform:translateY(0) scale(1)}}@keyframes g-dialog-minimized-icon-pop-5195816e{0%,to{transform:scale(1)}30%{transform:scale(1.18) rotate(-8deg)}60%{transform:scale(1.08) rotate(6deg)}}@media(prefers-reduced-motion:reduce){.g-dialog-minimized-icon[data-v-5195816e]{animation:none;transition:right .3s ease,bottom .3s ease}.g-dialog-minimized-icon[data-v-5195816e]:after{display:none}.g-dialog-minimized-icon[data-v-5195816e]:hover,.g-dialog-minimized-icon[data-v-5195816e]:active,.g-dialog-minimized-icon.is-attention[data-v-5195816e]{transform:none;filter:none}.g-dialog-minimized-icon__wave[data-v-5195816e]{animation:none!important;opacity:0}.g-dialog-minimized-icon__icon[data-v-5195816e]{animation:none!important;transition:none}}.g-dialog-header[data-v-bd65748b]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:16px;padding:2px 0}.g-dialog-header .g-dialog-title[data-v-bd65748b]{position:relative;max-width:calc(100% - 88px);margin:0;overflow:hidden;color:var(--el-text-color-primary);font-size:15px;font-weight:600;line-height:1.4;letter-spacing:.01em;text-overflow:ellipsis;white-space:nowrap}.g-dialog-header .g-dialog-title[data-v-bd65748b]:before{content:"";position:absolute;top:50%;left:0;width:3px;height:14px;background:linear-gradient(180deg,var(--el-color-primary),var(--el-color-primary-light-3));border-radius:2px;transform:translate(-12px,-50%);opacity:0}.g-dialog-header .g-dialog-operation-container[data-v-bd65748b]{display:flex;flex-direction:row;align-items:center;gap:8px;padding:0}.g-dialog-control[data-v-bd65748b]{width:12px;height:12px;padding:0;border:0;border-radius:50%;cursor:pointer;flex-shrink:0;position:relative;box-shadow:inset 0 1px 1px #ffffffb3,inset 0 -1px 1px #0000001f,0 0 0 1px #00000014,0 1px 2px #0000000f;transition:transform .18s cubic-bezier(.34,1.56,.64,1),filter .18s ease,box-shadow .18s ease}.g-dialog-control[data-v-bd65748b]:after{content:"";position:absolute;top:2px;left:2.5px;width:4px;height:4px;border-radius:50%;background:#ffffff8c;filter:blur(.5px);pointer-events:none}.g-dialog-control[data-v-bd65748b]:hover{filter:brightness(1.06) saturate(1.1);transform:scale(1.12);box-shadow:inset 0 1px 1px #ffffffbf,inset 0 -1px 1px #0000001f,0 0 0 1px #0000001a,0 2px 4px #0000001f}.g-dialog-control[data-v-bd65748b]:active{transform:scale(.92);filter:brightness(.96)}.g-dialog-control[data-v-bd65748b]:focus-visible{outline:2px solid rgba(68,68,68,.32);outline-offset:3px}.g-dialog-control--close[data-v-bd65748b]{background:linear-gradient(180deg,#ff8077,#ff5f57)}.g-dialog-control--fullscreen[data-v-bd65748b]{background:linear-gradient(180deg,#ffd066,#ffbd2e)}.g-dialog-control--minimize[data-v-bd65748b]{background:linear-gradient(180deg,#4be068,#28c840)}.g-dialog-footer[data-v-bd65748b]{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:8px;padding:2px 0}.g-dialog-footer[data-v-bd65748b] .el-button .el-icon{transition:transform .28s cubic-bezier(.34,1.56,.64,1),color .2s ease;will-change:transform}.g-dialog-footer[data-v-bd65748b] .el-button:hover:not(.is-disabled):not(.is-loading) .el-icon{transform:scale(1.18) rotate(-8deg)}.g-dialog-footer[data-v-bd65748b] .el-button:active:not(.is-disabled):not(.is-loading) .el-icon{transform:scale(1.06) rotate(-4deg);transition-duration:.12s}.g-dialog-footer[data-v-bd65748b] .el-button--primary:hover:not(.is-disabled):not(.is-loading) .el-icon{transform:scale(1.18) rotate(8deg)}.g-dialog-footer[data-v-bd65748b] .el-button--primary:active:not(.is-disabled):not(.is-loading) .el-icon{transform:scale(1.06) rotate(4deg)}@media(prefers-reduced-motion:reduce){.g-dialog-control[data-v-bd65748b],.g-dialog-footer[data-v-bd65748b] .el-button .el-icon{transition:none}.g-dialog-footer[data-v-bd65748b] .el-button:hover .el-icon,.g-dialog-footer[data-v-bd65748b] .el-button:active .el-icon{transform:none}}.el-overlay:has(.g-dialog){background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05);animation:g-dialog-overlay-in .22s ease both}@keyframes g-dialog-overlay-in{0%{background:#0f172a00;backdrop-filter:blur(0) saturate(1);-webkit-backdrop-filter:blur(0) saturate(1)}to{background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05)}}@media(prefers-reduced-motion:reduce){.el-overlay:has(.g-dialog){animation:none}}.g-dialog.el-dialog{--el-dialog-padding-primary: 18px;--el-dialog-border-radius: 14px;border-radius:14px;padding:0;overflow:hidden;background:linear-gradient(180deg,var(--g-dialog-sheen, rgba(255, 255, 255, .6)),transparent) top/100% 64px no-repeat,var(--el-bg-color);box-shadow:0 1px 0 var(--g-dialog-inner-highlight, rgba(255, 255, 255, .6)) inset,0 0 0 1px var(--el-border-color-lighter),0 24px 60px -12px var(--g-dialog-shadow-strong, rgba(15, 23, 42, .22)),0 8px 20px -8px var(--g-dialog-shadow-soft, rgba(15, 23, 42, .14))}.g-dialog.el-dialog.is-fullscreen{border-radius:0;box-shadow:none}.g-dialog.el-dialog .el-dialog__header{margin:0;padding:14px 20px;background:linear-gradient(180deg,var(--g-dialog-header-bg, rgba(248, 250, 252, .85)),transparent);position:relative}.g-dialog.el-dialog .el-dialog__body{padding:0 20px;color:var(--el-text-color-regular);font-size:13px;line-height:1.6;max-height:calc(85vh - 132px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--g-dialog-scrollbar, rgba(15, 23, 42, .18)) transparent}.g-dialog.el-dialog .el-dialog__body::-webkit-scrollbar{width:6px;height:6px}.g-dialog.el-dialog .el-dialog__body::-webkit-scrollbar-thumb{background-color:var(--g-dialog-scrollbar, rgba(15, 23, 42, .18));border-radius:3px}.g-dialog.el-dialog .el-dialog__body::-webkit-scrollbar-thumb:hover{background-color:var(--g-dialog-scrollbar-hover, rgba(15, 23, 42, .28))}.g-dialog.el-dialog .el-dialog__body::-webkit-scrollbar-track{background:transparent}.g-dialog.el-dialog .el-dialog__footer{padding:12px 20px;background:linear-gradient(0deg,var(--g-dialog-footer-bg, rgba(248, 250, 252, .7)),transparent);position:relative}html.dark .el-overlay:has(.g-dialog){--g-dialog-overlay-bg: rgba(0, 0, 0, .55)}html.dark .g-dialog.el-dialog{--g-dialog-sheen: rgba(255, 255, 255, .04);--g-dialog-inner-highlight: rgba(255, 255, 255, .06);--g-dialog-shadow-strong: rgba(0, 0, 0, .55);--g-dialog-shadow-soft: rgba(0, 0, 0, .4);--g-dialog-header-bg: rgba(255, 255, 255, .04);--g-dialog-footer-bg: rgba(255, 255, 255, .04);--g-dialog-scrollbar: rgba(255, 255, 255, .18);--g-dialog-scrollbar-hover: rgba(255, 255, 255, .28)}html.dark .g-dialog.el-dialog .g-dialog-control{box-shadow:inset 0 1px 1px #ffffff59,inset 0 -1px 1px #00000047,0 0 0 1px #ffffff14,0 1px 2px #00000073}html.dark .g-dialog.el-dialog .g-dialog-control:hover{box-shadow:inset 0 1px 1px #fff6,inset 0 -1px 1px #00000047,0 0 0 1px #ffffff1f,0 2px 6px #00000080}html.dark .g-dialog.el-dialog .g-dialog-control:focus-visible{outline-color:#ffffff73}.dialog-fade-enter-active .g-dialog.el-dialog,.dialog-fade-leave-active .g-dialog.el-dialog{transition:transform .26s cubic-bezier(.34,1.2,.64,1),opacity .22s ease}.dialog-fade-enter-from .g-dialog.el-dialog,.dialog-fade-leave-to .g-dialog.el-dialog{transform:translateY(-12px) scale(.96);opacity:0}@media(prefers-reduced-motion:reduce){.dialog-fade-enter-active .g-dialog.el-dialog,.dialog-fade-leave-active .g-dialog.el-dialog{transition:opacity .18s ease;transform:none}}
|
|
1
|
+
@charset "UTF-8";.g-dialog-minimized-icon[data-v-5195816e]{width:78px;height:34px;padding:0 6px;border-radius:10px 18px;background:linear-gradient(90deg,rgba(106,210,255,.18) 1px,transparent 1px) 0 0/8px 8px,linear-gradient(180deg,rgba(255,255,255,.16),transparent 42%),linear-gradient(135deg,#10294c,var(--el-color-primary) 58%,#00d1ff);color:#f4fbff;display:flex;align-items:center;justify-content:flex-start;gap:6px;cursor:pointer;z-index:999;overflow:hidden;isolation:isolate;clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);transition:right .3s ease,bottom .3s ease,transform .18s ease,box-shadow .18s ease,filter .18s ease;animation:g-dialog-minimized-enter-5195816e .28s cubic-bezier(.2,.8,.2,1) both}.g-dialog-minimized-icon[data-v-5195816e]:before{content:"";position:absolute;inset:3px;border:1px solid rgba(163,232,255,.24);clip-path:inherit;pointer-events:none}.g-dialog-minimized-icon[data-v-5195816e]:after{content:"";position:absolute;top:-32%;left:-38%;width:32px;height:62px;background:linear-gradient(90deg,transparent,rgba(180,244,255,.64),transparent);transform:rotate(18deg) translate(-16px);opacity:0;pointer-events:none}.g-dialog-minimized-icon[data-v-5195816e]:hover{transform:translateY(-2px);filter:saturate(1.2) brightness(1.08)}.g-dialog-minimized-icon[data-v-5195816e]:hover:after{opacity:1;animation:g-dialog-minimized-shine-5195816e .62s ease}.g-dialog-minimized-icon:hover .g-dialog-minimized-icon__wave[data-v-5195816e]{opacity:1;animation:g-dialog-minimized-wave-5195816e 1.45s ease-in-out infinite}.g-dialog-minimized-icon:hover .g-dialog-minimized-icon__icon[data-v-5195816e]{transform:scale(1.08)}.g-dialog-minimized-icon[data-v-5195816e]:active{transform:translateY(0) scale(.98);box-shadow:0 0 0 1px #ffffff14 inset,0 5px 14px #0092ff3d,0 2px 6px #0003}.g-dialog-minimized-icon[data-v-5195816e]:focus-visible{outline:2px solid rgba(0,209,255,.72);outline-offset:3px}.g-dialog-minimized-icon.is-attention[data-v-5195816e]{animation:g-dialog-minimized-attention-5195816e .58s ease both;filter:saturate(1.22) brightness(1.08)}.g-dialog-minimized-icon.is-attention[data-v-5195816e]:after{opacity:1;animation:g-dialog-minimized-shine-5195816e .58s ease}.g-dialog-minimized-icon.is-attention .g-dialog-minimized-icon__wave[data-v-5195816e]{opacity:1;animation:g-dialog-minimized-wave-5195816e .58s ease-in-out}.g-dialog-minimized-icon.is-attention .g-dialog-minimized-icon__icon[data-v-5195816e]{animation:g-dialog-minimized-icon-pop-5195816e .58s ease both}.g-dialog-minimized-icon__glow[data-v-5195816e]{position:absolute;inset:auto 8px -14px auto;width:38px;height:28px;border-radius:50%;background:#00d1ff7a;filter:blur(13px);pointer-events:none;z-index:-1}.g-dialog-minimized-icon__wave[data-v-5195816e]{position:absolute;inset:-18px -24px;background:radial-gradient(ellipse at 22% 62%,rgba(173,243,255,.62) 0 9%,transparent 26%),radial-gradient(ellipse at 52% 78%,rgba(0,209,255,.58) 0 12%,transparent 30%),radial-gradient(ellipse at 82% 58%,rgba(67,170,255,.5) 0 10%,transparent 28%),linear-gradient(90deg,#147bff14,#00d1ff5c,#147bff14);background-size:72px 46px,86px 42px,70px 48px,100% 100%;background-position:-10px 16px,18px 20px,58px 14px,0 0;filter:blur(1px) saturate(1.25);opacity:0;pointer-events:none;transform:translate(-18px) translateY(6px) rotate(-2deg);transition:opacity .18s ease;z-index:-1}.g-dialog-minimized-icon__icon[data-v-5195816e]{width:20px;height:20px;border:1px solid rgba(203,246,255,.32);border-radius:7px;background:linear-gradient(135deg,rgba(255,255,255,.2),transparent),#00132b2e;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:inset 0 0 10px #00d1ff3d;transition:transform .18s ease}.g-dialog-minimized-icon__icon .el-icon[data-v-5195816e]{font-size:13px}.g-dialog-minimized-icon__title[data-v-5195816e]{min-width:0;max-width:50px;font-size:10px;font-weight:600;line-height:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes g-dialog-minimized-enter-5195816e{0%{transform:translateY(8px) scale(.92);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}@keyframes g-dialog-minimized-shine-5195816e{0%{transform:rotate(18deg) translate(-16px)}to{transform:rotate(18deg) translate(116px)}}@keyframes g-dialog-minimized-wave-5195816e{0%{background-position:-18px 18px,8px 22px,54px 14px,0 0;transform:translate(-14px) translateY(7px) rotate(-3deg) scaleY(.82)}45%{background-position:18px 8px,42px 18px,88px 10px,0 0;transform:translate(0) translateY(0) rotate(1deg) scaleY(1.05)}to{background-position:58px 17px,82px 22px,126px 15px,0 0;transform:translate(14px) translateY(5px) rotate(3deg) scaleY(.9)}}@keyframes g-dialog-minimized-attention-5195816e{0%,to{transform:translateY(0) scale(1)}18%{transform:translateY(-5px) scale(1.04)}36%{transform:translateY(0) scale(.98)}54%{transform:translateY(-3px) scale(1.02)}72%{transform:translateY(0) scale(1)}}@keyframes g-dialog-minimized-icon-pop-5195816e{0%,to{transform:scale(1)}30%{transform:scale(1.18) rotate(-8deg)}60%{transform:scale(1.08) rotate(6deg)}}@media(prefers-reduced-motion:reduce){.g-dialog-minimized-icon[data-v-5195816e]{animation:none;transition:right .3s ease,bottom .3s ease}.g-dialog-minimized-icon[data-v-5195816e]:after{display:none}.g-dialog-minimized-icon[data-v-5195816e]:hover,.g-dialog-minimized-icon[data-v-5195816e]:active,.g-dialog-minimized-icon.is-attention[data-v-5195816e]{transform:none;filter:none}.g-dialog-minimized-icon__wave[data-v-5195816e]{animation:none!important;opacity:0}.g-dialog-minimized-icon__icon[data-v-5195816e]{animation:none!important;transition:none}}.g-dialog-header[data-v-0cb7c4e3]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:16px;padding:2px 0}.g-dialog-header .g-dialog-title[data-v-0cb7c4e3]{position:relative;max-width:calc(100% - 88px);margin:0;overflow:hidden;color:var(--el-text-color-primary);font-size:15px;font-weight:600;line-height:1.4;letter-spacing:.01em;text-overflow:ellipsis;white-space:nowrap}.g-dialog-header .g-dialog-title[data-v-0cb7c4e3]:before{content:"";position:absolute;top:50%;left:0;width:3px;height:14px;background:linear-gradient(180deg,var(--el-color-primary),var(--el-color-primary-light-3));border-radius:2px;transform:translate(-12px,-50%);opacity:0}.g-dialog-header .g-dialog-operation-container[data-v-0cb7c4e3]{display:flex;flex-direction:row;align-items:center;gap:8px;padding:0}.g-dialog-control[data-v-0cb7c4e3]{width:12px;height:12px;padding:0;border:0;border-radius:50%;cursor:pointer;flex-shrink:0;position:relative;box-shadow:inset 0 1px 1px #ffffffb3,inset 0 -1px 1px #0000001f,0 0 0 1px #00000014,0 1px 2px #0000000f;transition:transform .18s cubic-bezier(.34,1.56,.64,1),filter .18s ease,box-shadow .18s ease}.g-dialog-control[data-v-0cb7c4e3]:after{content:"";position:absolute;top:2px;left:2.5px;width:4px;height:4px;border-radius:50%;background:#ffffff8c;filter:blur(.5px);pointer-events:none}.g-dialog-control[data-v-0cb7c4e3]:hover{filter:brightness(1.06) saturate(1.1);transform:scale(1.12);box-shadow:inset 0 1px 1px #ffffffbf,inset 0 -1px 1px #0000001f,0 0 0 1px #0000001a,0 2px 4px #0000001f}.g-dialog-control[data-v-0cb7c4e3]:active{transform:scale(.92);filter:brightness(.96)}.g-dialog-control[data-v-0cb7c4e3]:focus-visible{outline:2px solid rgba(68,68,68,.32);outline-offset:3px}.g-dialog-control--close[data-v-0cb7c4e3]{background:linear-gradient(180deg,#ff8077,#ff5f57)}.g-dialog-control--fullscreen[data-v-0cb7c4e3]{background:linear-gradient(180deg,#ffd066,#ffbd2e)}.g-dialog-control--minimize[data-v-0cb7c4e3]{background:linear-gradient(180deg,#4be068,#28c840)}.g-dialog-footer[data-v-0cb7c4e3]{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:8px;padding:2px 0}.g-dialog-footer[data-v-0cb7c4e3] .el-button .el-icon{transition:transform .28s cubic-bezier(.34,1.56,.64,1),color .2s ease;will-change:transform}.g-dialog-footer[data-v-0cb7c4e3] .el-button:hover:not(.is-disabled):not(.is-loading) .el-icon{transform:scale(1.18) rotate(-8deg)}.g-dialog-footer[data-v-0cb7c4e3] .el-button:active:not(.is-disabled):not(.is-loading) .el-icon{transform:scale(1.06) rotate(-4deg);transition-duration:.12s}.g-dialog-footer[data-v-0cb7c4e3] .el-button--primary:hover:not(.is-disabled):not(.is-loading) .el-icon{transform:scale(1.18) rotate(8deg)}.g-dialog-footer[data-v-0cb7c4e3] .el-button--primary:active:not(.is-disabled):not(.is-loading) .el-icon{transform:scale(1.06) rotate(4deg)}@media(prefers-reduced-motion:reduce){.g-dialog-control[data-v-0cb7c4e3],.g-dialog-footer[data-v-0cb7c4e3] .el-button .el-icon{transition:none}.g-dialog-footer[data-v-0cb7c4e3] .el-button:hover .el-icon,.g-dialog-footer[data-v-0cb7c4e3] .el-button:active .el-icon{transform:none}}.el-overlay:has(.g-dialog){background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05);animation:g-dialog-overlay-in .22s ease both}@keyframes g-dialog-overlay-in{0%{background:#0f172a00;backdrop-filter:blur(0) saturate(1);-webkit-backdrop-filter:blur(0) saturate(1)}to{background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05)}}@media(prefers-reduced-motion:reduce){.el-overlay:has(.g-dialog){animation:none}}.g-dialog.el-dialog{--el-dialog-padding-primary: 18px;--el-dialog-border-radius: 14px;border-radius:14px;padding:0;overflow:hidden;background:linear-gradient(180deg,var(--g-dialog-sheen, rgba(255, 255, 255, .6)),transparent) top/100% 64px no-repeat,var(--el-bg-color);box-shadow:0 1px 0 var(--g-dialog-inner-highlight, rgba(255, 255, 255, .6)) inset,0 0 0 1px var(--el-border-color-lighter),0 24px 60px -12px var(--g-dialog-shadow-strong, rgba(15, 23, 42, .22)),0 8px 20px -8px var(--g-dialog-shadow-soft, rgba(15, 23, 42, .14))}.g-dialog.el-dialog.is-fullscreen{border-radius:0;box-shadow:none;display:flex;flex-direction:column}.g-dialog.el-dialog.is-fullscreen .el-dialog__body{flex:1 1 auto;max-height:none;min-height:0;display:flex;flex-direction:column}.g-dialog.el-dialog.is-fullscreen .el-dialog__body>*{flex:1 1 auto;min-height:0}.g-dialog.el-dialog .el-dialog__header{margin:0;padding:14px 20px;background:linear-gradient(180deg,var(--g-dialog-header-bg, rgba(248, 250, 252, .85)),transparent);position:relative}.g-dialog.el-dialog .el-dialog__body{padding:0 20px;color:var(--el-text-color-regular);font-size:13px;line-height:1.6;max-height:calc(85vh - 132px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--g-dialog-scrollbar, rgba(15, 23, 42, .18)) transparent}.g-dialog.el-dialog .el-dialog__body::-webkit-scrollbar{width:6px;height:6px}.g-dialog.el-dialog .el-dialog__body::-webkit-scrollbar-thumb{background-color:var(--g-dialog-scrollbar, rgba(15, 23, 42, .18));border-radius:3px}.g-dialog.el-dialog .el-dialog__body::-webkit-scrollbar-thumb:hover{background-color:var(--g-dialog-scrollbar-hover, rgba(15, 23, 42, .28))}.g-dialog.el-dialog .el-dialog__body::-webkit-scrollbar-track{background:transparent}.g-dialog.el-dialog .el-dialog__footer{padding:12px 20px;background:linear-gradient(0deg,var(--g-dialog-footer-bg, rgba(248, 250, 252, .7)),transparent);position:relative}html.dark .el-overlay:has(.g-dialog){--g-dialog-overlay-bg: rgba(0, 0, 0, .55)}html.dark .g-dialog.el-dialog{--g-dialog-sheen: rgba(255, 255, 255, .04);--g-dialog-inner-highlight: rgba(255, 255, 255, .06);--g-dialog-shadow-strong: rgba(0, 0, 0, .55);--g-dialog-shadow-soft: rgba(0, 0, 0, .4);--g-dialog-header-bg: rgba(255, 255, 255, .04);--g-dialog-footer-bg: rgba(255, 255, 255, .04);--g-dialog-scrollbar: rgba(255, 255, 255, .18);--g-dialog-scrollbar-hover: rgba(255, 255, 255, .28)}html.dark .g-dialog.el-dialog .g-dialog-control{box-shadow:inset 0 1px 1px #ffffff59,inset 0 -1px 1px #00000047,0 0 0 1px #ffffff14,0 1px 2px #00000073}html.dark .g-dialog.el-dialog .g-dialog-control:hover{box-shadow:inset 0 1px 1px #fff6,inset 0 -1px 1px #00000047,0 0 0 1px #ffffff1f,0 2px 6px #00000080}html.dark .g-dialog.el-dialog .g-dialog-control:focus-visible{outline-color:#ffffff73}.dialog-fade-enter-active .g-dialog.el-dialog,.dialog-fade-leave-active .g-dialog.el-dialog{transition:transform .26s cubic-bezier(.34,1.2,.64,1),opacity .22s ease}.dialog-fade-enter-from .g-dialog.el-dialog,.dialog-fade-leave-to .g-dialog.el-dialog{transform:translateY(-12px) scale(.96);opacity:0}@media(prefers-reduced-motion:reduce){.dialog-fade-enter-active .g-dialog.el-dialog,.dialog-fade-leave-active .g-dialog.el-dialog{transition:opacity .18s ease;transform:none}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),S=a.defineComponent({__name:"index",props:{fontSize:{default:"clamp(2rem, 8vw, 8rem)"},fontWeight:{default:900},fontFamily:{default:"inherit"},color:{default:"#fff"},enableHover:{type:Boolean,default:!0},baseIntensity:{default:.18},hoverIntensity:{default:.5},fuzzRange:{default:30},fps:{default:60},direction:{default:"horizontal"},transitionDuration:{default:0},clickEffect:{type:Boolean,default:!1},glitchMode:{type:Boolean,default:!1},glitchInterval:{default:2e3},glitchDuration:{default:200},gradient:{default:null},letterSpacing:{default:0},className:{default:""}},setup(I){const e=I,_=a.useTemplateRef("canvasRef"),Q=a.useSlots(),H=a.computed(()=>{const d=Q.default?.()??[],c=h=>h.map(s=>typeof s.children=="string"?s.children:Array.isArray(s.children)?c(s.children):"").join("");return c(d)});let F=0,x=null;const q=async()=>{const d=++F;let c=0,h=null,s=null,T=null;const G=[],M=()=>d!==F,l=_.value;if(!l)return;const R=l.getContext("2d");if(!R)return;const V=e.fontFamily==="inherit"?window.getComputedStyle(l).fontFamily||"sans-serif":e.fontFamily,Z=typeof e.fontSize=="number"?`${e.fontSize}px`:e.fontSize,C=`${e.fontWeight} ${Z} ${V}`;try{await document.fonts.load(C)}catch{await document.fonts.ready}if(M())return;let B;if(typeof e.fontSize=="number")B=e.fontSize;else{const t=document.createElement("span");t.style.fontSize=e.fontSize,document.body.appendChild(t),B=parseFloat(getComputedStyle(t).fontSize),document.body.removeChild(t)}const g=H.value,b=document.createElement("canvas"),o=b.getContext("2d");if(!o)return;o.font=C,o.textBaseline="alphabetic";let m=0;if(e.letterSpacing!==0){for(const t of g)m+=o.measureText(t).width+e.letterSpacing;m-=e.letterSpacing}else m=o.measureText(g).width;const p=o.measureText(g),$=p.actualBoundingBoxLeft??0,ee=e.letterSpacing!==0?m:p.actualBoundingBoxRight??p.width,w=p.actualBoundingBoxAscent??B,te=p.actualBoundingBoxDescent??B*.2,j=Math.ceil(e.letterSpacing!==0?m:$+ee),z=Math.ceil(w+te),N=10,f=j+N;b.width=f,b.height=z;const A=N/2;if(o.font=C,o.textBaseline="alphabetic",e.gradient&&Array.isArray(e.gradient)&&e.gradient.length>=2){const t=o.createLinearGradient(0,0,f,0);e.gradient.forEach((n,i)=>t.addColorStop(i/(e.gradient.length-1),n)),o.fillStyle=t}else o.fillStyle=e.color;if(e.letterSpacing!==0){let t=A;for(const n of g)o.fillText(n,t,w),t+=o.measureText(n).width+e.letterSpacing}else o.fillText(g,A-$,w);const E=e.fuzzRange+20,k=e.direction==="vertical"||e.direction==="both"?e.fuzzRange+10:0;l.width=f+E*2,l.height=z+k*2,R.translate(E,k);const O=E+A,P=k,ne=O+j,ie=P+z;let v=!1,D=!1,L=!1,r=e.baseIntensity,u=e.baseIntensity,X=0;const Y=()=>{!e.glitchMode||M()||(h=setTimeout(()=>{M()||(L=!0,s=setTimeout(()=>{L=!1,Y()},e.glitchDuration))},e.glitchInterval))};e.glitchMode&&Y();const W=t=>{if(M())return;const n=1e3/e.fps;if(t-X<n){c=requestAnimationFrame(W);return}if(X=t,R.clearRect(-(e.fuzzRange+20),-(e.fuzzRange+10),f+2*(e.fuzzRange+20),z+2*(e.fuzzRange+10)),D||L?u=1:v?u=e.hoverIntensity:u=e.baseIntensity,e.transitionDuration>0){const i=1/(e.transitionDuration/n);r<u?r=Math.min(r+i,u):r>u&&(r=Math.max(r-i,u))}else r=u;for(let i=0;i<z;i++){let J=0,K=0;(e.direction==="horizontal"||e.direction==="both")&&(J=Math.floor(r*(Math.random()-.5)*e.fuzzRange)),(e.direction==="vertical"||e.direction==="both")&&(K=Math.floor(r*(Math.random()-.5)*e.fuzzRange*.5)),R.drawImage(b,0,i,f,1,J,i+K,f,1)}c=requestAnimationFrame(W)};c=requestAnimationFrame(W);const U=(t,n)=>t>=O&&t<=ne&&n>=P&&n<=ie,oe=t=>{if(!e.enableHover)return;const n=l.getBoundingClientRect();v=U(t.clientX-n.left,t.clientY-n.top)},ae=()=>{v=!1},le=()=>{e.clickEffect&&(D=!0,clearTimeout(T??void 0),T=setTimeout(()=>{D=!1},150))},re=t=>{if(!e.enableHover)return;t.preventDefault();const n=l.getBoundingClientRect(),i=t.touches[0];v=U(i.clientX-n.left,i.clientY-n.top)},ce=()=>{v=!1},y=(t,n,i)=>{l.addEventListener(t,n,i),G.push(()=>l.removeEventListener(t,n,i))};y("mousemove",oe),y("mouseleave",ae),y("touchmove",re,{passive:!1}),y("touchend",ce),y("click",le),x=()=>{cancelAnimationFrame(c),h!==null&&clearTimeout(h),s!==null&&clearTimeout(s),T!==null&&clearTimeout(T),G.forEach(t=>t())}};return a.onMounted(()=>{q()}),a.onBeforeUnmount(()=>{F++,x?.()}),a.watch(()=>({text:H.value,fontSize:e.fontSize,fontWeight:e.fontWeight,fontFamily:e.fontFamily,color:e.color,gradient:e.gradient,letterSpacing:e.letterSpacing,direction:e.direction,fuzzRange:e.fuzzRange,glitchMode:e.glitchMode}),()=>{x?.(),x=null,q()},{deep:!0}),(d,c)=>(a.openBlock(),a.createElementBlock("canvas",{ref_key:"canvasRef",ref:_,class:a.normalizeClass(d.className)},null,2))}});S.install=I=>{I.component(S.name,S)};exports.GFuzzyText=S;exports.default=S;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { defineComponent as ct, useTemplateRef as st, useSlots as ft, computed as ut, onMounted as dt, onBeforeUnmount as ht, watch as mt, createElementBlock as gt, openBlock as pt, normalizeClass as zt } from "vue";
|
|
2
|
+
const L = /* @__PURE__ */ ct({
|
|
3
|
+
__name: "index",
|
|
4
|
+
props: {
|
|
5
|
+
fontSize: { default: "clamp(2rem, 8vw, 8rem)" },
|
|
6
|
+
fontWeight: { default: 900 },
|
|
7
|
+
fontFamily: { default: "inherit" },
|
|
8
|
+
color: { default: "#fff" },
|
|
9
|
+
enableHover: { type: Boolean, default: !0 },
|
|
10
|
+
baseIntensity: { default: 0.18 },
|
|
11
|
+
hoverIntensity: { default: 0.5 },
|
|
12
|
+
fuzzRange: { default: 30 },
|
|
13
|
+
fps: { default: 60 },
|
|
14
|
+
direction: { default: "horizontal" },
|
|
15
|
+
transitionDuration: { default: 0 },
|
|
16
|
+
clickEffect: { type: Boolean, default: !1 },
|
|
17
|
+
glitchMode: { type: Boolean, default: !1 },
|
|
18
|
+
glitchInterval: { default: 2e3 },
|
|
19
|
+
glitchDuration: { default: 200 },
|
|
20
|
+
gradient: { default: null },
|
|
21
|
+
letterSpacing: { default: 0 },
|
|
22
|
+
className: { default: "" }
|
|
23
|
+
},
|
|
24
|
+
setup(M) {
|
|
25
|
+
const t = M, W = st("canvasRef"), K = ft(), _ = ut(() => {
|
|
26
|
+
const u = K.default?.() ?? [], r = (d) => d.map((c) => typeof c.children == "string" ? c.children : Array.isArray(c.children) ? r(c.children) : "").join("");
|
|
27
|
+
return r(u);
|
|
28
|
+
});
|
|
29
|
+
let b = 0, v = null;
|
|
30
|
+
const H = async () => {
|
|
31
|
+
const u = ++b;
|
|
32
|
+
let r = 0, d = null, c = null, S = null;
|
|
33
|
+
const G = [], x = () => u !== b, a = W.value;
|
|
34
|
+
if (!a) return;
|
|
35
|
+
const T = a.getContext("2d");
|
|
36
|
+
if (!T) return;
|
|
37
|
+
const Q = t.fontFamily === "inherit" ? window.getComputedStyle(a).fontFamily || "sans-serif" : t.fontFamily, V = typeof t.fontSize == "number" ? `${t.fontSize}px` : t.fontSize, I = `${t.fontWeight} ${V} ${Q}`;
|
|
38
|
+
try {
|
|
39
|
+
await document.fonts.load(I);
|
|
40
|
+
} catch {
|
|
41
|
+
await document.fonts.ready;
|
|
42
|
+
}
|
|
43
|
+
if (x()) return;
|
|
44
|
+
let R;
|
|
45
|
+
if (typeof t.fontSize == "number")
|
|
46
|
+
R = t.fontSize;
|
|
47
|
+
else {
|
|
48
|
+
const e = document.createElement("span");
|
|
49
|
+
e.style.fontSize = t.fontSize, document.body.appendChild(e), R = parseFloat(getComputedStyle(e).fontSize), document.body.removeChild(e);
|
|
50
|
+
}
|
|
51
|
+
const h = _.value, B = document.createElement("canvas"), o = B.getContext("2d");
|
|
52
|
+
if (!o) return;
|
|
53
|
+
o.font = I, o.textBaseline = "alphabetic";
|
|
54
|
+
let m = 0;
|
|
55
|
+
if (t.letterSpacing !== 0) {
|
|
56
|
+
for (const e of h)
|
|
57
|
+
m += o.measureText(e).width + t.letterSpacing;
|
|
58
|
+
m -= t.letterSpacing;
|
|
59
|
+
} else
|
|
60
|
+
m = o.measureText(h).width;
|
|
61
|
+
const g = o.measureText(h), $ = g.actualBoundingBoxLeft ?? 0, Z = t.letterSpacing !== 0 ? m : g.actualBoundingBoxRight ?? g.width, F = g.actualBoundingBoxAscent ?? R, tt = g.actualBoundingBoxDescent ?? R * 0.2, q = Math.ceil(
|
|
62
|
+
t.letterSpacing !== 0 ? m : $ + Z
|
|
63
|
+
), p = Math.ceil(F + tt), j = 10, f = q + j;
|
|
64
|
+
B.width = f, B.height = p;
|
|
65
|
+
const C = j / 2;
|
|
66
|
+
if (o.font = I, o.textBaseline = "alphabetic", t.gradient && Array.isArray(t.gradient) && t.gradient.length >= 2) {
|
|
67
|
+
const e = o.createLinearGradient(0, 0, f, 0);
|
|
68
|
+
t.gradient.forEach((n, i) => e.addColorStop(i / (t.gradient.length - 1), n)), o.fillStyle = e;
|
|
69
|
+
} else
|
|
70
|
+
o.fillStyle = t.color;
|
|
71
|
+
if (t.letterSpacing !== 0) {
|
|
72
|
+
let e = C;
|
|
73
|
+
for (const n of h)
|
|
74
|
+
o.fillText(n, e, F), e += o.measureText(n).width + t.letterSpacing;
|
|
75
|
+
} else
|
|
76
|
+
o.fillText(h, C - $, F);
|
|
77
|
+
const w = t.fuzzRange + 20, A = t.direction === "vertical" || t.direction === "both" ? t.fuzzRange + 10 : 0;
|
|
78
|
+
a.width = f + w * 2, a.height = p + A * 2, T.translate(w, A);
|
|
79
|
+
const N = w + C, X = A, et = N + q, nt = X + p;
|
|
80
|
+
let z = !1, E = !1, k = !1, l = t.baseIntensity, s = t.baseIntensity, Y = 0;
|
|
81
|
+
const O = () => {
|
|
82
|
+
!t.glitchMode || x() || (d = setTimeout(() => {
|
|
83
|
+
x() || (k = !0, c = setTimeout(() => {
|
|
84
|
+
k = !1, O();
|
|
85
|
+
}, t.glitchDuration));
|
|
86
|
+
}, t.glitchInterval));
|
|
87
|
+
};
|
|
88
|
+
t.glitchMode && O();
|
|
89
|
+
const D = (e) => {
|
|
90
|
+
if (x()) return;
|
|
91
|
+
const n = 1e3 / t.fps;
|
|
92
|
+
if (e - Y < n) {
|
|
93
|
+
r = requestAnimationFrame(D);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (Y = e, T.clearRect(
|
|
97
|
+
-(t.fuzzRange + 20),
|
|
98
|
+
-(t.fuzzRange + 10),
|
|
99
|
+
f + 2 * (t.fuzzRange + 20),
|
|
100
|
+
p + 2 * (t.fuzzRange + 10)
|
|
101
|
+
), E || k ? s = 1 : z ? s = t.hoverIntensity : s = t.baseIntensity, t.transitionDuration > 0) {
|
|
102
|
+
const i = 1 / (t.transitionDuration / n);
|
|
103
|
+
l < s ? l = Math.min(l + i, s) : l > s && (l = Math.max(l - i, s));
|
|
104
|
+
} else
|
|
105
|
+
l = s;
|
|
106
|
+
for (let i = 0; i < p; i++) {
|
|
107
|
+
let U = 0, J = 0;
|
|
108
|
+
(t.direction === "horizontal" || t.direction === "both") && (U = Math.floor(l * (Math.random() - 0.5) * t.fuzzRange)), (t.direction === "vertical" || t.direction === "both") && (J = Math.floor(l * (Math.random() - 0.5) * t.fuzzRange * 0.5)), T.drawImage(B, 0, i, f, 1, U, i + J, f, 1);
|
|
109
|
+
}
|
|
110
|
+
r = requestAnimationFrame(D);
|
|
111
|
+
};
|
|
112
|
+
r = requestAnimationFrame(D);
|
|
113
|
+
const P = (e, n) => e >= N && e <= et && n >= X && n <= nt, it = (e) => {
|
|
114
|
+
if (!t.enableHover) return;
|
|
115
|
+
const n = a.getBoundingClientRect();
|
|
116
|
+
z = P(e.clientX - n.left, e.clientY - n.top);
|
|
117
|
+
}, ot = () => {
|
|
118
|
+
z = !1;
|
|
119
|
+
}, at = () => {
|
|
120
|
+
t.clickEffect && (E = !0, clearTimeout(S ?? void 0), S = setTimeout(() => {
|
|
121
|
+
E = !1;
|
|
122
|
+
}, 150));
|
|
123
|
+
}, lt = (e) => {
|
|
124
|
+
if (!t.enableHover) return;
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
const n = a.getBoundingClientRect(), i = e.touches[0];
|
|
127
|
+
z = P(i.clientX - n.left, i.clientY - n.top);
|
|
128
|
+
}, rt = () => {
|
|
129
|
+
z = !1;
|
|
130
|
+
}, y = (e, n, i) => {
|
|
131
|
+
a.addEventListener(e, n, i), G.push(() => a.removeEventListener(e, n, i));
|
|
132
|
+
};
|
|
133
|
+
y("mousemove", it), y("mouseleave", ot), y("touchmove", lt, { passive: !1 }), y("touchend", rt), y("click", at), v = () => {
|
|
134
|
+
cancelAnimationFrame(r), d !== null && clearTimeout(d), c !== null && clearTimeout(c), S !== null && clearTimeout(S), G.forEach((e) => e());
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
return dt(() => {
|
|
138
|
+
H();
|
|
139
|
+
}), ht(() => {
|
|
140
|
+
b++, v?.();
|
|
141
|
+
}), mt(
|
|
142
|
+
() => ({
|
|
143
|
+
text: _.value,
|
|
144
|
+
fontSize: t.fontSize,
|
|
145
|
+
fontWeight: t.fontWeight,
|
|
146
|
+
fontFamily: t.fontFamily,
|
|
147
|
+
color: t.color,
|
|
148
|
+
gradient: t.gradient,
|
|
149
|
+
letterSpacing: t.letterSpacing,
|
|
150
|
+
direction: t.direction,
|
|
151
|
+
fuzzRange: t.fuzzRange,
|
|
152
|
+
glitchMode: t.glitchMode
|
|
153
|
+
}),
|
|
154
|
+
() => {
|
|
155
|
+
v?.(), v = null, H();
|
|
156
|
+
},
|
|
157
|
+
{ deep: !0 }
|
|
158
|
+
), (u, r) => (pt(), gt("canvas", {
|
|
159
|
+
ref_key: "canvasRef",
|
|
160
|
+
ref: W,
|
|
161
|
+
class: zt(u.className)
|
|
162
|
+
}, null, 2));
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
L.install = (M) => {
|
|
166
|
+
M.component(L.name, L);
|
|
167
|
+
};
|
|
168
|
+
export {
|
|
169
|
+
L as GFuzzyText,
|
|
170
|
+
L as default
|
|
171
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),b=require("element-plus"),ae=require("../_plugin-vue_export-helper-BHFhmbuH.js"),oe={key:0,class:"g-input-tree-tag__tags"},ne=t.defineComponent({__name:"index",props:{modelValue:{default:()=>[]},data:{default:()=>[]},props:{default:()=>({})},echoProps:{},nodeKey:{default:"id"},placeholder:{default:"请输入关键字搜索"},width:{default:320},popperMaxHeight:{default:320},popperZIndex:{default:2e3},popperOffset:{default:4},defaultExpandAll:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},tagType:{default:"info"},tagEffect:{default:"light"},clearInputAfterSelect:{type:Boolean,default:!0},enterToAdd:{type:Boolean,default:!0},valueFormat:{default:"value"},selectable:{},filterMethod:{},duplicateMessage:{default:"该项已添加"},notFoundMessage:{default:"未找到匹配项"}},emits:["update:modelValue","change","add","remove","node-click","duplicate","not-found"],setup(B,{expose:H,emit:$}){const o=B,r=$,O=t.computed(()=>({label:o.props.label||"label",children:o.props.children||"children",disabled:o.props.disabled})),j=t.computed(()=>o.props.value||o.nodeKey||"id"),q=t.computed(()=>o.props.label||"label"),K=t.computed(()=>o.props.children||"children"),S=t.computed(()=>o.props.isLeaf),D=t.computed(()=>o.echoProps?.value||"value"),U=t.computed(()=>o.echoProps?.label||"label"),f=e=>e?e[j.value]:void 0,i=e=>e?e[q.value]:"",_=e=>e?e[K.value]:void 0,G=e=>e?.[D.value]??e?.value,P=e=>e?.[U.value]??e?.label,c=e=>{if(!e)return!1;if(typeof o.selectable=="function")return o.selectable(e);if(S.value&&e[S.value]!==void 0)return!!e[S.value];const l=_(e);return!l||!l.length},F=t.computed(()=>{const e=new Map,l=(a=[])=>{a.forEach(n=>{c(n)&&e.set(f(n),n);const s=_(n);s?.length&&l(s)})};return l(o.data||[]),e}),u=t.computed(()=>(o.modelValue||[]).map(l=>{const a=o.valueFormat==="object"?G(l):l,n=F.value.get(a),s=o.valueFormat==="object"?P(l):void 0;return{value:a,label:n?i(n):s??String(a??""),raw:n??(o.valueFormat==="object"?l:void 0)}})),w=e=>u.value.some(l=>l.value===e),y=t.ref(""),d=t.ref(!1),C=t.ref(null),I=t.ref(null),T=t.ref(null),v=t.ref(null),L=t.ref({}),N=t.ref("bottom"),Z=t.computed(()=>typeof o.width=="number"?`${o.width}px`:o.width),x=()=>{o.disabled||(d.value=!0)},k=()=>{if(!d.value)return;const e=T.value,l=v.value;if(!e||!l)return;const a=e.getBoundingClientRect(),n=l.offsetHeight||o.popperMaxHeight,V=window.innerHeight-a.bottom-o.popperOffset,te=a.top,A=V>=n||V>=te?"bottom":"top";N.value=A;const le=A==="bottom"?a.bottom+o.popperOffset:a.top-n;L.value={position:"fixed",top:`${le}px`,left:`${a.left}px`,width:`${a.width}px`,zIndex:String(o.popperZIndex)}};let p=null;const m=()=>{d.value&&(p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{p=null,k()}))};let g=null;const W=()=>{typeof ResizeObserver>"u"||!v.value||(g?.disconnect(),g=new ResizeObserver(()=>m()),g.observe(v.value))},z=()=>{g?.disconnect(),g=null};t.watch(d,async e=>{if(!e){z();return}await t.nextTick(),k(),requestAnimationFrame(k),W()});const R=e=>{if(!d.value)return;const l=e.target;I.value?.contains(l)||v.value?.contains(l)||(d.value=!1)};t.onMounted(()=>{document.addEventListener("mousedown",R,!0),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m)}),t.onBeforeUnmount(()=>{document.removeEventListener("mousedown",R,!0),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m),p&&cancelAnimationFrame(p),z()});const J=e=>{d.value=!0,C.value?.filter(e),t.nextTick(k)},Q=(e,l)=>e?typeof o.filterMethod=="function"?o.filterMethod(e,l):String(i(l)??"").toLowerCase().includes(String(e).toLowerCase()):!0,X=(e,l)=>{if(r("node-click",e),!c(e)){l&&(l.expanded=!l.expanded);return}M(e),d.value=!1},Y=e=>o.valueFormat==="object"?{value:e.value,label:e.label,raw:e.raw}:e.value,M=e=>{const l=f(e);if(l==null||l==="")return;if(w(l)){const s={value:l,label:i(e),raw:e};r("duplicate",s),o.duplicateMessage&&b.ElMessage.warning(o.duplicateMessage);return}const a={value:l,label:i(e),raw:e},n=[...o.modelValue||[],Y(a)];r("update:modelValue",n),r("add",a),r("change",n,[...u.value,a]),o.clearInputAfterSelect&&(y.value="")},ee=()=>{if(!o.enterToAdd)return;const e=(y.value||"").trim();if(!e)return;let l=null;for(const a of F.value.values())if(i(a)===e){l=a;break}if(!l){r("not-found",e),o.notFoundMessage&&b.ElMessage.warning(o.notFoundMessage);return}M(l)},E=e=>{if(e<0||e>=u.value.length)return;const l=u.value[e],a=[...o.modelValue||[]];a.splice(e,1),r("update:modelValue",a),l&&r("remove",l,e);const n=u.value.filter((s,V)=>V!==e);r("change",a,n)};return H({open:x,close:()=>d.value=!1,clear:()=>{r("update:modelValue",[]),r("change",[],[])},addByValue:e=>{const l=F.value.get(e);l&&M(l)},removeByIndex:e=>{E(e)},removeByValue:e=>{const l=u.value.findIndex(a=>a.value===e);l>-1&&E(l)},getSelectedItems:()=>u.value}),(e,l)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["g-input-tree-tag",{"is-disabled":e.disabled}])},[t.createElementVNode("div",{class:"g-input-tree-tag__wrap",ref_key:"wrapRef",ref:I},[t.createElementVNode("div",{class:"g-input-tree-tag__input-box",ref_key:"inputBoxRef",ref:T,style:t.normalizeStyle({width:Z.value})},[t.createVNode(t.unref(b.ElInput),{modelValue:y.value,"onUpdate:modelValue":l[0]||(l[0]=a=>y.value=a),placeholder:e.placeholder,clearable:e.clearable,disabled:e.disabled,class:"g-input-tree-tag__input",onFocus:x,onClick:x,onInput:J,onKeyup:t.withKeys(ee,["enter"])},null,8,["modelValue","placeholder","clearable","disabled"])],4),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.withDirectives(t.createElementVNode("div",{ref_key:"popperRef",ref:v,class:t.normalizeClass(["g-input-tree-tag__popover",`is-${N.value}`]),style:t.normalizeStyle(L.value),onMousedown:l[1]||(l[1]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("div",{class:"g-input-tree-tag__tree-wrap",style:t.normalizeStyle({maxHeight:e.popperMaxHeight+"px"})},[t.createVNode(t.unref(b.ElTree),{ref_key:"treeRef",ref:C,data:e.data,props:O.value,"node-key":e.nodeKey,"filter-node-method":Q,"expand-on-click-node":!1,"default-expand-all":e.defaultExpandAll,onNodeClick:X},{default:t.withCtx(a=>[t.renderSlot(e.$slots,"tree-node",{data:a?.data,node:a?.node,selectable:c(a?.data),selected:w(f(a?.data))},()=>[a?.data?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["g-input-tree-tag__node",{"is-selectable":c(a.data),"is-selected":c(a.data)&&w(f(a.data))}])},[t.renderSlot(e.$slots,"leaf-icon",{data:a.data,selectable:c(a.data),selected:w(f(a.data))},void 0,!0),t.createTextVNode(" "+t.toDisplayString(i(a.data)),1)],2)):t.createCommentVNode("",!0)],!0)]),_:3},8,["data","props","node-key","default-expand-all"])],4)],38),[[t.vShow,d.value]])])),u.value.length?(t.openBlock(),t.createElementBlock("div",oe,[t.renderSlot(e.$slots,"tags",{items:u.value,remove:E},()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(a,n)=>(t.openBlock(),t.createBlock(t.unref(b.ElTag),{key:a.value,class:"g-input-tree-tag__tag",type:e.tagType,effect:e.tagEffect,closable:e.closable&&!e.disabled,onClose:s=>E(n)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"tag",{item:a,index:n},()=>[t.createTextVNode(t.toDisplayString(a.label),1)],!0)]),_:2},1032,["type","effect","closable","onClose"]))),128))],!0)])):t.createCommentVNode("",!0)],512)],2))}}),h=ae._export_sfc(ne,[["__scopeId","data-v-1fe6c294"]]);h.install=B=>{B.component(h.name,h)};exports.GInputTreeTag=h;exports.default=h;
|