nanosplash 4.0.7 → 4.0.16
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/.github/workflows/bun-build.reusable.yml +32 -0
- package/.github/workflows/bun-lint.reusable.yml +32 -0
- package/.github/workflows/bun-npm-publish.reusable.yml +47 -0
- package/.github/workflows/bun-test.reusable.yml +43 -0
- package/.github/workflows/ci.yml +27 -0
- package/.github/workflows/release.yml +13 -0
- package/LICENSE +21 -0
- package/README.md +45 -50
- package/bun.lock +228 -366
- package/package.json +25 -26
- package/src/composables/ns.ts +3 -3
- package/src/iife.ts +7 -0
- package/tsconfig.json +5 -2
- package/{src/types → types}/global.d.ts +1 -1
- package/{src/interfaces/INSElement.ts → types/interfaces/INSElement.d.ts} +1 -1
- package/{src/interfaces/INanosplash.ts → types/interfaces/INanosplash.d.ts} +2 -2
- package/vite.config.ts +12 -0
- package/vitest.config.ts +14 -14
- package/.github/workflows/ci.all.yml +0 -32
- package/.github/workflows/ci.prod.pull_request.yml +0 -54
- package/.github/workflows/ci.prod.push.yml +0 -61
- package/.github/workflows/ci.test.yml +0 -56
- package/.github/workflows/reusable.build.yml +0 -42
- package/.github/workflows/reusable.format.yml +0 -55
- package/.github/workflows/reusable.lint.yml +0 -30
- package/.github/workflows/reusable.npm-publish.yml +0 -61
- package/.github/workflows/reusable.test.yml +0 -50
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -176
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/composables/index.html +0 -116
- package/coverage/lcov-report/src/composables/ns.ts.html +0 -547
- package/coverage/lcov-report/src/constants/index.html +0 -116
- package/coverage/lcov-report/src/constants/ns.ts.html +0 -124
- package/coverage/lcov-report/src/iife.ts.html +0 -100
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/src/interfaces/INSElement.ts.html +0 -100
- package/coverage/lcov-report/src/interfaces/INanosplash.ts.html +0 -304
- package/coverage/lcov-report/src/interfaces/index.html +0 -131
- package/coverage/lcov-report/src/utils/dom-utils.ts.html +0 -289
- package/coverage/lcov-report/src/utils/index.html +0 -116
- package/coverage/lcov.info +0 -271
- package/dist/cjs/ns.cjs.js +0 -135
- package/dist/es/ns.es.js +0 -197
- package/dist/iife/ns.iife.js +0 -135
- package/src/style/ns.min.css +0 -2
- /package/{src/types → types}/dom.d.ts +0 -0
- /package/{src/types → types}/generic/function.d.ts +0 -0
- /package/{src/types → types}/semantic/number.d.ts +0 -0
- /package/{src/types → types}/semantic/string.d.ts +0 -0
package/dist/cjs/ns.cjs.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=`@keyframes nsRotate {
|
|
2
|
-
100% {
|
|
3
|
-
transform: rotate(360deg);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@keyframes nsDash {
|
|
8
|
-
0% {
|
|
9
|
-
stroke-dasharray: 1, 150;
|
|
10
|
-
stroke-dashoffset: 0;
|
|
11
|
-
}
|
|
12
|
-
50% {
|
|
13
|
-
stroke-dasharray: 90, 150;
|
|
14
|
-
stroke-dashoffset: -35;
|
|
15
|
-
}
|
|
16
|
-
100% {
|
|
17
|
-
stroke-dasharray: 90, 150;
|
|
18
|
-
stroke-dashoffset: -124;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@keyframes nsFade {
|
|
23
|
-
from {
|
|
24
|
-
opacity: 0;
|
|
25
|
-
}
|
|
26
|
-
to {
|
|
27
|
-
opacity: 1;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@keyframes nsAscend {
|
|
32
|
-
from {
|
|
33
|
-
opacity: 0;
|
|
34
|
-
transform: translateY(13px);
|
|
35
|
-
}
|
|
36
|
-
to {
|
|
37
|
-
opacity: 1;
|
|
38
|
-
transform: translateY(0);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
:root {
|
|
43
|
-
--ns-top: 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Nanosplash host */
|
|
47
|
-
.nsh {
|
|
48
|
-
--color: DarkSlateGray;
|
|
49
|
-
--size: 20px;
|
|
50
|
-
--relSize: calc(var(--size) * 0.9);
|
|
51
|
-
--font: 'Inter', 'Helvetica', 'Arial';
|
|
52
|
-
--weight: 400;
|
|
53
|
-
--bg: rgba(255, 255, 255, 0.9);
|
|
54
|
-
--zIdx: 9999999999;
|
|
55
|
-
--blur: blur(5px);
|
|
56
|
-
|
|
57
|
-
position: relative;
|
|
58
|
-
z-index: var(--zIdx);
|
|
59
|
-
&::before {
|
|
60
|
-
width: 100%;
|
|
61
|
-
height: 100%;
|
|
62
|
-
bottom: 0; /* Not sure why */
|
|
63
|
-
right: 0; /* Not sure why */
|
|
64
|
-
position: absolute;
|
|
65
|
-
content: '';
|
|
66
|
-
background-color: var(--bg);
|
|
67
|
-
backdrop-filter: var(--blur);
|
|
68
|
-
-webkit-backdrop-filter: var(--blur);
|
|
69
|
-
z-index: calc(var(--zIdx) + 1);
|
|
70
|
-
border-radius: var(--size);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* For when the Nanosplash host is the document body */
|
|
75
|
-
body.nsh {
|
|
76
|
-
&,
|
|
77
|
-
&::before {
|
|
78
|
-
width: 100%;
|
|
79
|
-
height: 100%;
|
|
80
|
-
position: fixed;
|
|
81
|
-
top: var(--ns-top);
|
|
82
|
-
left: 0;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* Nanosplash main element */
|
|
87
|
-
.ns {
|
|
88
|
-
width: 100%;
|
|
89
|
-
height: 100%;
|
|
90
|
-
bottom: 0; /* Not sure why */
|
|
91
|
-
right: 0; /* Not sure why */
|
|
92
|
-
display: flex;
|
|
93
|
-
justify-content: center;
|
|
94
|
-
align-items: center;
|
|
95
|
-
position: absolute;
|
|
96
|
-
z-index: calc(var(--zIdx) + 2);
|
|
97
|
-
animation: nsFade 2s;
|
|
98
|
-
gap: var(--relSize);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/* Nanosplash text */
|
|
102
|
-
.nst {
|
|
103
|
-
color: var(--color);
|
|
104
|
-
font-size: var(--size);
|
|
105
|
-
font-family: var(--font), sans-serif;
|
|
106
|
-
font-weight: var(--weight);
|
|
107
|
-
max-width: 80dvw;
|
|
108
|
-
white-space: nowrap;
|
|
109
|
-
text-overflow: ellipsis;
|
|
110
|
-
overflow: hidden;
|
|
111
|
-
text-shadow: 0 0 0.06rem rgba(0, 0, 0, 0.25);
|
|
112
|
-
filter: drop-shadow(0 0 0.07rem rgba(0, 0, 0, 0.25));
|
|
113
|
-
animation: nsAscend 0.5s;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/* Nanosplash spinner */
|
|
117
|
-
.nss {
|
|
118
|
-
display: block;
|
|
119
|
-
width: var(--relSize);
|
|
120
|
-
height: var(--relSize);
|
|
121
|
-
animation: nsAscend 0.5s;
|
|
122
|
-
& > svg {
|
|
123
|
-
animation: nsRotate 2s linear infinite;
|
|
124
|
-
position: relative;
|
|
125
|
-
width: inherit;
|
|
126
|
-
height: inherit;
|
|
127
|
-
stroke-width: 8;
|
|
128
|
-
}
|
|
129
|
-
& .path {
|
|
130
|
-
stroke: var(--color);
|
|
131
|
-
stroke-linecap: round;
|
|
132
|
-
animation: nsDash 1.5s ease-in-out infinite;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
`,d=()=>globalThis.document,l=()=>globalThis.document.body,y=t=>Array.from(t),v=(t,o)=>y(t.querySelectorAll(o)),h=(t,o)=>v(t,o)[0]??null,I=t=>t instanceof Element?t:h(d(),t),c=(t,...o)=>{const a=d().createElement("div");return t&&a.classList.add(t),a.append(...o),a},m=t=>{const o=c();return o.innerHTML=t,o.firstChild},r={ns:"ns",nsHost:"nsh",nsText:"nst",nsSpinner:"nss"},u={ns:"."+r.ns,nsText:"."+r.nsText},A="4.0.5",E=()=>{const t=()=>v(d(),u.ns),o=()=>{const e=m('<svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none /></svg>'),s=c(r.ns,c(r.nsText),c(r.nsSpinner,e));return s.nsId=Date.now(),s},a=()=>t().sort((n,e)=>n.nsId-e.nsId),b=()=>a()[0]??null,g=(n,e)=>{var i;if((i=h(n,u.nsText))==null||i.remove(),!e)return;const s=c(r.nsText,e);n.insertBefore(s,n.firstChild)},w=(n,e)=>{const s=e.firstElementChild;s&&e.insertBefore(n,s),e.append(n),e.classList.add(r.nsHost)},x=n=>y(n.children).find(s=>s.classList.contains(r.ns)),k=(n,e)=>{const s=e?I(e)??l():l();let i;const p=x(s);if(p?i=p:(i=o(),w(i,s)),g(i,n??""),s===l()){const S=scrollY+"px";l().style.setProperty("--ns-top",S)}return i.nsId},f=n=>{var e;(e=n==null?void 0:n.parentElement)==null||e.classList.remove(r.nsHost),n==null||n.remove()},N=n=>t().find(e=>e.nsId===n)??null,z=n=>{n==="*"?t().forEach(f):f(typeof n=="number"?N(n):b())};return(()=>{var e;(e=h(d(),"#ns"))==null||e.remove();const n=m(`<style id="ns">${T}</style>`);l().append(n)})(),{show:k,hide:z,version:A}};exports.useNs=E;
|
package/dist/es/ns.es.js
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
const S = `@keyframes nsRotate {
|
|
2
|
-
100% {
|
|
3
|
-
transform: rotate(360deg);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@keyframes nsDash {
|
|
8
|
-
0% {
|
|
9
|
-
stroke-dasharray: 1, 150;
|
|
10
|
-
stroke-dashoffset: 0;
|
|
11
|
-
}
|
|
12
|
-
50% {
|
|
13
|
-
stroke-dasharray: 90, 150;
|
|
14
|
-
stroke-dashoffset: -35;
|
|
15
|
-
}
|
|
16
|
-
100% {
|
|
17
|
-
stroke-dasharray: 90, 150;
|
|
18
|
-
stroke-dashoffset: -124;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@keyframes nsFade {
|
|
23
|
-
from {
|
|
24
|
-
opacity: 0;
|
|
25
|
-
}
|
|
26
|
-
to {
|
|
27
|
-
opacity: 1;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@keyframes nsAscend {
|
|
32
|
-
from {
|
|
33
|
-
opacity: 0;
|
|
34
|
-
transform: translateY(13px);
|
|
35
|
-
}
|
|
36
|
-
to {
|
|
37
|
-
opacity: 1;
|
|
38
|
-
transform: translateY(0);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
:root {
|
|
43
|
-
--ns-top: 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Nanosplash host */
|
|
47
|
-
.nsh {
|
|
48
|
-
--color: DarkSlateGray;
|
|
49
|
-
--size: 20px;
|
|
50
|
-
--relSize: calc(var(--size) * 0.9);
|
|
51
|
-
--font: 'Inter', 'Helvetica', 'Arial';
|
|
52
|
-
--weight: 400;
|
|
53
|
-
--bg: rgba(255, 255, 255, 0.9);
|
|
54
|
-
--zIdx: 9999999999;
|
|
55
|
-
--blur: blur(5px);
|
|
56
|
-
|
|
57
|
-
position: relative;
|
|
58
|
-
z-index: var(--zIdx);
|
|
59
|
-
&::before {
|
|
60
|
-
width: 100%;
|
|
61
|
-
height: 100%;
|
|
62
|
-
bottom: 0; /* Not sure why */
|
|
63
|
-
right: 0; /* Not sure why */
|
|
64
|
-
position: absolute;
|
|
65
|
-
content: '';
|
|
66
|
-
background-color: var(--bg);
|
|
67
|
-
backdrop-filter: var(--blur);
|
|
68
|
-
-webkit-backdrop-filter: var(--blur);
|
|
69
|
-
z-index: calc(var(--zIdx) + 1);
|
|
70
|
-
border-radius: var(--size);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* For when the Nanosplash host is the document body */
|
|
75
|
-
body.nsh {
|
|
76
|
-
&,
|
|
77
|
-
&::before {
|
|
78
|
-
width: 100%;
|
|
79
|
-
height: 100%;
|
|
80
|
-
position: fixed;
|
|
81
|
-
top: var(--ns-top);
|
|
82
|
-
left: 0;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* Nanosplash main element */
|
|
87
|
-
.ns {
|
|
88
|
-
width: 100%;
|
|
89
|
-
height: 100%;
|
|
90
|
-
bottom: 0; /* Not sure why */
|
|
91
|
-
right: 0; /* Not sure why */
|
|
92
|
-
display: flex;
|
|
93
|
-
justify-content: center;
|
|
94
|
-
align-items: center;
|
|
95
|
-
position: absolute;
|
|
96
|
-
z-index: calc(var(--zIdx) + 2);
|
|
97
|
-
animation: nsFade 2s;
|
|
98
|
-
gap: var(--relSize);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/* Nanosplash text */
|
|
102
|
-
.nst {
|
|
103
|
-
color: var(--color);
|
|
104
|
-
font-size: var(--size);
|
|
105
|
-
font-family: var(--font), sans-serif;
|
|
106
|
-
font-weight: var(--weight);
|
|
107
|
-
max-width: 80dvw;
|
|
108
|
-
white-space: nowrap;
|
|
109
|
-
text-overflow: ellipsis;
|
|
110
|
-
overflow: hidden;
|
|
111
|
-
text-shadow: 0 0 0.06rem rgba(0, 0, 0, 0.25);
|
|
112
|
-
filter: drop-shadow(0 0 0.07rem rgba(0, 0, 0, 0.25));
|
|
113
|
-
animation: nsAscend 0.5s;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/* Nanosplash spinner */
|
|
117
|
-
.nss {
|
|
118
|
-
display: block;
|
|
119
|
-
width: var(--relSize);
|
|
120
|
-
height: var(--relSize);
|
|
121
|
-
animation: nsAscend 0.5s;
|
|
122
|
-
& > svg {
|
|
123
|
-
animation: nsRotate 2s linear infinite;
|
|
124
|
-
position: relative;
|
|
125
|
-
width: inherit;
|
|
126
|
-
height: inherit;
|
|
127
|
-
stroke-width: 8;
|
|
128
|
-
}
|
|
129
|
-
& .path {
|
|
130
|
-
stroke: var(--color);
|
|
131
|
-
stroke-linecap: round;
|
|
132
|
-
animation: nsDash 1.5s ease-in-out infinite;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
`, d = () => globalThis.document, l = () => globalThis.document.body, v = (t) => Array.from(t), u = (t, o) => v(t.querySelectorAll(o)), h = (t, o) => u(t, o)[0] ?? null, T = (t) => t instanceof Element ? t : h(d(), t), c = (t, ...o) => {
|
|
136
|
-
const a = d().createElement("div");
|
|
137
|
-
return t && a.classList.add(t), a.append(...o), a;
|
|
138
|
-
}, m = (t) => {
|
|
139
|
-
const o = c();
|
|
140
|
-
return o.innerHTML = t, o.firstChild;
|
|
141
|
-
}, r = {
|
|
142
|
-
ns: "ns",
|
|
143
|
-
nsHost: "nsh",
|
|
144
|
-
nsText: "nst",
|
|
145
|
-
nsSpinner: "nss"
|
|
146
|
-
}, y = {
|
|
147
|
-
ns: "." + r.ns,
|
|
148
|
-
nsText: "." + r.nsText
|
|
149
|
-
}, A = "4.0.5", H = () => {
|
|
150
|
-
const t = () => u(d(), y.ns), o = () => {
|
|
151
|
-
const e = m('<svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none /></svg>'), s = c(
|
|
152
|
-
r.ns,
|
|
153
|
-
c(r.nsText),
|
|
154
|
-
c(r.nsSpinner, e)
|
|
155
|
-
);
|
|
156
|
-
return s.nsId = Date.now(), s;
|
|
157
|
-
}, a = () => t().sort((n, e) => n.nsId - e.nsId), b = () => a()[0] ?? null, g = (n, e) => {
|
|
158
|
-
var i;
|
|
159
|
-
if ((i = h(n, y.nsText)) == null || i.remove(), !e) return;
|
|
160
|
-
const s = c(r.nsText, e);
|
|
161
|
-
n.insertBefore(s, n.firstChild);
|
|
162
|
-
}, w = (n, e) => {
|
|
163
|
-
const s = e.firstElementChild;
|
|
164
|
-
s && e.insertBefore(n, s), e.append(n), e.classList.add(r.nsHost);
|
|
165
|
-
}, x = (n) => v(n.children).find(
|
|
166
|
-
(s) => s.classList.contains(r.ns)
|
|
167
|
-
), k = (n, e) => {
|
|
168
|
-
const s = e ? T(e) ?? l() : l();
|
|
169
|
-
let i;
|
|
170
|
-
const p = x(s);
|
|
171
|
-
if (p ? i = p : (i = o(), w(i, s)), g(i, n ?? ""), s === l()) {
|
|
172
|
-
const I = scrollY + "px";
|
|
173
|
-
l().style.setProperty("--ns-top", I);
|
|
174
|
-
}
|
|
175
|
-
return i.nsId;
|
|
176
|
-
}, f = (n) => {
|
|
177
|
-
var e;
|
|
178
|
-
(e = n == null ? void 0 : n.parentElement) == null || e.classList.remove(r.nsHost), n == null || n.remove();
|
|
179
|
-
}, N = (n) => t().find((e) => e.nsId === n) ?? null, z = (n) => {
|
|
180
|
-
n === "*" ? t().forEach(f) : f(typeof n == "number" ? N(n) : b());
|
|
181
|
-
};
|
|
182
|
-
return (() => {
|
|
183
|
-
var e;
|
|
184
|
-
(e = h(d(), "#ns")) == null || e.remove();
|
|
185
|
-
const n = m(
|
|
186
|
-
`<style id="ns">${S}</style>`
|
|
187
|
-
);
|
|
188
|
-
l().append(n);
|
|
189
|
-
})(), {
|
|
190
|
-
show: k,
|
|
191
|
-
hide: z,
|
|
192
|
-
version: A
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
export {
|
|
196
|
-
H as useNs
|
|
197
|
-
};
|
package/dist/iife/ns.iife.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";const w=`@keyframes nsRotate {
|
|
2
|
-
100% {
|
|
3
|
-
transform: rotate(360deg);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@keyframes nsDash {
|
|
8
|
-
0% {
|
|
9
|
-
stroke-dasharray: 1, 150;
|
|
10
|
-
stroke-dashoffset: 0;
|
|
11
|
-
}
|
|
12
|
-
50% {
|
|
13
|
-
stroke-dasharray: 90, 150;
|
|
14
|
-
stroke-dashoffset: -35;
|
|
15
|
-
}
|
|
16
|
-
100% {
|
|
17
|
-
stroke-dasharray: 90, 150;
|
|
18
|
-
stroke-dashoffset: -124;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@keyframes nsFade {
|
|
23
|
-
from {
|
|
24
|
-
opacity: 0;
|
|
25
|
-
}
|
|
26
|
-
to {
|
|
27
|
-
opacity: 1;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@keyframes nsAscend {
|
|
32
|
-
from {
|
|
33
|
-
opacity: 0;
|
|
34
|
-
transform: translateY(13px);
|
|
35
|
-
}
|
|
36
|
-
to {
|
|
37
|
-
opacity: 1;
|
|
38
|
-
transform: translateY(0);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
:root {
|
|
43
|
-
--ns-top: 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Nanosplash host */
|
|
47
|
-
.nsh {
|
|
48
|
-
--color: DarkSlateGray;
|
|
49
|
-
--size: 20px;
|
|
50
|
-
--relSize: calc(var(--size) * 0.9);
|
|
51
|
-
--font: 'Inter', 'Helvetica', 'Arial';
|
|
52
|
-
--weight: 400;
|
|
53
|
-
--bg: rgba(255, 255, 255, 0.9);
|
|
54
|
-
--zIdx: 9999999999;
|
|
55
|
-
--blur: blur(5px);
|
|
56
|
-
|
|
57
|
-
position: relative;
|
|
58
|
-
z-index: var(--zIdx);
|
|
59
|
-
&::before {
|
|
60
|
-
width: 100%;
|
|
61
|
-
height: 100%;
|
|
62
|
-
bottom: 0; /* Not sure why */
|
|
63
|
-
right: 0; /* Not sure why */
|
|
64
|
-
position: absolute;
|
|
65
|
-
content: '';
|
|
66
|
-
background-color: var(--bg);
|
|
67
|
-
backdrop-filter: var(--blur);
|
|
68
|
-
-webkit-backdrop-filter: var(--blur);
|
|
69
|
-
z-index: calc(var(--zIdx) + 1);
|
|
70
|
-
border-radius: var(--size);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* For when the Nanosplash host is the document body */
|
|
75
|
-
body.nsh {
|
|
76
|
-
&,
|
|
77
|
-
&::before {
|
|
78
|
-
width: 100%;
|
|
79
|
-
height: 100%;
|
|
80
|
-
position: fixed;
|
|
81
|
-
top: var(--ns-top);
|
|
82
|
-
left: 0;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* Nanosplash main element */
|
|
87
|
-
.ns {
|
|
88
|
-
width: 100%;
|
|
89
|
-
height: 100%;
|
|
90
|
-
bottom: 0; /* Not sure why */
|
|
91
|
-
right: 0; /* Not sure why */
|
|
92
|
-
display: flex;
|
|
93
|
-
justify-content: center;
|
|
94
|
-
align-items: center;
|
|
95
|
-
position: absolute;
|
|
96
|
-
z-index: calc(var(--zIdx) + 2);
|
|
97
|
-
animation: nsFade 2s;
|
|
98
|
-
gap: var(--relSize);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/* Nanosplash text */
|
|
102
|
-
.nst {
|
|
103
|
-
color: var(--color);
|
|
104
|
-
font-size: var(--size);
|
|
105
|
-
font-family: var(--font), sans-serif;
|
|
106
|
-
font-weight: var(--weight);
|
|
107
|
-
max-width: 80dvw;
|
|
108
|
-
white-space: nowrap;
|
|
109
|
-
text-overflow: ellipsis;
|
|
110
|
-
overflow: hidden;
|
|
111
|
-
text-shadow: 0 0 0.06rem rgba(0, 0, 0, 0.25);
|
|
112
|
-
filter: drop-shadow(0 0 0.07rem rgba(0, 0, 0, 0.25));
|
|
113
|
-
animation: nsAscend 0.5s;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/* Nanosplash spinner */
|
|
117
|
-
.nss {
|
|
118
|
-
display: block;
|
|
119
|
-
width: var(--relSize);
|
|
120
|
-
height: var(--relSize);
|
|
121
|
-
animation: nsAscend 0.5s;
|
|
122
|
-
& > svg {
|
|
123
|
-
animation: nsRotate 2s linear infinite;
|
|
124
|
-
position: relative;
|
|
125
|
-
width: inherit;
|
|
126
|
-
height: inherit;
|
|
127
|
-
stroke-width: 8;
|
|
128
|
-
}
|
|
129
|
-
& .path {
|
|
130
|
-
stroke: var(--color);
|
|
131
|
-
stroke-linecap: round;
|
|
132
|
-
animation: nsDash 1.5s ease-in-out infinite;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
`,d=()=>globalThis.document,a=()=>globalThis.document.body,f=t=>Array.from(t),p=(t,o)=>f(t.querySelectorAll(o)),h=(t,o)=>p(t,o)[0]??null,b=t=>t instanceof Element?t:h(d(),t),l=(t,...o)=>{const c=d().createElement("div");return t&&c.classList.add(t),c.append(...o),c},m=t=>{const o=l();return o.innerHTML=t,o.firstChild},r={ns:"ns",nsHost:"nsh",nsText:"nst",nsSpinner:"nss"},u={ns:"."+r.ns,nsText:"."+r.nsText},g="4.0.5",x=()=>{const t=()=>p(d(),u.ns),o=()=>{const e=m('<svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none /></svg>'),s=l(r.ns,l(r.nsText),l(r.nsSpinner,e));return s.nsId=Date.now(),s},c=()=>t().sort((n,e)=>n.nsId-e.nsId),k=()=>c()[0]??null,N=(n,e)=>{var i;if((i=h(n,u.nsText))==null||i.remove(),!e)return;const s=l(r.nsText,e);n.insertBefore(s,n.firstChild)},z=(n,e)=>{const s=e.firstElementChild;s&&e.insertBefore(n,s),e.append(n),e.classList.add(r.nsHost)},I=n=>f(n.children).find(s=>s.classList.contains(r.ns)),S=(n,e)=>{const s=e?b(e)??a():a();let i;const y=I(s);if(y?i=y:(i=o(),z(i,s)),N(i,n??""),s===a()){const E=scrollY+"px";a().style.setProperty("--ns-top",E)}return i.nsId},v=n=>{var e;(e=n==null?void 0:n.parentElement)==null||e.classList.remove(r.nsHost),n==null||n.remove()},T=n=>t().find(e=>e.nsId===n)??null,A=n=>{n==="*"?t().forEach(v):v(typeof n=="number"?T(n):k())};return(()=>{var e;(e=h(d(),"#ns"))==null||e.remove();const n=m(`<style id="ns">${w}</style>`);a().append(n)})(),{show:S,hide:A,version:g}};window.addEventListener("load",function(){this.ns=x()})})();
|
package/src/style/ns.min.css
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
@keyframes nsRotate{to{transform:rotate(1turn)}}@keyframes nsDash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes nsFade{0%{opacity:0}to{opacity:1}}@keyframes nsAscend{0%{opacity:0;transform:translateY(13px)}to{opacity:1;transform:translateY(0)}}:root{--ns-top:0}.nsh{--color:#2f4f4f;--size:20px;--relSize:calc(var(--size)*0.9);--font:"Inter","Helvetica","Arial";--weight:400;--bg:hsla(0,0%,100%,.9);--zIdx:9999999999;--blur:blur(5px);position:relative;z-index:var(--zIdx);&:before{backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);background-color:var(--bg);border-radius:var(--size);bottom:0;content:"";height:100%;position:absolute;right:0;width:100%;z-index:calc(var(--zIdx) + 1)}}body.nsh{&,&:before{height:100%;left:0;position:fixed;top:var(--ns-top);width:100%}}.ns{align-items:center;animation:nsFade 2s;bottom:0;display:flex;gap:var(--relSize);height:100%;justify-content:center;position:absolute;right:0;width:100%;z-index:calc(var(--zIdx) + 2)}.nst{animation:nsAscend .5s;color:var(--color);filter:drop-shadow(0 0 .07rem rgba(0,0,0,.25));font-family:var(--font),sans-serif;font-size:var(--size);font-weight:var(--weight);max-width:80dvw;overflow:hidden;text-overflow:ellipsis;text-shadow:0 0 .06rem rgba(0,0,0,.25);white-space:nowrap}.nss{animation:nsAscend .5s;display:block;height:var(--relSize);width:var(--relSize);&>svg{animation:nsRotate 2s linear infinite;height:inherit;position:relative;width:inherit;stroke-width:8}& .path{stroke:var(--color);stroke-linecap:round;animation:nsDash 1.5s ease-in-out infinite}}
|
|
2
|
-
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5zLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxvQkFDRSxHQUNFLHVCQUNGLENBQ0YsQ0FFQSxrQkFDRSxHQUNFLHNCQUF3QixDQUN4QixtQkFDRixDQUNBLElBQ0UsdUJBQXlCLENBQ3pCLHFCQUNGLENBQ0EsR0FDRSx1QkFBeUIsQ0FDekIsc0JBQ0YsQ0FDRixDQUVBLGtCQUNFLEdBQ0UsU0FDRixDQUNBLEdBQ0UsU0FDRixDQUNGLENBRUEsb0JBQ0UsR0FDRSxTQUFVLENBQ1YsMEJBQ0YsQ0FDQSxHQUNFLFNBQVUsQ0FDVix1QkFDRixDQUNGLENBRUEsTUFDRSxVQUNGLENBR0EsS0FDRSxlQUFzQixDQUN0QixXQUFZLENBQ1osK0JBQWtDLENBQ2xDLGtDQUFxQyxDQUNyQyxZQUFhLENBQ2IsdUJBQThCLENBQzlCLGlCQUFrQixDQUNsQixnQkFBaUIsQ0FFakIsaUJBQWtCLENBQ2xCLG1CQUFvQixDQUNwQixTQVFFLDJCQUE0QixDQUM1QixtQ0FBb0MsQ0FGcEMsMEJBQTJCLENBSTNCLHlCQUEwQixDQVIxQixRQUFTLENBR1QsVUFBVyxDQUpYLFdBQVksQ0FHWixpQkFBa0IsQ0FEbEIsT0FBUSxDQUhSLFVBQVcsQ0FTWCw2QkFFRixDQUNGLENBR0EsU0FDRSxXQUdFLFdBQVksQ0FHWixNQUFPLENBRlAsY0FBZSxDQUNmLGlCQUFrQixDQUhsQixVQUtGLENBQ0YsQ0FHQSxJQU9FLGtCQUFtQixDQUduQixtQkFBb0IsQ0FQcEIsUUFBUyxDQUVULFlBQWEsQ0FNYixrQkFBbUIsQ0FUbkIsV0FBWSxDQ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4gIHRleHQtc2hhZG93OiAwIDAgMC4wNnJlbSByZ2JhKDAsIDAsIDAsIDAuMjUpO1xuICBmaWx0ZXI6IGRyb3Atc2hhZG93KDAgMCAwLjA3cmVtIHJnYmEoMCwgMCwgMCwgMC4yNSkpO1xuICBhbmltYXRpb246IG5zQXNjZW5kIDAuNXM7XG59XG5cbi8qIE5hbm9zcGxhc2ggc3Bpbm5lciAqL1xuLm5zcyB7XG4gIGRpc3BsYXk6IGJsb2NrO1xuICB3aWR0aDogdmFyKC0tcmVsU2l6ZSk7XG4gIGhlaWdodDogdmFyKC0tcmVsU2l6ZSk7XG4gIGFuaW1hdGlvbjogbnNBc2NlbmQgMC41cztcbiAgJiA+IHN2ZyB7XG4gICAgYW5pbWF0aW9uOiBuc1JvdGF0ZSAycyBsaW5lYXIgaW5maW5pdGU7XG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgIHdpZHRoOiBpbmhlcml0O1xuICAgIGhlaWdodDogaW5oZXJpdDtcbiAgICBzdHJva2Utd2lkdGg6IDg7XG4gIH1cbiAgJiAucGF0aCB7XG4gICAgc3Ryb2tlOiB2YXIoLS1jb2xvcik7XG4gICAgc3Ryb2tlLWxpbmVjYXA6IHJvdW5kO1xuICAgIGFuaW1hdGlvbjogbnNEYXNoIDEuNXMgZWFzZS1pbi1vdXQgaW5maW5pdGU7XG4gIH1cbn1cbiJdfQ== */
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|