nanosplash 4.0.18 → 4.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -129
- package/dist/cjs/ns.cjs.js +1 -1
- package/dist/es/ns.es.js +20 -22
- package/dist/iife/ns.iife.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,145 +7,27 @@
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
### Nanosplash is a 3KB zero-dependency library for effortless loading screens. Its 2-function API lets you add fullscreen or container-based spinners in seconds, fully customizable with CSS. Fast, beautiful, and simple.
|
|
11
|
-
|
|
12
10
|
```js
|
|
13
|
-
//
|
|
14
|
-
show('Loading')
|
|
11
|
+
// Fullscreen
|
|
12
|
+
ns.show('Loading')
|
|
15
13
|
|
|
16
|
-
//
|
|
17
|
-
show('Loading', '#my-div')
|
|
14
|
+
// Specific element
|
|
15
|
+
ns.show('Loading', '#my-div')
|
|
18
16
|
|
|
19
|
-
// Hide
|
|
20
|
-
hide()
|
|
17
|
+
// Hide
|
|
18
|
+
ns.hide()
|
|
21
19
|
```
|
|
22
20
|
|
|
23
|
-
## Features
|
|
24
|
-
|
|
25
|
-
- **Tiny**: Only 3KB
|
|
26
|
-
- **Performance**: Created to be fast.
|
|
27
|
-
- **Zero dependencies**: Pure JS.
|
|
28
|
-
- **Beautiful**: Good and generic design.
|
|
29
|
-
- **Modules**: Supports ESM, CJS, and IIFE.
|
|
30
|
-
- **TypeScript support**: Fully typed.
|
|
31
|
-
- **2 Function API**: Easy to use.
|
|
32
|
-
|
|
33
21
|
## Installation
|
|
34
|
-
|
|
35
|
-
Include Nanosplash in your project via your preferred method (e.g., CDN, module bundler). Example:
|
|
36
|
-
|
|
37
|
-
```html
|
|
38
|
-
<script src="https://unpkg.com/nanosplash/dist/iife/ns.iife.js"></script>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
or
|
|
42
|
-
|
|
22
|
+
Add to your project and get the typing and docs.
|
|
43
23
|
```bash
|
|
44
24
|
npm install nanosplash
|
|
45
25
|
```
|
|
46
26
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### Show
|
|
50
|
-
|
|
51
|
-
The show function displays a Nanosplash loading indicator on your page.
|
|
52
|
-
You can pass in optional text to display with the spinner, and an optional target element (or CSS selector) to control where it appears.
|
|
53
|
-
If no target is provided, Nanosplash will create a fullscreen splash covering the entire viewport.
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
show(text?: string, target?: string | Element): number
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
#### Examples:
|
|
60
|
-
|
|
61
|
-
**Fullscreen spinner only:**
|
|
62
|
-
|
|
63
|
-
```js
|
|
64
|
-
ns.show()
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**Fullscreen text and spinner:**
|
|
68
|
-
|
|
69
|
-
```js
|
|
70
|
-
ns.show('Loading...')
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**Spinner only within a specific element:**
|
|
74
|
-
|
|
75
|
-
```js
|
|
76
|
-
ns.show(null, '#my-div')
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
**Text and spinner within a specific element:**
|
|
80
|
-
|
|
81
|
-
```js
|
|
82
|
-
ns.show('Please wait', '#my-div')
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Hide
|
|
86
|
-
|
|
87
|
-
The hide function removes one or more Nanosplash loading indicators from your page.
|
|
88
|
-
By default, it removes the oldest fullscreen splash (FIFO). If you want to remove a specific splash, you can pass its ID (returned by show).
|
|
89
|
-
You can also remove all splashes at once by passing the wildcard '*'.
|
|
90
|
-
|
|
91
|
-
```ts
|
|
92
|
-
hide(id?: number | '*'): void
|
|
93
|
-
```
|
|
94
|
-
#### Examples:
|
|
95
|
-
|
|
96
|
-
**Remove the oldest (FIFO) fullscreen Nanosplash:**
|
|
97
|
-
|
|
98
|
-
```js
|
|
99
|
-
ns.hide()
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**Remove a specific Nanosplash by ID:**
|
|
103
|
-
|
|
104
|
-
```js
|
|
105
|
-
const id = ns.show() // 1700000000000
|
|
106
|
-
ns.hide(id)
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**Remove all Nanosplashes:**
|
|
110
|
-
|
|
111
|
-
```js
|
|
112
|
-
ns.hide('*')
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Customization
|
|
116
|
-
|
|
117
|
-
Nanosplash is designed to be fully customizable with CSS. You can style its key parts using these selectors:
|
|
118
|
-
|
|
119
|
-
| Selector | Description |
|
|
120
|
-
|------------------|------------------------------------------|
|
|
121
|
-
| `.nsh::before` | Backdrop |
|
|
122
|
-
| `.ns` | Main wrapper for the splash |
|
|
123
|
-
| `.nst` | Text element |
|
|
124
|
-
| `.nss` | Spinner element |
|
|
125
|
-
|
|
126
|
-
## Examples
|
|
127
|
-
|
|
128
|
-
Here’s a quick snippet to show a loading indicator while fetching data:
|
|
129
|
-
|
|
27
|
+
Or add the script tag to your HTML.
|
|
130
28
|
```html
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
<script>
|
|
134
|
-
// Show a splash while loading
|
|
135
|
-
ns.show('Fetching data...', '#my-div')
|
|
136
|
-
|
|
137
|
-
fetch('/api/data')
|
|
138
|
-
.then(res => res.json())
|
|
139
|
-
.then(data => {
|
|
140
|
-
// Process data
|
|
141
|
-
})
|
|
142
|
-
.finally(() => {
|
|
143
|
-
// Hide splash
|
|
144
|
-
ns.hide()
|
|
145
|
-
})
|
|
146
|
-
</script>
|
|
29
|
+
<script src="https://unpkg.com/nanosplash/dist/iife/ns.iife.js"></script>
|
|
147
30
|
```
|
|
148
31
|
|
|
149
|
-
##
|
|
150
|
-
|
|
151
|
-
Found a bug or have a feature request? Visit the [GitHub repository](https://github.com/isakhauge/nanosplash) and open an issue or pull request!
|
|
32
|
+
## Documentation
|
|
33
|
+
[Read the full docs here](./docs.md)
|
package/dist/cjs/ns.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I='@keyframes nsRotate{to{transform:rotate(360deg)}}@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: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Inter", "Helvetica", "Arial";--weight: 400;--bg: rgba(255, 255, 255, .9);--zIdx: 9999999999;--blur: blur(5px);position:relative;z-index:var(--zIdx)}.nsh:before{width:100%;height:100%;bottom:0;right:0;position:absolute;content:"";background-color:var(--bg);backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh,body.nsh:before{width:100%;height:100%;position:fixed;top:var(--ns-top);left:0}.ns{width:100%;height:100%;bottom:0;right:0;display:flex;justify-content:center;align-items:center;position:absolute;z-index:calc(var(--zIdx) + 2);animation:nsFade 2s;gap:var(--relSize)}.nst{color:var(--color);font-size:var(--size);font-family:var(--font),sans-serif;font-weight:var(--weight);max-width:80dvw;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-shadow:0 0 .06rem rgba(0,0,0,.25);filter:drop-shadow(0 0 .07rem rgba(0,0,0,.25));animation:nsAscend .5s}.nss{display:block;width:var(--relSize);height:var(--relSize);animation:nsAscend .5s}.nss>svg{animation:nsRotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:nsDash 1.5s ease-in-out infinite}',d=()=>globalThis.document,l=()=>globalThis.document.body,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I='@keyframes nsRotate{to{transform:rotate(360deg)}}@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: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Inter", "Helvetica", "Arial";--weight: 400;--bg: rgba(255, 255, 255, .9);--zIdx: 9999999999;--blur: blur(5px);position:relative;z-index:var(--zIdx)}.nsh:before{width:100%;height:100%;bottom:0;right:0;position:absolute;content:"";background-color:var(--bg);backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh,body.nsh:before{width:100%;height:100%;position:fixed;top:var(--ns-top);left:0}.ns{width:100%;height:100%;bottom:0;right:0;display:flex;justify-content:center;align-items:center;position:absolute;z-index:calc(var(--zIdx) + 2);animation:nsFade 2s;gap:var(--relSize)}.nst{color:var(--color);font-size:var(--size);font-family:var(--font),sans-serif;font-weight:var(--weight);max-width:80dvw;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-shadow:0 0 .06rem rgba(0,0,0,.25);filter:drop-shadow(0 0 .07rem rgba(0,0,0,.25));animation:nsAscend .5s}.nss{display:block;width:var(--relSize);height:var(--relSize);animation:nsAscend .5s}.nss>svg{animation:nsRotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:nsDash 1.5s ease-in-out infinite}',d=()=>globalThis.document,l=()=>globalThis.document.body,u=s=>Array.from(s),y=(s,o)=>u(s.querySelectorAll(o)),f=(s,o)=>y(s,o)[0]??null,N=s=>s instanceof Element?s:f(d(),s),c=(s,...o)=>{const i=d().createElement("div");return s&&i.classList.add(s),i.append(...o),i},m=s=>{const o=c();return o.innerHTML=s,o.firstChild},r={ns:"ns",nsHost:"nsh",nsText:"nst",nsSpinner:"nss"},v={ns:"."+r.ns,nsText:"."+r.nsText},A="4.0.20",E=()=>{const s=()=>y(d(),v.ns),o=()=>{const t=m('<svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none /></svg>'),n=c(r.ns,c(r.nsText),c(r.nsSpinner,t));return n.nsId=Date.now(),n},i=()=>s().sort((e,t)=>e.nsId-t.nsId),b=()=>i()[0]??null,g=(e,t)=>{if(f(e,v.nsText)?.remove(),!t)return;const n=c(r.nsText,t);e.insertBefore(n,e.firstChild)},x=(e,t)=>{const n=t.firstElementChild;n?t.insertBefore(e,n):t.append(e),t.classList.add(r.nsHost)},w=e=>u(e.children).find(n=>n.classList.contains(r.ns)),k=(e,t)=>{const n=t?N(t)??l():l();let a;const p=w(n);if(p?a=p:(a=o(),x(a,n)),g(a,e??""),n===l()){const T=scrollY+"px";l().style.setProperty("--ns-top",T)}return a.nsId},h=e=>{e&&(e.parentElement?.classList.remove(r.nsHost),e.remove())},z=e=>s().find(t=>t.nsId===e)??null,S=e=>{e==="*"?s().forEach(h):h(typeof e=="number"?z(e):b())};return(()=>{f(d(),"#ns")?.remove();const e=m(`<style id="ns">${I}</style>`);l().append(e)})(),{show:k,hide:S,version:A}};exports.useNs=E;
|
package/dist/es/ns.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const T = '@keyframes nsRotate{to{transform:rotate(360deg)}}@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: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Inter", "Helvetica", "Arial";--weight: 400;--bg: rgba(255, 255, 255, .9);--zIdx: 9999999999;--blur: blur(5px);position:relative;z-index:var(--zIdx)}.nsh:before{width:100%;height:100%;bottom:0;right:0;position:absolute;content:"";background-color:var(--bg);backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh,body.nsh:before{width:100%;height:100%;position:fixed;top:var(--ns-top);left:0}.ns{width:100%;height:100%;bottom:0;right:0;display:flex;justify-content:center;align-items:center;position:absolute;z-index:calc(var(--zIdx) + 2);animation:nsFade 2s;gap:var(--relSize)}.nst{color:var(--color);font-size:var(--size);font-family:var(--font),sans-serif;font-weight:var(--weight);max-width:80dvw;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-shadow:0 0 .06rem rgba(0,0,0,.25);filter:drop-shadow(0 0 .07rem rgba(0,0,0,.25));animation:nsAscend .5s}.nss{display:block;width:var(--relSize);height:var(--relSize);animation:nsAscend .5s}.nss>svg{animation:nsRotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:nsDash 1.5s ease-in-out infinite}', d = () => globalThis.document, l = () => globalThis.document.body, y = (
|
|
1
|
+
const T = '@keyframes nsRotate{to{transform:rotate(360deg)}}@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: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Inter", "Helvetica", "Arial";--weight: 400;--bg: rgba(255, 255, 255, .9);--zIdx: 9999999999;--blur: blur(5px);position:relative;z-index:var(--zIdx)}.nsh:before{width:100%;height:100%;bottom:0;right:0;position:absolute;content:"";background-color:var(--bg);backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh,body.nsh:before{width:100%;height:100%;position:fixed;top:var(--ns-top);left:0}.ns{width:100%;height:100%;bottom:0;right:0;display:flex;justify-content:center;align-items:center;position:absolute;z-index:calc(var(--zIdx) + 2);animation:nsFade 2s;gap:var(--relSize)}.nst{color:var(--color);font-size:var(--size);font-family:var(--font),sans-serif;font-weight:var(--weight);max-width:80dvw;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-shadow:0 0 .06rem rgba(0,0,0,.25);filter:drop-shadow(0 0 .07rem rgba(0,0,0,.25));animation:nsAscend .5s}.nss{display:block;width:var(--relSize);height:var(--relSize);animation:nsAscend .5s}.nss>svg{animation:nsRotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:nsDash 1.5s ease-in-out infinite}', d = () => globalThis.document, l = () => globalThis.document.body, y = (s) => Array.from(s), u = (s, o) => y(s.querySelectorAll(o)), f = (s, o) => u(s, o)[0] ?? null, A = (s) => s instanceof Element ? s : f(d(), s), c = (s, ...o) => {
|
|
2
2
|
const i = d().createElement("div");
|
|
3
|
-
return
|
|
4
|
-
}, m = (
|
|
3
|
+
return s && i.classList.add(s), i.append(...o), i;
|
|
4
|
+
}, m = (s) => {
|
|
5
5
|
const o = c();
|
|
6
|
-
return o.innerHTML =
|
|
6
|
+
return o.innerHTML = s, o.firstChild;
|
|
7
7
|
}, r = {
|
|
8
8
|
ns: "ns",
|
|
9
9
|
nsHost: "nsh",
|
|
@@ -12,43 +12,41 @@ const T = '@keyframes nsRotate{to{transform:rotate(360deg)}}@keyframes nsDash{0%
|
|
|
12
12
|
}, v = {
|
|
13
13
|
ns: "." + r.ns,
|
|
14
14
|
nsText: "." + r.nsText
|
|
15
|
-
}, N = "4.0.
|
|
16
|
-
const
|
|
15
|
+
}, N = "4.0.20", H = () => {
|
|
16
|
+
const s = () => u(d(), v.ns), o = () => {
|
|
17
17
|
const t = m('<svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none /></svg>'), n = c(
|
|
18
18
|
r.ns,
|
|
19
19
|
c(r.nsText),
|
|
20
20
|
c(r.nsSpinner, t)
|
|
21
21
|
);
|
|
22
22
|
return n.nsId = Date.now(), n;
|
|
23
|
-
}, i = () =>
|
|
24
|
-
if (
|
|
23
|
+
}, i = () => s().sort((e, t) => e.nsId - t.nsId), b = () => i()[0] ?? null, g = (e, t) => {
|
|
24
|
+
if (f(e, v.nsText)?.remove(), !t) return;
|
|
25
25
|
const n = c(r.nsText, t);
|
|
26
|
-
|
|
27
|
-
}, x = (
|
|
26
|
+
e.insertBefore(n, e.firstChild);
|
|
27
|
+
}, x = (e, t) => {
|
|
28
28
|
const n = t.firstElementChild;
|
|
29
|
-
n
|
|
30
|
-
}, w = (
|
|
31
|
-
(n) => n.classList.contains(r.ns)
|
|
32
|
-
), k = (s, t) => {
|
|
29
|
+
n ? t.insertBefore(e, n) : t.append(e), t.classList.add(r.nsHost);
|
|
30
|
+
}, w = (e) => y(e.children).find((n) => n.classList.contains(r.ns)), k = (e, t) => {
|
|
33
31
|
const n = t ? A(t) ?? l() : l();
|
|
34
32
|
let a;
|
|
35
33
|
const p = w(n);
|
|
36
|
-
if (p ? a = p : (a = o(), x(a, n)), g(a,
|
|
34
|
+
if (p ? a = p : (a = o(), x(a, n)), g(a, e ?? ""), n === l()) {
|
|
37
35
|
const S = scrollY + "px";
|
|
38
36
|
l().style.setProperty("--ns-top", S);
|
|
39
37
|
}
|
|
40
38
|
return a.nsId;
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
}, z = (
|
|
44
|
-
|
|
39
|
+
}, h = (e) => {
|
|
40
|
+
e && (e.parentElement?.classList.remove(r.nsHost), e.remove());
|
|
41
|
+
}, z = (e) => s().find((t) => t.nsId === e) ?? null, I = (e) => {
|
|
42
|
+
e === "*" ? s().forEach(h) : h(typeof e == "number" ? z(e) : b());
|
|
45
43
|
};
|
|
46
44
|
return (() => {
|
|
47
|
-
|
|
48
|
-
const
|
|
45
|
+
f(d(), "#ns")?.remove();
|
|
46
|
+
const e = m(
|
|
49
47
|
`<style id="ns">${T}</style>`
|
|
50
48
|
);
|
|
51
|
-
l().append(
|
|
49
|
+
l().append(e);
|
|
52
50
|
})(), {
|
|
53
51
|
show: k,
|
|
54
52
|
hide: I,
|
package/dist/iife/ns.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const b='@keyframes nsRotate{to{transform:rotate(360deg)}}@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: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Inter", "Helvetica", "Arial";--weight: 400;--bg: rgba(255, 255, 255, .9);--zIdx: 9999999999;--blur: blur(5px);position:relative;z-index:var(--zIdx)}.nsh:before{width:100%;height:100%;bottom:0;right:0;position:absolute;content:"";background-color:var(--bg);backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh,body.nsh:before{width:100%;height:100%;position:fixed;top:var(--ns-top);left:0}.ns{width:100%;height:100%;bottom:0;right:0;display:flex;justify-content:center;align-items:center;position:absolute;z-index:calc(var(--zIdx) + 2);animation:nsFade 2s;gap:var(--relSize)}.nst{color:var(--color);font-size:var(--size);font-family:var(--font),sans-serif;font-weight:var(--weight);max-width:80dvw;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-shadow:0 0 .06rem rgba(0,0,0,.25);filter:drop-shadow(0 0 .07rem rgba(0,0,0,.25));animation:nsAscend .5s}.nss{display:block;width:var(--relSize);height:var(--relSize);animation:nsAscend .5s}.nss>svg{animation:nsRotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:nsDash 1.5s ease-in-out infinite}',d=()=>globalThis.document,i=()=>globalThis.document.body,
|
|
1
|
+
(function(){"use strict";const b='@keyframes nsRotate{to{transform:rotate(360deg)}}@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: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Inter", "Helvetica", "Arial";--weight: 400;--bg: rgba(255, 255, 255, .9);--zIdx: 9999999999;--blur: blur(5px);position:relative;z-index:var(--zIdx)}.nsh:before{width:100%;height:100%;bottom:0;right:0;position:absolute;content:"";background-color:var(--bg);backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh,body.nsh:before{width:100%;height:100%;position:fixed;top:var(--ns-top);left:0}.ns{width:100%;height:100%;bottom:0;right:0;display:flex;justify-content:center;align-items:center;position:absolute;z-index:calc(var(--zIdx) + 2);animation:nsFade 2s;gap:var(--relSize)}.nst{color:var(--color);font-size:var(--size);font-family:var(--font),sans-serif;font-weight:var(--weight);max-width:80dvw;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-shadow:0 0 .06rem rgba(0,0,0,.25);filter:drop-shadow(0 0 .07rem rgba(0,0,0,.25));animation:nsAscend .5s}.nss{display:block;width:var(--relSize);height:var(--relSize);animation:nsAscend .5s}.nss>svg{animation:nsRotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:nsDash 1.5s ease-in-out infinite}',d=()=>globalThis.document,i=()=>globalThis.document.body,p=s=>Array.from(s),v=(s,o)=>p(s.querySelectorAll(o)),h=(s,o)=>v(s,o)[0]??null,g=s=>s instanceof Element?s:h(d(),s),a=(s,...o)=>{const l=d().createElement("div");return s&&l.classList.add(s),l.append(...o),l},m=s=>{const o=a();return o.innerHTML=s,o.firstChild},r={ns:"ns",nsHost:"nsh",nsText:"nst",nsSpinner:"nss"},u={ns:"."+r.ns,nsText:"."+r.nsText},x="4.0.20",w=()=>{const s=()=>v(d(),u.ns),o=()=>{const t=m('<svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none /></svg>'),n=a(r.ns,a(r.nsText),a(r.nsSpinner,t));return n.nsId=Date.now(),n},l=()=>s().sort((e,t)=>e.nsId-t.nsId),k=()=>l()[0]??null,z=(e,t)=>{if(h(e,u.nsText)?.remove(),!t)return;const n=a(r.nsText,t);e.insertBefore(n,e.firstChild)},I=(e,t)=>{const n=t.firstElementChild;n?t.insertBefore(e,n):t.append(e),t.classList.add(r.nsHost)},S=e=>p(e.children).find(n=>n.classList.contains(r.ns)),T=(e,t)=>{const n=t?g(t)??i():i();let c;const y=S(n);if(y?c=y:(c=o(),I(c,n)),z(c,e??""),n===i()){const E=scrollY+"px";i().style.setProperty("--ns-top",E)}return c.nsId},f=e=>{e&&(e.parentElement?.classList.remove(r.nsHost),e.remove())},A=e=>s().find(t=>t.nsId===e)??null,N=e=>{e==="*"?s().forEach(f):f(typeof e=="number"?A(e):k())};return(()=>{h(d(),"#ns")?.remove();const e=m(`<style id="ns">${b}</style>`);i().append(e)})(),{show:T,hide:N,version:x}};window.addEventListener("load",function(){this.ns=w()})})();
|