@firecms/neat 0.2.2 → 0.4.0
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/dist/NeatGradient.d.ts +16 -0
- package/dist/NeatGradient.js +128 -34
- package/dist/NeatGradient.js.map +1 -1
- package/dist/index.es.js +185 -107
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +68 -32
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/NeatGradient.ts +147 -34
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
const
|
|
3
|
-
class
|
|
1
|
+
import * as i from "three";
|
|
2
|
+
const _ = 50, g = 80, W = !0, S = 5, X = new i.Clock(), R = ee();
|
|
3
|
+
class oe {
|
|
4
4
|
_ref;
|
|
5
5
|
_speed = -1;
|
|
6
6
|
_horizontalPressure = -1;
|
|
@@ -12,6 +12,10 @@ class X {
|
|
|
12
12
|
_highlights = -1;
|
|
13
13
|
_saturation = -1;
|
|
14
14
|
_brightness = -1;
|
|
15
|
+
_grainScale = -1;
|
|
16
|
+
_grainIntensity = -1;
|
|
17
|
+
_grainSparsity = -1;
|
|
18
|
+
_grainSpeed = -1;
|
|
15
19
|
_colorBlending = -1;
|
|
16
20
|
_colors = [];
|
|
17
21
|
_wireframe = !1;
|
|
@@ -20,56 +24,70 @@ class X {
|
|
|
20
24
|
requestRef = -1;
|
|
21
25
|
sizeObserver;
|
|
22
26
|
sceneState;
|
|
27
|
+
_yOffset = 0;
|
|
23
28
|
constructor(e) {
|
|
24
29
|
const {
|
|
25
30
|
ref: o,
|
|
26
|
-
speed:
|
|
27
|
-
horizontalPressure:
|
|
31
|
+
speed: n = 4,
|
|
32
|
+
horizontalPressure: s = 3,
|
|
28
33
|
verticalPressure: a = 3,
|
|
29
34
|
waveFrequencyX: c = 5,
|
|
30
|
-
waveFrequencyY:
|
|
31
|
-
waveAmplitude:
|
|
35
|
+
waveFrequencyY: v = 5,
|
|
36
|
+
waveAmplitude: f = 3,
|
|
32
37
|
colors: l,
|
|
33
|
-
highlights:
|
|
34
|
-
shadows:
|
|
38
|
+
highlights: u = 4,
|
|
39
|
+
shadows: h = 4,
|
|
35
40
|
colorSaturation: p = 0,
|
|
36
41
|
colorBrightness: w = 1,
|
|
37
|
-
colorBlending:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
colorBlending: z = 5,
|
|
43
|
+
grainScale: E = 2,
|
|
44
|
+
grainIntensity: B = 0.55,
|
|
45
|
+
grainSparsity: D = 0,
|
|
46
|
+
grainSpeed: k = 0.1,
|
|
47
|
+
wireframe: K = !1,
|
|
48
|
+
backgroundColor: L = "#FFFFFF",
|
|
49
|
+
backgroundAlpha: U = 1,
|
|
50
|
+
resolution: V = 1,
|
|
51
|
+
seed: C,
|
|
52
|
+
yOffset: G = 0
|
|
43
53
|
} = e;
|
|
44
|
-
this._ref = o, this.destroy = this.destroy.bind(this), this._initScene = this._initScene.bind(this), this._buildMaterial = this._buildMaterial.bind(this), this.speed =
|
|
45
|
-
let
|
|
46
|
-
const
|
|
47
|
-
const { renderer:
|
|
48
|
-
Math.floor(
|
|
49
|
-
const
|
|
50
|
-
...this._colors.map((P) =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
this._ref = o, this.destroy = this.destroy.bind(this), this._initScene = this._initScene.bind(this), this._buildMaterial = this._buildMaterial.bind(this), this.speed = n, this.horizontalPressure = s, this.verticalPressure = a, this.waveFrequencyX = c, this.waveFrequencyY = v, this.waveAmplitude = f, this.colorBlending = z, this.grainScale = E, this.grainIntensity = B, this.grainSparsity = D, this.grainSpeed = k, this.colors = l, this.shadows = h, this.highlights = u, this.colorSaturation = p, this.colorBrightness = w, this.wireframe = K, this.backgroundColor = L, this.backgroundAlpha = U, this.yOffset = G, this.sceneState = this._initScene(V);
|
|
55
|
+
let b = C !== void 0 ? C : $();
|
|
56
|
+
const q = () => {
|
|
57
|
+
const { renderer: d, camera: m, scene: y, meshes: x } = this.sceneState;
|
|
58
|
+
Math.floor(b * 10) % 5 === 0 && Z(o), d.setClearColor(this._backgroundColor, this._backgroundAlpha), x.forEach((r) => {
|
|
59
|
+
const j = this._ref.width, Y = this._ref.height, H = [
|
|
60
|
+
...this._colors.map((P) => {
|
|
61
|
+
let F = new i.Color();
|
|
62
|
+
return F.setStyle(P.color, ""), {
|
|
63
|
+
is_active: P.enabled,
|
|
64
|
+
color: F,
|
|
65
|
+
influence: P.influence
|
|
66
|
+
};
|
|
67
|
+
}),
|
|
68
|
+
...Array.from({ length: S - this._colors.length }).map(() => ({
|
|
56
69
|
is_active: !1,
|
|
57
|
-
color: new
|
|
70
|
+
color: new i.Color(0)
|
|
58
71
|
}))
|
|
59
72
|
];
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
},
|
|
63
|
-
const { renderer:
|
|
64
|
-
this.sceneState.renderer.setSize(
|
|
73
|
+
b += X.getDelta() * this._speed, r.material.uniforms.u_time.value = b, r.material.uniforms.u_resolution = { value: new i.Vector2(j, Y) }, r.material.uniforms.u_color_pressure = { value: new i.Vector2(this._horizontalPressure, this._verticalPressure) }, r.material.uniforms.u_wave_frequency_x = { value: this._waveFrequencyX }, r.material.uniforms.u_wave_frequency_y = { value: this._waveFrequencyY }, r.material.uniforms.u_wave_amplitude = { value: this._waveAmplitude }, r.material.uniforms.u_plane_width = { value: _ }, r.material.uniforms.u_plane_height = { value: g }, r.material.uniforms.u_color_blending = { value: this._colorBlending }, r.material.uniforms.u_colors = { value: H }, r.material.uniforms.u_colors_count = { value: S }, r.material.uniforms.u_shadows = { value: this._shadows }, r.material.uniforms.u_highlights = { value: this._highlights }, r.material.uniforms.u_saturation = { value: this._saturation }, r.material.uniforms.u_brightness = { value: this._brightness }, r.material.uniforms.u_grain_intensity = { value: this._grainIntensity }, r.material.uniforms.u_grain_sparsity = { value: this._grainSparsity }, r.material.uniforms.u_grain_speed = { value: this._grainSpeed }, r.material.uniforms.u_grain_scale = { value: this._grainScale }, r.material.uniforms.u_y_offset = { value: this._yOffset }, r.material.wireframe = this._wireframe;
|
|
74
|
+
}), d.render(y, m), this.requestRef = requestAnimationFrame(q);
|
|
75
|
+
}, T = () => {
|
|
76
|
+
const { renderer: d } = this.sceneState, m = d.domElement, y = m.clientWidth, x = m.clientHeight;
|
|
77
|
+
this.sceneState.renderer.setSize(y, x, !1), A(this.sceneState.camera, y, x);
|
|
65
78
|
};
|
|
66
|
-
this.sizeObserver = new ResizeObserver((
|
|
67
|
-
|
|
68
|
-
}), this.sizeObserver.observe(o),
|
|
79
|
+
this.sizeObserver = new ResizeObserver((d) => {
|
|
80
|
+
T();
|
|
81
|
+
}), this.sizeObserver.observe(o), q();
|
|
69
82
|
}
|
|
70
83
|
destroy() {
|
|
71
84
|
this && (cancelAnimationFrame(this.requestRef), this.sizeObserver.disconnect());
|
|
72
85
|
}
|
|
86
|
+
downloadAsPNG(e = "neat.png") {
|
|
87
|
+
console.log("Downloading as PNG", this._ref);
|
|
88
|
+
const o = this._ref.toDataURL("image/png");
|
|
89
|
+
console.log("data", o), te(o, e);
|
|
90
|
+
}
|
|
73
91
|
set speed(e) {
|
|
74
92
|
this._speed = e / 20;
|
|
75
93
|
}
|
|
@@ -106,6 +124,18 @@ class X {
|
|
|
106
124
|
set colorBlending(e) {
|
|
107
125
|
this._colorBlending = e / 10;
|
|
108
126
|
}
|
|
127
|
+
set grainScale(e) {
|
|
128
|
+
this._grainScale = e == 0 ? 1 : e;
|
|
129
|
+
}
|
|
130
|
+
set grainIntensity(e) {
|
|
131
|
+
this._grainIntensity = e;
|
|
132
|
+
}
|
|
133
|
+
set grainSparsity(e) {
|
|
134
|
+
this._grainSparsity = e;
|
|
135
|
+
}
|
|
136
|
+
set grainSpeed(e) {
|
|
137
|
+
this._grainSpeed = e;
|
|
138
|
+
}
|
|
109
139
|
set wireframe(e) {
|
|
110
140
|
this._wireframe = e;
|
|
111
141
|
}
|
|
@@ -118,60 +148,68 @@ class X {
|
|
|
118
148
|
set backgroundAlpha(e) {
|
|
119
149
|
this._backgroundAlpha = e;
|
|
120
150
|
}
|
|
151
|
+
set yOffset(e) {
|
|
152
|
+
this._yOffset = e;
|
|
153
|
+
}
|
|
121
154
|
_initScene(e) {
|
|
122
|
-
const o = this._ref.width,
|
|
155
|
+
const o = this._ref.width, n = this._ref.height, s = new i.WebGLRenderer({
|
|
123
156
|
alpha: !0,
|
|
157
|
+
preserveDrawingBuffer: !0,
|
|
124
158
|
canvas: this._ref
|
|
125
159
|
});
|
|
126
|
-
|
|
127
|
-
const a = [], c = new
|
|
160
|
+
s.setClearColor(16711680, 0.5), s.setSize(o, n, !1);
|
|
161
|
+
const a = [], c = new i.Scene(), v = this._buildMaterial(o, n), f = new i.PlaneGeometry(_, g, 240 * e, 240 * e), l = new i.Mesh(f, v);
|
|
128
162
|
l.rotation.x = -Math.PI / 3.5, l.position.z = -1, a.push(l), c.add(l);
|
|
129
|
-
const
|
|
130
|
-
return
|
|
131
|
-
renderer:
|
|
132
|
-
camera:
|
|
163
|
+
const u = new i.OrthographicCamera(0, 0, 0, 0, 0, 0);
|
|
164
|
+
return u.position.z = 5, A(u, o, n), {
|
|
165
|
+
renderer: s,
|
|
166
|
+
camera: u,
|
|
133
167
|
scene: c,
|
|
134
168
|
meshes: a,
|
|
135
169
|
resolution: e
|
|
136
170
|
};
|
|
137
171
|
}
|
|
138
172
|
_buildMaterial(e, o) {
|
|
139
|
-
const
|
|
173
|
+
const n = [
|
|
140
174
|
...this._colors.map((c) => ({
|
|
141
175
|
is_active: c.enabled,
|
|
142
|
-
color: new
|
|
176
|
+
color: new i.Color(c.color),
|
|
143
177
|
influence: c.influence
|
|
144
178
|
})),
|
|
145
|
-
...Array.from({ length:
|
|
179
|
+
...Array.from({ length: S - this._colors.length }).map(() => ({
|
|
146
180
|
is_active: !1,
|
|
147
|
-
color: new
|
|
181
|
+
color: new i.Color(0)
|
|
148
182
|
}))
|
|
149
|
-
],
|
|
183
|
+
], s = {
|
|
150
184
|
u_time: { value: 0 },
|
|
151
|
-
u_color_pressure: { value: new
|
|
185
|
+
u_color_pressure: { value: new i.Vector2(this._horizontalPressure, this._verticalPressure) },
|
|
152
186
|
u_wave_frequency_x: { value: this._waveFrequencyX },
|
|
153
187
|
u_wave_frequency_y: { value: this._waveFrequencyY },
|
|
154
188
|
u_wave_amplitude: { value: this._waveAmplitude },
|
|
155
|
-
u_resolution: { value: new
|
|
156
|
-
u_colors: { value:
|
|
189
|
+
u_resolution: { value: new i.Vector2(e, o) },
|
|
190
|
+
u_colors: { value: n },
|
|
157
191
|
u_colors_count: { value: this._colors.length },
|
|
158
|
-
u_plane_width: { value:
|
|
159
|
-
u_plane_height: { value:
|
|
192
|
+
u_plane_width: { value: _ },
|
|
193
|
+
u_plane_height: { value: g },
|
|
160
194
|
u_shadows: { value: this._shadows },
|
|
161
|
-
u_highlights: { value: this._highlights }
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
195
|
+
u_highlights: { value: this._highlights },
|
|
196
|
+
u_grain_intensity: { value: this._grainIntensity },
|
|
197
|
+
u_grain_sparsity: { value: this._grainSparsity },
|
|
198
|
+
u_grain_scale: { value: this._grainScale },
|
|
199
|
+
u_grain_speed: { value: this._grainSpeed }
|
|
200
|
+
}, a = new i.ShaderMaterial({
|
|
201
|
+
uniforms: s,
|
|
202
|
+
vertexShader: I() + M() + O() + J(),
|
|
203
|
+
fragmentShader: I() + O() + M() + Q()
|
|
166
204
|
});
|
|
167
|
-
return a.wireframe =
|
|
205
|
+
return a.wireframe = W, a;
|
|
168
206
|
}
|
|
169
207
|
}
|
|
170
|
-
function
|
|
171
|
-
const a = e * o / 1e6 *
|
|
172
|
-
t instanceof
|
|
208
|
+
function A(t, e, o) {
|
|
209
|
+
const a = e * o / 1e6 * _ * g / 1.5, c = e / o, v = Math.sqrt(a * c), f = a / v, l = -_ / 2, u = Math.min((l + v) / 1.5, _ / 2), h = g / 4, p = Math.max((h - f) / 2, -g / 4), w = -100, z = 1e3;
|
|
210
|
+
t instanceof i.OrthographicCamera ? (t.left = l, t.right = u, t.top = h, t.bottom = p, t.near = w, t.far = z, t.updateProjectionMatrix()) : t instanceof i.PerspectiveCamera && (t.aspect = e / o, t.updateProjectionMatrix());
|
|
173
211
|
}
|
|
174
|
-
function
|
|
212
|
+
function J() {
|
|
175
213
|
return `
|
|
176
214
|
|
|
177
215
|
void main() {
|
|
@@ -183,71 +221,101 @@ void main() {
|
|
|
183
221
|
u_wave_frequency_y * position.y + u_time,
|
|
184
222
|
u_time
|
|
185
223
|
));
|
|
186
|
-
|
|
224
|
+
|
|
187
225
|
vec3 color;
|
|
188
226
|
|
|
189
227
|
// float t = mod(u_base_color, 100.0);
|
|
190
228
|
color = u_colors[0].color;
|
|
191
|
-
|
|
229
|
+
|
|
230
|
+
// Apply y_offset to the noise coordinates
|
|
192
231
|
vec2 noise_cord = vUv * u_color_pressure;
|
|
193
|
-
|
|
232
|
+
// Apply the y-offset to shift the pattern vertically (1:1 pixel ratio)
|
|
233
|
+
// Scale the offset to match the UV coordinate space
|
|
234
|
+
float scaledOffset = u_y_offset / u_resolution.y;
|
|
235
|
+
noise_cord.y -= scaledOffset;
|
|
236
|
+
|
|
194
237
|
const float minNoise = .0;
|
|
195
238
|
const float maxNoise = .9;
|
|
196
|
-
|
|
239
|
+
|
|
197
240
|
for (int i = 1; i < u_colors_count; i++) {
|
|
198
|
-
|
|
241
|
+
|
|
199
242
|
if(u_colors[i].is_active == 1.0){
|
|
200
243
|
float noiseFlow = (1. + float(i)) / 30.;
|
|
201
244
|
float noiseSpeed = (1. + float(i)) * 0.11;
|
|
202
245
|
float noiseSeed = 13. + float(i) * 7.;
|
|
203
|
-
|
|
246
|
+
|
|
247
|
+
int reverseIndex = u_colors_count - i;
|
|
248
|
+
|
|
204
249
|
float noise = snoise(
|
|
205
250
|
vec3(
|
|
206
251
|
noise_cord.x * u_color_pressure.x + u_time * noiseFlow * 2.,
|
|
207
252
|
noise_cord.y * u_color_pressure.y,
|
|
208
253
|
u_time * noiseSpeed
|
|
209
254
|
) + noiseSeed
|
|
210
|
-
);
|
|
211
|
-
|
|
255
|
+
) - (.1 * float(i)) + (.5 * u_color_blending);
|
|
256
|
+
|
|
212
257
|
noise = clamp(minNoise, maxNoise + float(i) * 0.02, noise);
|
|
213
258
|
vec3 nextColor = u_colors[i].color;
|
|
214
|
-
|
|
215
|
-
// vec3 colorOklab = oklab2rgb(color);
|
|
216
|
-
// vec3 nextColorOklab = oklab2rgb(nextColor);
|
|
217
|
-
// vec3 mixColor = mix(colorOklab, nextColorOklab, smoothstep(0.0, u_color_blending, noise));
|
|
218
|
-
//
|
|
219
|
-
// color = rgb2oklab(mixColor);
|
|
220
|
-
|
|
221
259
|
color = mix(color, nextColor, smoothstep(0.0, u_color_blending, noise));
|
|
222
260
|
}
|
|
223
|
-
|
|
224
261
|
}
|
|
225
|
-
|
|
262
|
+
|
|
226
263
|
v_color = color;
|
|
227
|
-
|
|
264
|
+
|
|
228
265
|
vec3 newPosition = position + normal * v_displacement_amount * u_wave_amplitude;
|
|
229
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(
|
|
230
|
-
|
|
266
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);
|
|
267
|
+
|
|
231
268
|
v_new_position = gl_Position;
|
|
232
269
|
}
|
|
233
270
|
`;
|
|
234
271
|
}
|
|
235
|
-
function
|
|
272
|
+
function Q() {
|
|
236
273
|
return `
|
|
274
|
+
float random(vec2 p) {
|
|
275
|
+
return fract(sin(dot(p, vec2(12.9898,78.233))) * 43758.5453);
|
|
276
|
+
}
|
|
237
277
|
|
|
238
|
-
|
|
278
|
+
float fbm(vec3 x) {
|
|
279
|
+
float value = 0.0;
|
|
280
|
+
float amplitude = 0.5;
|
|
281
|
+
float frequency = 1.0;
|
|
282
|
+
for (int i = 0; i < 4; i++) {
|
|
283
|
+
value += amplitude * snoise(x * frequency);
|
|
284
|
+
frequency *= 2.0;
|
|
285
|
+
amplitude *= 0.5;
|
|
286
|
+
}
|
|
287
|
+
return value;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
void main() {
|
|
239
291
|
vec3 color = v_color;
|
|
240
|
-
|
|
241
|
-
color
|
|
242
|
-
color.rgb -= pow(1.0 - v_displacement_amount, 2.0) * u_shadows;
|
|
292
|
+
color += pow(v_displacement_amount, 1.0) * u_highlights;
|
|
293
|
+
color -= pow(1.0 - v_displacement_amount, 2.0) * u_shadows;
|
|
243
294
|
color = saturation(color, 1.0 + u_saturation);
|
|
244
295
|
color = color * u_brightness;
|
|
245
|
-
|
|
246
|
-
|
|
296
|
+
|
|
297
|
+
// Generate grain using fbm
|
|
298
|
+
vec2 noiseCoords = gl_FragCoord.xy / u_grain_scale;
|
|
299
|
+
float grain = (u_grain_speed != 0.0) ? fbm(vec3(noiseCoords, u_time * u_grain_speed)) : fbm(vec3(noiseCoords, 0.0));
|
|
300
|
+
|
|
301
|
+
// Center the grain around zero
|
|
302
|
+
grain = grain * 0.5 + 0.5;
|
|
303
|
+
grain -= 0.5;
|
|
304
|
+
|
|
305
|
+
// Add sparsity control
|
|
306
|
+
grain = (grain > u_grain_sparsity) ? grain : 0.0;
|
|
307
|
+
|
|
308
|
+
// Apply grain intensity
|
|
309
|
+
grain *= u_grain_intensity;
|
|
310
|
+
|
|
311
|
+
// Add grain to color
|
|
312
|
+
color += vec3(grain);
|
|
313
|
+
|
|
314
|
+
gl_FragColor = vec4(color, 1.0);
|
|
247
315
|
}
|
|
248
|
-
`;
|
|
316
|
+
`;
|
|
249
317
|
}
|
|
250
|
-
const
|
|
318
|
+
const I = () => `
|
|
251
319
|
precision highp float;
|
|
252
320
|
|
|
253
321
|
struct Color {
|
|
@@ -256,6 +324,10 @@ struct Color {
|
|
|
256
324
|
float value;
|
|
257
325
|
};
|
|
258
326
|
|
|
327
|
+
uniform float u_grain_intensity;
|
|
328
|
+
uniform float u_grain_sparsity;
|
|
329
|
+
uniform float u_grain_scale;
|
|
330
|
+
uniform float u_grain_speed;
|
|
259
331
|
uniform float u_time;
|
|
260
332
|
|
|
261
333
|
uniform float u_wave_amplitude;
|
|
@@ -278,12 +350,14 @@ uniform int u_colors_count;
|
|
|
278
350
|
uniform Color u_colors[5];
|
|
279
351
|
uniform vec2 u_resolution;
|
|
280
352
|
|
|
353
|
+
uniform float u_y_offset;
|
|
354
|
+
|
|
281
355
|
varying vec2 vUv;
|
|
282
356
|
varying vec4 v_new_position;
|
|
283
357
|
varying vec3 v_color;
|
|
284
358
|
varying float v_displacement_amount;
|
|
285
359
|
|
|
286
|
-
`,
|
|
360
|
+
`, M = () => `
|
|
287
361
|
|
|
288
362
|
vec3 mod289(vec3 x)
|
|
289
363
|
{
|
|
@@ -493,7 +567,7 @@ vec3 rgb2oklab(vec3 oklab)
|
|
|
493
567
|
return m2 * (lms * lms * lms);
|
|
494
568
|
}
|
|
495
569
|
|
|
496
|
-
`,
|
|
570
|
+
`, O = () => `
|
|
497
571
|
|
|
498
572
|
vec3 saturation(vec3 rgb, float adjustment) {
|
|
499
573
|
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
|
|
@@ -536,34 +610,38 @@ vec3 hsv2rgb(vec3 c)
|
|
|
536
610
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
|
537
611
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
538
612
|
}
|
|
539
|
-
`,
|
|
540
|
-
t.id =
|
|
541
|
-
},
|
|
613
|
+
`, N = (t) => {
|
|
614
|
+
t.id = R, t.href = "https://neat.firecms.co", t.target = "_blank", t.style.position = "absolute", t.style.display = "block", t.style.bottom = "0", t.style.right = "0", t.style.padding = "10px", t.style.color = "#dcdcdc", t.style.opacity = "0.8", t.style.fontFamily = "sans-serif", t.style.fontSize = "16px", t.style.fontWeight = "bold", t.style.textDecoration = "none", t.style.zIndex = "10000", t.innerHTML = "NEAT";
|
|
615
|
+
}, Z = (t) => {
|
|
542
616
|
const e = t.parentElement?.getElementsByTagName("a");
|
|
543
617
|
if (e) {
|
|
544
|
-
for (let
|
|
545
|
-
if (e[
|
|
546
|
-
|
|
618
|
+
for (let n = 0; n < e.length; n++)
|
|
619
|
+
if (e[n].id === R) {
|
|
620
|
+
N(e[n]);
|
|
547
621
|
return;
|
|
548
622
|
}
|
|
549
623
|
}
|
|
550
624
|
const o = document.createElement("a");
|
|
551
|
-
|
|
625
|
+
N(o), t.parentElement?.appendChild(o);
|
|
552
626
|
};
|
|
553
|
-
function
|
|
627
|
+
function $() {
|
|
554
628
|
const t = new Date(), e = t.getMinutes(), o = t.getSeconds();
|
|
555
629
|
return e * 60 + o;
|
|
556
630
|
}
|
|
557
|
-
function
|
|
631
|
+
function ee(t = 6) {
|
|
558
632
|
const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
559
633
|
let o = "";
|
|
560
|
-
for (let
|
|
561
|
-
const
|
|
562
|
-
o += e.charAt(
|
|
634
|
+
for (let n = 0; n < t; n++) {
|
|
635
|
+
const s = Math.floor(Math.random() * e.length);
|
|
636
|
+
o += e.charAt(s);
|
|
563
637
|
}
|
|
564
638
|
return o;
|
|
565
639
|
}
|
|
640
|
+
function te(t, e) {
|
|
641
|
+
const o = document.createElement("a");
|
|
642
|
+
o.download = e, o.href = t, document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
643
|
+
}
|
|
566
644
|
export {
|
|
567
|
-
|
|
645
|
+
oe as NeatGradient
|
|
568
646
|
};
|
|
569
647
|
//# sourceMappingURL=index.es.js.map
|