webc.com 0.1.20 → 0.1.21
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/Scroll/Scroll.js +140 -0
- package/Scroll/Scroll.styl +105 -0
- package/Scroll/var.styl +4 -0
- package/Wait/Wait.styl +32 -0
- package/Wait/var.styl +2 -0
- package/index.js +4 -0
- package/package.json +1 -1
- package/x/On.js +13 -0
- package/x/On.md +8 -0
- package/x/a.js +26 -0
- package/x/a.md +3 -0
- package/x/delayRoute.js +17 -0
- package/x/delayRoute.md +11 -0
- package/x/dom.js +3 -0
- package/x/dom.md +7 -0
- package/x/package.json +22 -0
- package/x/rmWait.js +2 -0
- package/x/rmWait.md +3 -0
- package/x/route.js +60 -0
- package/x/route.md +37 -0
- package/x/selfA.js +13 -0
- package/x/selfA.md +6 -0
- package/Scroll._.css +0 -1
- package/Scroll._.css.map +0 -1
- package/Scroll.css +0 -1
- package/Scroll.css.map +0 -1
- package/Scroll.js +0 -3
- package/Scroll.js.map +0 -10
- package/Wait._.css +0 -1
- package/Wait._.css.map +0 -1
- package/Wait.css +0 -1
- package/Wait.css.map +0 -1
- package/x.js +0 -1
- package/x.js.map +0 -1
- /package/{svg/giUzPhnYmbjOG3VzqseH5g.svg → Scroll/cursor/grab.svg} +0 -0
- /package/{svg/yhI9x3s8u28j5vUN45useQ.svg → Scroll/cursor/scrollh.svg} +0 -0
- /package/{svg/sgoOOaKyF_KnkUoRKxWczw.svg → Scroll/cursor/scrollv.svg} +0 -0
- /package/{svg/-oloHJiPWtJPJs8g_0WIaA.svg → Wait/svg/wait.svg} +0 -0
package/Scroll/Scroll.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { On } from "x/On.js";
|
|
2
|
+
import { D, newEl } from "x/dom.js";
|
|
3
|
+
|
|
4
|
+
(() => {
|
|
5
|
+
const { round, max, min } = Math,
|
|
6
|
+
PART = "part",
|
|
7
|
+
BAR = "bar",
|
|
8
|
+
SI = "si",
|
|
9
|
+
DRAG = "drag",
|
|
10
|
+
PX = "px",
|
|
11
|
+
mk = (tag, part, ...kids) => {
|
|
12
|
+
const e = newEl(tag);
|
|
13
|
+
if (part) e.setAttribute(PART, part);
|
|
14
|
+
e.append(...kids);
|
|
15
|
+
return e;
|
|
16
|
+
},
|
|
17
|
+
mkScroll = (size, pos, axis) => {
|
|
18
|
+
const style_size = size.toLowerCase(),
|
|
19
|
+
style_pos = pos.toLowerCase(),
|
|
20
|
+
client_size = "client" + size,
|
|
21
|
+
scroll_size = "scroll" + size,
|
|
22
|
+
scroll_pos = "scroll" + pos,
|
|
23
|
+
client_pos = "client" + axis;
|
|
24
|
+
return (ct) => {
|
|
25
|
+
let timer_bar,
|
|
26
|
+
ptr_unbind,
|
|
27
|
+
timer_resize,
|
|
28
|
+
pre_st = -1;
|
|
29
|
+
const m = ct.firstElementChild,
|
|
30
|
+
si = mk("i", SI),
|
|
31
|
+
bar = mk("b", BAR, si),
|
|
32
|
+
getGeo = (sih = si[client_size]) => {
|
|
33
|
+
const ch = ct[client_size],
|
|
34
|
+
sh = m[scroll_size];
|
|
35
|
+
return [sh - ch, max(1, ch - sih - 6), sih, ch, sh];
|
|
36
|
+
},
|
|
37
|
+
updateTop = (h) => {
|
|
38
|
+
if (!bar.parentNode) return;
|
|
39
|
+
const [ds, db] = getGeo(h),
|
|
40
|
+
st = max(0, min(ct[scroll_pos], ds));
|
|
41
|
+
if (pre_st != -1 && pre_st != st) {
|
|
42
|
+
bar.style.opacity = 1;
|
|
43
|
+
clearTimeout(timer_bar);
|
|
44
|
+
timer_bar = setTimeout(() => (bar.style.opacity = 0), 1e3);
|
|
45
|
+
}
|
|
46
|
+
pre_st = st;
|
|
47
|
+
si.style[style_pos] = 3 + round((db * st) / ds) + PX;
|
|
48
|
+
},
|
|
49
|
+
onDown = (e) => {
|
|
50
|
+
if (ptr_unbind) return;
|
|
51
|
+
const bd = D.body;
|
|
52
|
+
bd.setPointerCapture(e.pointerId);
|
|
53
|
+
bd.classList.add(DRAG);
|
|
54
|
+
bar.part.add(DRAG);
|
|
55
|
+
let pre = e[client_pos];
|
|
56
|
+
const detach = () => {
|
|
57
|
+
bd.classList.remove(DRAG);
|
|
58
|
+
bar.part.remove(DRAG);
|
|
59
|
+
un_ptr();
|
|
60
|
+
ptr_unbind = null;
|
|
61
|
+
},
|
|
62
|
+
un_ptr = On(bd, {
|
|
63
|
+
pointermove: (e) => {
|
|
64
|
+
const [ds, db] = getGeo();
|
|
65
|
+
ct[scroll_pos] += round((ds * (e[client_pos] - pre)) / db);
|
|
66
|
+
pre = e[client_pos];
|
|
67
|
+
},
|
|
68
|
+
pointerup: detach,
|
|
69
|
+
lostpointercapture: detach,
|
|
70
|
+
});
|
|
71
|
+
ptr_unbind = detach;
|
|
72
|
+
},
|
|
73
|
+
onClick = (e) => {
|
|
74
|
+
const rect = bar.getBoundingClientRect(),
|
|
75
|
+
top = rect[style_pos],
|
|
76
|
+
[ds, db, sih] = getGeo();
|
|
77
|
+
ct[scroll_pos] = round(ds * max(min((e[client_pos] - top - 3 - sih / 2) / db, 1), 0));
|
|
78
|
+
onDown(e);
|
|
79
|
+
},
|
|
80
|
+
unbind = [
|
|
81
|
+
On(bar, { pointerdown: onClick }),
|
|
82
|
+
On(si, {
|
|
83
|
+
pointerdown: (e) => {
|
|
84
|
+
e.stopPropagation();
|
|
85
|
+
onDown(e);
|
|
86
|
+
},
|
|
87
|
+
}),
|
|
88
|
+
On(ct, { scroll: updateTop.bind(null, undefined) }),
|
|
89
|
+
],
|
|
90
|
+
ob = new ResizeObserver(() => {
|
|
91
|
+
clearTimeout(timer_resize);
|
|
92
|
+
timer_resize = setTimeout(() => {
|
|
93
|
+
const [, , , ch, sh] = getGeo(),
|
|
94
|
+
is_turn = ch < sh;
|
|
95
|
+
if (is_turn) {
|
|
96
|
+
if (bar.parentNode != ct) ct.appendChild(bar);
|
|
97
|
+
const h = max(16, round((ch * ch) / sh));
|
|
98
|
+
si.style[style_size] = h + PX;
|
|
99
|
+
updateTop(h);
|
|
100
|
+
} else if (bar.parentNode) {
|
|
101
|
+
bar.remove();
|
|
102
|
+
}
|
|
103
|
+
}, 200);
|
|
104
|
+
}),
|
|
105
|
+
destroy = () => {
|
|
106
|
+
clearTimeout(timer_bar);
|
|
107
|
+
clearTimeout(timer_resize);
|
|
108
|
+
unbind.forEach((f) => f());
|
|
109
|
+
if (ptr_unbind) ptr_unbind();
|
|
110
|
+
ob.disconnect();
|
|
111
|
+
if (bar.parentNode) bar.remove();
|
|
112
|
+
};
|
|
113
|
+
bar.style.opacity = 0;
|
|
114
|
+
[ct, m].forEach((i) => ob.observe(i));
|
|
115
|
+
return destroy;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
[
|
|
120
|
+
["v", "Height", "Top", "Y", "flex-direction:column;width:100%;min-height:100%"],
|
|
121
|
+
["h", "Width", "Left", "X", "min-width:100%;width:max-content;height:100%"],
|
|
122
|
+
].map(([prefix, size, pos, axis, css]) => {
|
|
123
|
+
const initScroll = mkScroll(size, pos, axis);
|
|
124
|
+
customElements.define(
|
|
125
|
+
prefix + "-scroll",
|
|
126
|
+
class extends HTMLElement {
|
|
127
|
+
connectedCallback() {
|
|
128
|
+
const content = mk("b", "", mk("slot")),
|
|
129
|
+
wrapper = mk("b", "scroll", content);
|
|
130
|
+
content.style.cssText = "display:flex;" + css;
|
|
131
|
+
this.attachShadow({ mode: "open" }).appendChild(wrapper);
|
|
132
|
+
this._unbind = initScroll(wrapper);
|
|
133
|
+
}
|
|
134
|
+
disconnectedCallback() {
|
|
135
|
+
this._unbind?.();
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
})();
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
v-scroll, h-scroll
|
|
2
|
+
display block
|
|
3
|
+
|
|
4
|
+
&::part(scroll)
|
|
5
|
+
display flex
|
|
6
|
+
height 100%
|
|
7
|
+
overflow auto
|
|
8
|
+
position relative
|
|
9
|
+
scrollbar-width none
|
|
10
|
+
width 100%
|
|
11
|
+
|
|
12
|
+
&::-webkit-scrollbar
|
|
13
|
+
display none
|
|
14
|
+
|
|
15
|
+
&::part(bar)
|
|
16
|
+
bottom 0
|
|
17
|
+
display block
|
|
18
|
+
position sticky
|
|
19
|
+
transition all 0.2s, opacity 1s, box-shadow 1s
|
|
20
|
+
user-select none
|
|
21
|
+
z-index 999
|
|
22
|
+
--si-anim none
|
|
23
|
+
--si-bg #7d7d7d99
|
|
24
|
+
|
|
25
|
+
&::part(bar):hover, &::part(drag)
|
|
26
|
+
background #0000000d
|
|
27
|
+
box-shadow inset 0 1px 6px #ffffffcc, inset 0 -2px 8px #0000000a, inset 0 0 0 1px #ffffff80
|
|
28
|
+
opacity 1 !important
|
|
29
|
+
--si-anim v-scroll-pop 0.4s ease-out
|
|
30
|
+
--si-bg #7d7d7dcc
|
|
31
|
+
|
|
32
|
+
&::part(si)
|
|
33
|
+
animation var(--si-anim)
|
|
34
|
+
background var(--si-bg)
|
|
35
|
+
border-radius 3px
|
|
36
|
+
display block
|
|
37
|
+
margin auto
|
|
38
|
+
position absolute
|
|
39
|
+
transition all 0.2s, opacity 1s, box-shadow 1s
|
|
40
|
+
|
|
41
|
+
v-scroll
|
|
42
|
+
height 100%
|
|
43
|
+
width 100%
|
|
44
|
+
--sh inset 3px 0 3px -3px #0000004d, inset -3px 0 3px -3px #0000000d
|
|
45
|
+
|
|
46
|
+
&::part(scroll)
|
|
47
|
+
overflow-x hidden
|
|
48
|
+
|
|
49
|
+
&::part(bar)
|
|
50
|
+
height 100%
|
|
51
|
+
left 100%
|
|
52
|
+
margin-left -13px
|
|
53
|
+
top 0
|
|
54
|
+
width 13px
|
|
55
|
+
|
|
56
|
+
&::part(bar):hover, &::part(drag)
|
|
57
|
+
cursor var(--cursorScrollvSvg)
|
|
58
|
+
margin-left -21px
|
|
59
|
+
width 21px
|
|
60
|
+
|
|
61
|
+
&::part(si)
|
|
62
|
+
cursor var(--cursorScrollvSvg)
|
|
63
|
+
left 0
|
|
64
|
+
right 0
|
|
65
|
+
width 7px
|
|
66
|
+
|
|
67
|
+
h-scroll
|
|
68
|
+
width 100%
|
|
69
|
+
--sh inset 0 3px 3px -3px #0000004d, inset 0 -3px 3px -3px #0000000d
|
|
70
|
+
|
|
71
|
+
&::part(scroll)
|
|
72
|
+
display block
|
|
73
|
+
overflow-y hidden
|
|
74
|
+
width 100%
|
|
75
|
+
|
|
76
|
+
&::part(bar)
|
|
77
|
+
height 13px
|
|
78
|
+
left 0
|
|
79
|
+
margin-top -13px
|
|
80
|
+
right 0
|
|
81
|
+
width 100%
|
|
82
|
+
|
|
83
|
+
&::part(bar):hover, &::part(drag)
|
|
84
|
+
cursor var(--cursorScrollhSvg)
|
|
85
|
+
height 21px
|
|
86
|
+
margin-top -21px
|
|
87
|
+
|
|
88
|
+
&::part(si)
|
|
89
|
+
bottom 0
|
|
90
|
+
cursor var(--cursorScrollhSvg)
|
|
91
|
+
height 7px
|
|
92
|
+
top 0
|
|
93
|
+
|
|
94
|
+
@keyframes v-scroll-pop
|
|
95
|
+
0%
|
|
96
|
+
transform scale(1)
|
|
97
|
+
|
|
98
|
+
40%
|
|
99
|
+
transform scale(1.15)
|
|
100
|
+
|
|
101
|
+
100%
|
|
102
|
+
transform scale(1)
|
|
103
|
+
|
|
104
|
+
body.drag
|
|
105
|
+
cursor var(--cursorGrabSvg) !important
|
package/Scroll/var.styl
ADDED
package/Wait/Wait.styl
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.wait, .ing
|
|
2
|
+
position relative
|
|
3
|
+
|
|
4
|
+
&:before
|
|
5
|
+
animation-duration 1s
|
|
6
|
+
animation-name fadeIn
|
|
7
|
+
background var(--waitSvg) 50% 50% / 64px no-repeat
|
|
8
|
+
bottom 0
|
|
9
|
+
content ''
|
|
10
|
+
cursor wait
|
|
11
|
+
left 0
|
|
12
|
+
position absolute
|
|
13
|
+
right 0
|
|
14
|
+
top 0
|
|
15
|
+
z-index 999
|
|
16
|
+
|
|
17
|
+
.ing
|
|
18
|
+
&:before
|
|
19
|
+
background-color #ffffff99
|
|
20
|
+
|
|
21
|
+
.wait
|
|
22
|
+
align-self center
|
|
23
|
+
display flex
|
|
24
|
+
height 64px
|
|
25
|
+
width 64px
|
|
26
|
+
|
|
27
|
+
@keyframes fadeIn
|
|
28
|
+
from
|
|
29
|
+
opacity 0
|
|
30
|
+
|
|
31
|
+
to
|
|
32
|
+
opacity 1
|
package/Wait/var.styl
ADDED
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"webc.com","version":"0.1.
|
|
1
|
+
{"name":"webc.com","version":"0.1.21","description":"","keywords":[],"homepage":"https://webc-zh.github.io","license":"MulanPSL-2.0","author":"i18n.site@gmail.com","repository":{"type":"git","url":"git+https://github.com/webc-zh/webc-zh.github.io.git"},"files":["./*"],"type":"module","exports":{"./*":"./*"},"scripts":{},"devDependencies":{}}
|
package/x/On.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const On = (elem, dict) => {
|
|
2
|
+
let event, func;
|
|
3
|
+
for (event in dict) {
|
|
4
|
+
func = dict[event];
|
|
5
|
+
elem.addEventListener(event, func);
|
|
6
|
+
}
|
|
7
|
+
return () => {
|
|
8
|
+
for (event in dict) {
|
|
9
|
+
func = dict[event];
|
|
10
|
+
elem.removeEventListener(event, func);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
};
|
package/x/On.md
ADDED
package/x/a.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { goto } from "x/route.js";
|
|
2
|
+
import { selfA } from "x/selfA.js";
|
|
3
|
+
import { B } from "x/dom.js";
|
|
4
|
+
|
|
5
|
+
B.addEventListener("click", (e) => {
|
|
6
|
+
var href, name, p;
|
|
7
|
+
p = e.target;
|
|
8
|
+
while (p) {
|
|
9
|
+
({ nodeName: name } = p);
|
|
10
|
+
if (name === "A") {
|
|
11
|
+
({ href } = p);
|
|
12
|
+
if (href) {
|
|
13
|
+
href = selfA(p, e);
|
|
14
|
+
if (href !== void 0) {
|
|
15
|
+
goto(href);
|
|
16
|
+
} else if (!p.target) {
|
|
17
|
+
p.target = "_blank";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
break;
|
|
21
|
+
} else if (name === "BODY") {
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
p = p.parentNode;
|
|
25
|
+
}
|
|
26
|
+
});
|
package/x/a.md
ADDED
package/x/delayRoute.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { route } from "./route.js";
|
|
2
|
+
|
|
3
|
+
// 避免 onMount 之前,route 被触发,导致重复加载数据
|
|
4
|
+
export const delayRoute = (loadUrl) => {
|
|
5
|
+
let t;
|
|
6
|
+
const unbind = route((url, preUrl) => {
|
|
7
|
+
t = setTimeout(() => {
|
|
8
|
+
loadUrl(url, preUrl);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
return () => {
|
|
12
|
+
unbind();
|
|
13
|
+
clearTimeout(t);
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default delayRoute;
|
package/x/delayRoute.md
ADDED
package/x/dom.js
ADDED
package/x/dom.md
ADDED
package/x/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@3-/x",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"homepage": "https://webc-zh.github.io",
|
|
7
|
+
"license": "MulanPSL-2.0",
|
|
8
|
+
"author": "i18n.site@gmail.com",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/webc-zh/webc-zh.github.io.git"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"./*"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
"./*": "./*"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {},
|
|
21
|
+
"devDependencies": {}
|
|
22
|
+
}
|
package/x/rmWait.js
ADDED
package/x/rmWait.md
ADDED
package/x/route.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { On } from "x/On.js";
|
|
2
|
+
|
|
3
|
+
export const nowUrl = () => location.pathname.slice(1),
|
|
4
|
+
[route, setPre, preUrl, refresh, removeSlash, split, setUrl, goto] = (() => {
|
|
5
|
+
let PRE = nowUrl(),
|
|
6
|
+
HOOK = [];
|
|
7
|
+
if (location.hash) PRE += location.hash;
|
|
8
|
+
|
|
9
|
+
const HASH = "#",
|
|
10
|
+
route = (hook) => {
|
|
11
|
+
HOOK.push(hook);
|
|
12
|
+
hook(nowUrl());
|
|
13
|
+
return () => {
|
|
14
|
+
HOOK = HOOK.filter((f) => f !== hook);
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
setPre = (url) => {
|
|
18
|
+
PRE = url;
|
|
19
|
+
},
|
|
20
|
+
preUrl = () => PRE,
|
|
21
|
+
refresh = (url) => {
|
|
22
|
+
url = url || nowUrl();
|
|
23
|
+
for (const f of HOOK) f(url, PRE);
|
|
24
|
+
setPre(url);
|
|
25
|
+
},
|
|
26
|
+
removeSlash = (url) => (url[0] === "/" ? url.slice(1) : url),
|
|
27
|
+
split = (str, s) => {
|
|
28
|
+
const p = str.indexOf(s);
|
|
29
|
+
return p >= 0 ? [str.slice(0, p), str.slice(p + 1)] : [str, ""];
|
|
30
|
+
},
|
|
31
|
+
setUrl = (url) => {
|
|
32
|
+
url = removeSlash(url);
|
|
33
|
+
if (url !== PRE) {
|
|
34
|
+
const [path, hash] = split(url, HASH),
|
|
35
|
+
[p] = split(PRE, HASH);
|
|
36
|
+
setPre(url);
|
|
37
|
+
if (path !== p) {
|
|
38
|
+
history.pushState(null, "", "/" + url);
|
|
39
|
+
return 1;
|
|
40
|
+
}
|
|
41
|
+
if (location.hash.slice(1) !== hash) {
|
|
42
|
+
location.hash = hash;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
window.dispatchEvent(new HashChangeEvent("hashchange"));
|
|
47
|
+
},
|
|
48
|
+
goto = (url) => {
|
|
49
|
+
if (setUrl(url)) refresh(url);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
On(window, {
|
|
53
|
+
popstate: () => {
|
|
54
|
+
const url = nowUrl();
|
|
55
|
+
if (url !== split(PRE, HASH)[0]) refresh(url);
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return [route, setPre, preUrl, refresh, removeSlash, split, setUrl, goto];
|
|
60
|
+
})();
|
package/x/route.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# 路由管理与跳转
|
|
2
|
+
|
|
3
|
+
- `nowUrl()`
|
|
4
|
+
- 返回值:当前 URL 路径(不含首部斜杠)。
|
|
5
|
+
|
|
6
|
+
- `route(hook)`
|
|
7
|
+
- `hook`: 路由变化时执行的回调函数。格式:
|
|
8
|
+
- 参数:
|
|
9
|
+
- `url`: 字符串,新 URL 路径。
|
|
10
|
+
- `preUrl`: 字符串(可选),旧 URL 路径。
|
|
11
|
+
- 返回值:无。
|
|
12
|
+
- 返回值:取消订阅的函数,格式为 `() => void`。
|
|
13
|
+
|
|
14
|
+
- `setPre(url)`
|
|
15
|
+
- `url`: 字符串,新的前一次 URL 路径。
|
|
16
|
+
|
|
17
|
+
- `preUrl()`
|
|
18
|
+
- 返回值:前一次的 URL 路径。
|
|
19
|
+
|
|
20
|
+
- `refresh(url)`
|
|
21
|
+
- `url`: 字符串(可选),要触发回调的 URL 路径,默认是当前 URL。
|
|
22
|
+
|
|
23
|
+
- `removeSlash(url)`
|
|
24
|
+
- `url`: 字符串。
|
|
25
|
+
- 返回值:移除首部斜杠后的字符串。
|
|
26
|
+
|
|
27
|
+
- `split(str, s)`
|
|
28
|
+
- `str`: 待拆分字符串。
|
|
29
|
+
- `s`: 分隔符。
|
|
30
|
+
- 返回值:包含两个元素的数组 `[前部, 后部]`。
|
|
31
|
+
|
|
32
|
+
- `setUrl(url)`
|
|
33
|
+
- `url`: 目标 URL 路径。
|
|
34
|
+
- 返回值:若路径改变返回 `1`,若仅 hash 改变不返回值。
|
|
35
|
+
|
|
36
|
+
- `goto(url)`
|
|
37
|
+
- `url`: 目标 URL 路径。
|
package/x/selfA.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// 判断A标签的href是否为当前网站的, 如果是, 返回url, 以实现不刷新跳转
|
|
2
|
+
export const selfA = (p, e) => {
|
|
3
|
+
var hash, url;
|
|
4
|
+
if (p.host === location.host) {
|
|
5
|
+
({ hash } = p);
|
|
6
|
+
url = p.pathname.slice(1) + p.search;
|
|
7
|
+
if (hash) {
|
|
8
|
+
url += hash;
|
|
9
|
+
}
|
|
10
|
+
e.preventDefault();
|
|
11
|
+
return url;
|
|
12
|
+
}
|
|
13
|
+
};
|
package/x/selfA.md
ADDED
package/Scroll._.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v-scroll,h-scroll{display:block}v-scroll::part(scroll),h-scroll::part(scroll){scrollbar-width:none;width:100%;height:100%;display:flex;position:relative;overflow:auto}v-scroll::part(scroll)::-webkit-scrollbar,h-scroll::part(scroll)::-webkit-scrollbar{display:none}v-scroll::part(bar),h-scroll::part(bar){user-select:none;z-index:999;--si-anim:none;--si-bg:#7d7d7d99;transition:all .2s,opacity 1s,box-shadow 1s;display:block;position:sticky;bottom:0}v-scroll::part(bar):hover,h-scroll::part(bar):hover,v-scroll::part(drag),h-scroll::part(drag){--si-anim:v-scroll-pop .4s ease-out;--si-bg:#7d7d7dcc;background:#0000000d;box-shadow:inset 0 1px 6px #fffc,inset 0 -2px 8px #0000000a,inset 0 0 0 1px #ffffff80;opacity:1!important}v-scroll::part(si),h-scroll::part(si){animation:var(--si-anim);background:var(--si-bg);border-radius:3px;margin:auto;transition:all .2s,opacity 1s,box-shadow 1s;display:block;position:absolute}v-scroll{--sh:inset 3px 0 3px -3px #0000004d, inset -3px 0 3px -3px #0000000d;width:100%;height:100%}v-scroll::part(scroll){overflow-x:hidden}v-scroll::part(bar){width:13px;height:100%;margin-left:-13px;top:0;left:100%}v-scroll::part(bar):hover,v-scroll::part(drag){cursor:var(--cursorScrollvSvg);width:21px;margin-left:-21px}v-scroll::part(si){cursor:var(--cursorScrollvSvg);width:7px;left:0;right:0}h-scroll{--sh:inset 0 3px 3px -3px #0000004d, inset 0 -3px 3px -3px #0000000d;width:100%}h-scroll::part(scroll){width:100%;display:block;overflow-y:hidden}h-scroll::part(bar){width:100%;height:13px;margin-top:-13px;left:0;right:0}h-scroll::part(bar):hover,h-scroll::part(drag){cursor:var(--cursorScrollhSvg);height:21px;margin-top:-21px}h-scroll::part(si){cursor:var(--cursorScrollhSvg);height:7px;top:0;bottom:0}body.drag{cursor:var(--cursorGrabSvg)!important}@-webkit-keyframes v-scroll-pop{0%{transform:scale(1)}40%{transform:scale(1.15)}to{transform:scale(1)}}@-moz-keyframes v-scroll-pop{0%{transform:scale(1)}40%{transform:scale(1.15)}to{transform:scale(1)}}@-o-keyframes v-scroll-pop{0%{transform:scale(1)}40%{transform:scale(1.15)}to{transform:scale(1)}}@keyframes v-scroll-pop{0%{transform:scale(1)}40%{transform:scale(1.15)}to{transform:scale(1)}}
|
package/Scroll._.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":null,"mappings":"AAAA,gCAIA,uIASA,iGAIA,yLAWA,mRAUA,iMAUA,qGAKA,yCAGA,6EAOA,2GAMA,2EAMA,yFAIA,kEAKA,2EAOA,2GAMA,4EAMA,gDAGA","sources":["Users/z/git/webc-zh/lib/Scroll._.css"],"sourcesContent":["v-scroll,\nh-scroll {\n display: block;\n}\nv-scroll::part(scroll),\nh-scroll::part(scroll) {\n display: flex;\n height: 100%;\n overflow: auto;\n position: relative;\n scrollbar-width: none;\n width: 100%;\n}\nv-scroll::part(scroll)::-webkit-scrollbar,\nh-scroll::part(scroll)::-webkit-scrollbar {\n display: none;\n}\nv-scroll::part(bar),\nh-scroll::part(bar) {\n bottom: 0;\n display: block;\n position: sticky;\n transition: all 0.2s, opacity 1s, box-shadow 1s;\n user-select: none;\n z-index: 999;\n --si-anim: none;\n --si-bg: rgba(125,125,125,0.6);\n}\nv-scroll::part(bar):hover,\nh-scroll::part(bar):hover,\nv-scroll::part(drag),\nh-scroll::part(drag) {\n background: rgba(0,0,0,0.051);\n box-shadow: inset 0 1px 6px rgba(255,255,255,0.8), inset 0 -2px 8px rgba(0,0,0,0.039), inset 0 0 0 1px rgba(255,255,255,0.502);\n opacity: 1 !important;\n --si-anim: v-scroll-pop 0.4s ease-out;\n --si-bg: rgba(125,125,125,0.8);\n}\nv-scroll::part(si),\nh-scroll::part(si) {\n animation: var(--si-anim);\n background: var(--si-bg);\n border-radius: 3px;\n display: block;\n margin: auto;\n position: absolute;\n transition: all 0.2s, opacity 1s, box-shadow 1s;\n}\nv-scroll {\n height: 100%;\n width: 100%;\n --sh: inset 3px 0 3px -3px rgba(0,0,0,0.302), inset -3px 0 3px -3px rgba(0,0,0,0.051);\n}\nv-scroll::part(scroll) {\n overflow-x: hidden;\n}\nv-scroll::part(bar) {\n height: 100%;\n left: 100%;\n margin-left: -13px;\n top: 0;\n width: 13px;\n}\nv-scroll::part(bar):hover,\nv-scroll::part(drag) {\n cursor: var(--cursorScrollvSvg);\n margin-left: -21px;\n width: 21px;\n}\nv-scroll::part(si) {\n cursor: var(--cursorScrollvSvg);\n left: 0;\n right: 0;\n width: 7px;\n}\nh-scroll {\n width: 100%;\n --sh: inset 0 3px 3px -3px rgba(0,0,0,0.302), inset 0 -3px 3px -3px rgba(0,0,0,0.051);\n}\nh-scroll::part(scroll) {\n display: block;\n overflow-y: hidden;\n width: 100%;\n}\nh-scroll::part(bar) {\n height: 13px;\n left: 0;\n margin-top: -13px;\n right: 0;\n width: 100%;\n}\nh-scroll::part(bar):hover,\nh-scroll::part(drag) {\n cursor: var(--cursorScrollhSvg);\n height: 21px;\n margin-top: -21px;\n}\nh-scroll::part(si) {\n bottom: 0;\n cursor: var(--cursorScrollhSvg);\n height: 7px;\n top: 0;\n}\nbody.drag {\n cursor: var(--cursorGrabSvg) !important;\n}\n@-moz-keyframes v-scroll-pop {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.15);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-webkit-keyframes v-scroll-pop {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.15);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-o-keyframes v-scroll-pop {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.15);\n }\n 100% {\n transform: scale(1);\n }\n}\n@keyframes v-scroll-pop {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.15);\n }\n 100% {\n transform: scale(1);\n }\n}\n"],"names":[]}
|
package/Scroll.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--cursorGrabSvg:url(./svg/giUzPhnYmbjOG3VzqseH5g.svg) 8 7, grabbing;--cursorScrollhSvg:url(./svg/yhI9x3s8u28j5vUN45useQ.svg) 10 10, ew-resize;--cursorScrollvSvg:url(./svg/sgoOOaKyF_KnkUoRKxWczw.svg) 10 10, ns-resize}v-scroll,h-scroll{display:block}v-scroll::part(scroll),h-scroll::part(scroll){scrollbar-width:none;width:100%;height:100%;display:flex;position:relative;overflow:auto}v-scroll::part(scroll)::-webkit-scrollbar,h-scroll::part(scroll)::-webkit-scrollbar{display:none}v-scroll::part(bar),h-scroll::part(bar){user-select:none;z-index:999;--si-anim:none;--si-bg:#7d7d7d99;transition:all .2s,opacity 1s,box-shadow 1s;display:block;position:sticky;bottom:0}v-scroll::part(bar):hover,h-scroll::part(bar):hover,v-scroll::part(drag),h-scroll::part(drag){--si-anim:v-scroll-pop .4s ease-out;--si-bg:#7d7d7dcc;background:#0000000d;box-shadow:inset 0 1px 6px #fffc,inset 0 -2px 8px #0000000a,inset 0 0 0 1px #ffffff80;opacity:1!important}v-scroll::part(si),h-scroll::part(si){animation:var(--si-anim);background:var(--si-bg);border-radius:3px;margin:auto;transition:all .2s,opacity 1s,box-shadow 1s;display:block;position:absolute}v-scroll{--sh:inset 3px 0 3px -3px #0000004d, inset -3px 0 3px -3px #0000000d;width:100%;height:100%}v-scroll::part(scroll){overflow-x:hidden}v-scroll::part(bar){width:13px;height:100%;margin-left:-13px;top:0;left:100%}v-scroll::part(bar):hover,v-scroll::part(drag){cursor:var(--cursorScrollvSvg);width:21px;margin-left:-21px}v-scroll::part(si){cursor:var(--cursorScrollvSvg);width:7px;left:0;right:0}h-scroll{--sh:inset 0 3px 3px -3px #0000004d, inset 0 -3px 3px -3px #0000000d;width:100%}h-scroll::part(scroll){width:100%;display:block;overflow-y:hidden}h-scroll::part(bar){width:100%;height:13px;margin-top:-13px;left:0;right:0}h-scroll::part(bar):hover,h-scroll::part(drag){cursor:var(--cursorScrollhSvg);height:21px;margin-top:-21px}h-scroll::part(si){cursor:var(--cursorScrollhSvg);height:7px;top:0;bottom:0}body.drag{cursor:var(--cursorGrabSvg)!important}@-webkit-keyframes v-scroll-pop{0%{transform:scale(1)}40%{transform:scale(1.15)}to{transform:scale(1)}}@-moz-keyframes v-scroll-pop{0%{transform:scale(1)}40%{transform:scale(1.15)}to{transform:scale(1)}}@-o-keyframes v-scroll-pop{0%{transform:scale(1)}40%{transform:scale(1.15)}to{transform:scale(1)}}@keyframes v-scroll-pop{0%{transform:scale(1)}40%{transform:scale(1.15)}to{transform:scale(1)}}
|
package/Scroll.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":null,"mappings":"AAAA,8NAKA,gCAIA,uIASA,iGAIA,yLAWA,mRAUA,iMAUA,qGAKA,yCAGA,6EAOA,2GAMA,2EAMA,yFAIA,kEAKA,2EAOA,2GAMA,4EAMA,gDAGA","sources":["Users/z/git/webc-zh/lib/Scroll.css"],"sourcesContent":[":root {\n --cursorGrabSvg: url(\"./svg/giUzPhnYmbjOG3VzqseH5g.svg\") 8 7, grabbing;\n --cursorScrollhSvg: url(\"./svg/yhI9x3s8u28j5vUN45useQ.svg\") 10 10, ew-resize;\n --cursorScrollvSvg: url(\"./svg/sgoOOaKyF_KnkUoRKxWczw.svg\") 10 10, ns-resize;\n}\nv-scroll,\nh-scroll {\n display: block;\n}\nv-scroll::part(scroll),\nh-scroll::part(scroll) {\n display: flex;\n height: 100%;\n overflow: auto;\n position: relative;\n scrollbar-width: none;\n width: 100%;\n}\nv-scroll::part(scroll)::-webkit-scrollbar,\nh-scroll::part(scroll)::-webkit-scrollbar {\n display: none;\n}\nv-scroll::part(bar),\nh-scroll::part(bar) {\n bottom: 0;\n display: block;\n position: sticky;\n transition: all 0.2s, opacity 1s, box-shadow 1s;\n user-select: none;\n z-index: 999;\n --si-anim: none;\n --si-bg: rgba(125,125,125,0.6);\n}\nv-scroll::part(bar):hover,\nh-scroll::part(bar):hover,\nv-scroll::part(drag),\nh-scroll::part(drag) {\n background: rgba(0,0,0,0.051);\n box-shadow: inset 0 1px 6px rgba(255,255,255,0.8), inset 0 -2px 8px rgba(0,0,0,0.039), inset 0 0 0 1px rgba(255,255,255,0.502);\n opacity: 1 !important;\n --si-anim: v-scroll-pop 0.4s ease-out;\n --si-bg: rgba(125,125,125,0.8);\n}\nv-scroll::part(si),\nh-scroll::part(si) {\n animation: var(--si-anim);\n background: var(--si-bg);\n border-radius: 3px;\n display: block;\n margin: auto;\n position: absolute;\n transition: all 0.2s, opacity 1s, box-shadow 1s;\n}\nv-scroll {\n height: 100%;\n width: 100%;\n --sh: inset 3px 0 3px -3px rgba(0,0,0,0.302), inset -3px 0 3px -3px rgba(0,0,0,0.051);\n}\nv-scroll::part(scroll) {\n overflow-x: hidden;\n}\nv-scroll::part(bar) {\n height: 100%;\n left: 100%;\n margin-left: -13px;\n top: 0;\n width: 13px;\n}\nv-scroll::part(bar):hover,\nv-scroll::part(drag) {\n cursor: var(--cursorScrollvSvg);\n margin-left: -21px;\n width: 21px;\n}\nv-scroll::part(si) {\n cursor: var(--cursorScrollvSvg);\n left: 0;\n right: 0;\n width: 7px;\n}\nh-scroll {\n width: 100%;\n --sh: inset 0 3px 3px -3px rgba(0,0,0,0.302), inset 0 -3px 3px -3px rgba(0,0,0,0.051);\n}\nh-scroll::part(scroll) {\n display: block;\n overflow-y: hidden;\n width: 100%;\n}\nh-scroll::part(bar) {\n height: 13px;\n left: 0;\n margin-top: -13px;\n right: 0;\n width: 100%;\n}\nh-scroll::part(bar):hover,\nh-scroll::part(drag) {\n cursor: var(--cursorScrollhSvg);\n height: 21px;\n margin-top: -21px;\n}\nh-scroll::part(si) {\n bottom: 0;\n cursor: var(--cursorScrollhSvg);\n height: 7px;\n top: 0;\n}\nbody.drag {\n cursor: var(--cursorGrabSvg) !important;\n}\n@-moz-keyframes v-scroll-pop {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.15);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-webkit-keyframes v-scroll-pop {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.15);\n }\n 100% {\n transform: scale(1);\n }\n}\n@-o-keyframes v-scroll-pop {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.15);\n }\n 100% {\n transform: scale(1);\n }\n}\n@keyframes v-scroll-pop {\n 0% {\n transform: scale(1);\n }\n 40% {\n transform: scale(1.15);\n }\n 100% {\n transform: scale(1);\n }\n}\n"],"names":[]}
|
package/Scroll.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { On as A, D as I, newEl as H } from "./x.js";(()=>{let{round:h,max:b,min:D}=Math,a=(r,l,...p)=>{let c=H(r);if(l)c.setAttribute("part",l);return c.append(...p),c},k=(r,l,p)=>{let c=r.toLowerCase(),f=l.toLowerCase(),_="client"+r,y="scroll"+r,d="scroll"+l,w="client"+p;return(s)=>{let C,m,g,v=-1,P=s.firstElementChild,u=a("i","si"),o=a("b","bar",u),T=(e=u[_])=>{let t=s[_],i=P[y];return[i-t,b(1,t-e-6),e,t,i]},E=(e)=>{if(!o.parentNode)return;let[t,i]=T(e),n=b(0,D(s[d],t));if(v!=-1&&v!=n)o.style.opacity=1,clearTimeout(C),C=setTimeout(()=>o.style.opacity=0,1000);v=n,u.style[f]=3+h(i*n/t)+"px"},G=(e)=>{if(m)return;let t=I.body;t.setPointerCapture(e.pointerId),t.classList.add("drag"),o.part.add("drag");let i=e[w],n=()=>{t.classList.remove("drag"),o.part.remove("drag"),x(),m=null},x=A(t,{pointermove:(R)=>{let[z,B]=T();s[d]+=h(z*(R[w]-i)/B),i=R[w]},pointerup:n,lostpointercapture:n});m=n},S=(e)=>{let t=o.getBoundingClientRect(),i=t[f],[n,x,R]=T();s[d]=h(n*b(D((e[w]-i-3-R/2)/x,1),0)),G(e)},N=[A(o,{pointerdown:S}),A(u,{pointerdown:(e)=>{e.stopPropagation(),G(e)}}),A(s,{scroll:E.bind(null,void 0)})],L=new ResizeObserver(()=>{clearTimeout(g),g=setTimeout(()=>{let[,,,e,t]=T();if(e<t){if(o.parentNode!=s)s.appendChild(o);let n=b(16,h(e*e/t));u.style[c]=n+"px",E(n)}else if(o.parentNode)o.remove()},200)}),X=()=>{if(clearTimeout(C),clearTimeout(g),N.forEach((e)=>e()),m)m();if(L.disconnect(),o.parentNode)o.remove()};return o.style.opacity=0,[s,P].forEach((e)=>L.observe(e)),X}};[["v","Height","Top","Y","flex-direction:column;width:100%;min-height:100%"],["h","Width","Left","X","min-width:100%;width:max-content;height:100%"]].map(([r,l,p,c,f])=>{let _=k(l,p,c);customElements.define(r+"-scroll",class extends HTMLElement{connectedCallback(){let y=a("b","",a("slot")),d=a("b","scroll",y);y.style.cssText="display:flex;"+f,this.attachShadow({mode:"open"}).appendChild(d),this._unbind=_(d)}disconnectedCallback(){this._unbind?.()}})})})();
|
|
2
|
-
|
|
3
|
-
|
package/Scroll.js.map
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../com/Scroll/Scroll.js"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { On } from \"x/On.js\";\nimport { D, newEl } from \"x/dom.js\";\n\n(() => {\n const { round, max, min } = Math,\n PART = \"part\",\n BAR = \"bar\",\n SI = \"si\",\n DRAG = \"drag\",\n PX = \"px\",\n mk = (tag, part, ...kids) => {\n const e = newEl(tag);\n if (part) e.setAttribute(PART, part);\n e.append(...kids);\n return e;\n },\n mkScroll = (size, pos, axis) => {\n const style_size = size.toLowerCase(),\n style_pos = pos.toLowerCase(),\n client_size = \"client\" + size,\n scroll_size = \"scroll\" + size,\n scroll_pos = \"scroll\" + pos,\n client_pos = \"client\" + axis;\n return (ct) => {\n let timer_bar,\n ptr_unbind,\n timer_resize,\n pre_st = -1;\n const m = ct.firstElementChild,\n si = mk(\"i\", SI),\n bar = mk(\"b\", BAR, si),\n getGeo = (sih = si[client_size]) => {\n const ch = ct[client_size],\n sh = m[scroll_size];\n return [sh - ch, max(1, ch - sih - 6), sih, ch, sh];\n },\n updateTop = (h) => {\n if (!bar.parentNode) return;\n const [ds, db] = getGeo(h),\n st = max(0, min(ct[scroll_pos], ds));\n if (pre_st != -1 && pre_st != st) {\n bar.style.opacity = 1;\n clearTimeout(timer_bar);\n timer_bar = setTimeout(() => (bar.style.opacity = 0), 1e3);\n }\n pre_st = st;\n si.style[style_pos] = 3 + round((db * st) / ds) + PX;\n },\n onDown = (e) => {\n if (ptr_unbind) return;\n const bd = D.body;\n bd.setPointerCapture(e.pointerId);\n bd.classList.add(DRAG);\n bar.part.add(DRAG);\n let pre = e[client_pos];\n const detach = () => {\n bd.classList.remove(DRAG);\n bar.part.remove(DRAG);\n un_ptr();\n ptr_unbind = null;\n },\n un_ptr = On(bd, {\n pointermove: (e) => {\n const [ds, db] = getGeo();\n ct[scroll_pos] += round((ds * (e[client_pos] - pre)) / db);\n pre = e[client_pos];\n },\n pointerup: detach,\n lostpointercapture: detach,\n });\n ptr_unbind = detach;\n },\n onClick = (e) => {\n const rect = bar.getBoundingClientRect(),\n top = rect[style_pos],\n [ds, db, sih] = getGeo();\n ct[scroll_pos] = round(ds * max(min((e[client_pos] - top - 3 - sih / 2) / db, 1), 0));\n onDown(e);\n },\n unbind = [\n On(bar, { pointerdown: onClick }),\n On(si, {\n pointerdown: (e) => {\n e.stopPropagation();\n onDown(e);\n },\n }),\n On(ct, { scroll: updateTop.bind(null, undefined) }),\n ],\n ob = new ResizeObserver(() => {\n clearTimeout(timer_resize);\n timer_resize = setTimeout(() => {\n const [, , , ch, sh] = getGeo(),\n is_turn = ch < sh;\n if (is_turn) {\n if (bar.parentNode != ct) ct.appendChild(bar);\n const h = max(16, round((ch * ch) / sh));\n si.style[style_size] = h + PX;\n updateTop(h);\n } else if (bar.parentNode) {\n bar.remove();\n }\n }, 200);\n }),\n destroy = () => {\n clearTimeout(timer_bar);\n clearTimeout(timer_resize);\n unbind.forEach((f) => f());\n if (ptr_unbind) ptr_unbind();\n ob.disconnect();\n if (bar.parentNode) bar.remove();\n };\n bar.style.opacity = 0;\n [ct, m].forEach((i) => ob.observe(i));\n return destroy;\n };\n };\n\n [\n [\"v\", \"Height\", \"Top\", \"Y\", \"flex-direction:column;width:100%;min-height:100%\"],\n [\"h\", \"Width\", \"Left\", \"X\", \"min-width:100%;width:max-content;height:100%\"],\n ].map(([prefix, size, pos, axis, css]) => {\n const initScroll = mkScroll(size, pos, axis);\n customElements.define(\n prefix + \"-scroll\",\n class extends HTMLElement {\n connectedCallback() {\n const content = mk(\"b\", \"\", mk(\"slot\")),\n wrapper = mk(\"b\", \"scroll\", content);\n content.style.cssText = \"display:flex;\" + css;\n this.attachShadow({ mode: \"open\" }).appendChild(wrapper);\n this._unbind = initScroll(wrapper);\n }\n disconnectedCallback() {\n this._unbind?.();\n }\n },\n );\n });\n})();\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "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",
|
|
8
|
-
"debugId": "5DD6B8D33029FF4A64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/Wait._.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.wait,.ing{position:relative}.wait:before,.ing:before{background:var(--waitSvg) 50% 50%/64px no-repeat;content:"";cursor:wait;z-index:999;animation-name:fadeIn;animation-duration:1s;position:absolute;inset:0}.ing:before{background-color:#fff9}.wait{align-self:center;width:64px;height:64px;display:flex}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}
|
package/Wait._.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":null,"mappings":"AAAA,6BAIA,mLAcA,mCAGA,4DAMA","sources":["Users/z/git/webc-zh/lib/Wait._.css"],"sourcesContent":[".wait,\n.ing {\n position: relative;\n}\n.wait:before,\n.ing:before {\n animation-duration: 1s;\n animation-name: fadeIn;\n background: var(--waitSvg) 50% 50%/64px no-repeat;\n bottom: 0;\n content: '';\n cursor: wait;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 999;\n}\n.ing:before {\n background-color: rgba(255,255,255,0.6);\n}\n.wait {\n align-self: center;\n display: flex;\n height: 64px;\n width: 64px;\n}\n@-moz-keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@-webkit-keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@-o-keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n"],"names":[]}
|
package/Wait.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--waitSvg:url(./svg/-oloHJiPWtJPJs8g_0WIaA.svg)}.wait,.ing{position:relative}.wait:before,.ing:before{background:var(--waitSvg) 50% 50%/64px no-repeat;content:"";cursor:wait;z-index:999;animation-name:fadeIn;animation-duration:1s;position:absolute;inset:0}.ing:before{background-color:#fff9}.wait{align-self:center;width:64px;height:64px;display:flex}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}
|
package/Wait.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":null,"mappings":"AAAA,sDAGA,6BAIA,mLAcA,mCAGA,4DAMA","sources":["Users/z/git/webc-zh/lib/Wait.css"],"sourcesContent":[":root {\n --waitSvg: url(\"./svg/-oloHJiPWtJPJs8g_0WIaA.svg\");\n}\n.wait,\n.ing {\n position: relative;\n}\n.wait:before,\n.ing:before {\n animation-duration: 1s;\n animation-name: fadeIn;\n background: var(--waitSvg) 50% 50%/64px no-repeat;\n bottom: 0;\n content: '';\n cursor: wait;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 999;\n}\n.ing:before {\n background-color: rgba(255,255,255,0.6);\n}\n.wait {\n align-self: center;\n display: flex;\n height: 64px;\n width: 64px;\n}\n@-moz-keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@-webkit-keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@-o-keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n"],"names":[]}
|
package/x.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=(e,t)=>{let n,r;for(n in t)r=t[n],e.addEventListener(n,r);return()=>{for(n in t)r=t[n],e.removeEventListener(n,r)}},t=document,n=t.body,r=t.createElement.bind(t);export{n as B,t as D,e as On,r as newEl};
|
package/x.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"x.js","names":[],"sources":["../../importmap/x/On.js","../../importmap/x/dom.js"],"sourcesContent":["export const On = (elem, dict) => {\n let event, func;\n for (event in dict) {\n func = dict[event];\n elem.addEventListener(event, func);\n }\n return () => {\n for (event in dict) {\n func = dict[event];\n elem.removeEventListener(event, func);\n }\n };\n};\n","export const D = document,\n B = D.body,\n newEl = D.createElement.bind(D);\n"],"mappings":"AAAA,MAAa,GAAM,EAAM,IAAS,CAChC,IAAI,EAAO,EACX,IAAK,KAAS,EACZ,EAAO,EAAK,GACZ,EAAK,iBAAiB,EAAO,CAAI,EAEnC,UAAa,CACX,IAAK,KAAS,EACZ,EAAO,EAAK,GACZ,EAAK,oBAAoB,EAAO,CAAI,CAExC,CACF,ECZa,EAAI,SACf,EAAI,EAAE,KACN,EAAQ,EAAE,cAAc,KAAK,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|