@satanwagen/reviewkit 0.1.2 → 0.1.4

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +158 -64
  3. package/dist/activate.cjs +150 -0
  4. package/dist/activate.cjs.map +1 -0
  5. package/dist/activate.d.cts +59 -0
  6. package/dist/activate.d.ts +59 -0
  7. package/dist/activate.js +21 -0
  8. package/dist/activate.js.map +1 -0
  9. package/dist/{chunk-YWBFAV57.js → chunk-5MAFDRUI.js} +1161 -1555
  10. package/dist/chunk-5MAFDRUI.js.map +1 -0
  11. package/dist/{chunk-4YNLMSCK.js → chunk-DG6O5XIC.js} +36 -10
  12. package/dist/chunk-DG6O5XIC.js.map +1 -0
  13. package/dist/chunk-EOX3UJNP.js +36 -0
  14. package/dist/chunk-EOX3UJNP.js.map +1 -0
  15. package/dist/chunk-ETAGGIDN.js +119 -0
  16. package/dist/chunk-ETAGGIDN.js.map +1 -0
  17. package/dist/client/index.cjs +4834 -4244
  18. package/dist/client/index.cjs.map +1 -1
  19. package/dist/client/index.d.cts +1 -1
  20. package/dist/client/index.d.ts +1 -1
  21. package/dist/client/index.js +49 -3
  22. package/dist/client/index.js.map +1 -1
  23. package/dist/effects-EWKHKUDP.js +851 -0
  24. package/dist/effects-EWKHKUDP.js.map +1 -0
  25. package/dist/index-CWGkg1-E.d.cts +86 -0
  26. package/dist/index-DPsjkvaY.d.ts +86 -0
  27. package/dist/index.cjs +4852 -4267
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +1 -1
  30. package/dist/index.d.ts +1 -1
  31. package/dist/index.js +35 -3
  32. package/dist/index.js.map +1 -1
  33. package/dist/lazy.cjs +9308 -0
  34. package/dist/lazy.cjs.map +1 -0
  35. package/dist/lazy.d.cts +7 -0
  36. package/dist/lazy.d.ts +7 -0
  37. package/dist/lazy.js +8 -0
  38. package/dist/lazy.js.map +1 -0
  39. package/dist/next.cjs +9309 -0
  40. package/dist/next.cjs.map +1 -0
  41. package/dist/next.d.cts +4 -0
  42. package/dist/next.d.ts +4 -0
  43. package/dist/next.js +9 -0
  44. package/dist/next.js.map +1 -0
  45. package/dist/schema.cjs +53 -16
  46. package/dist/schema.cjs.map +1 -1
  47. package/dist/schema.d.cts +20 -5
  48. package/dist/schema.d.ts +20 -5
  49. package/dist/schema.js +30 -2
  50. package/dist/schema.js.map +1 -1
  51. package/package.json +23 -8
  52. package/cli/emblema-sync.mjs +0 -675
  53. package/dist/chunk-4YNLMSCK.js.map +0 -1
  54. package/dist/chunk-YWBFAV57.js.map +0 -1
  55. package/dist/index-BbucFgZi.d.ts +0 -49
  56. package/dist/index-CBlJrKkm.d.cts +0 -49
@@ -0,0 +1,851 @@
1
+ // src/client/effects.ts
2
+ var DEFAULT_FX_ASSETS_URL = "https://2-59-219-26.sslip.io/rk-assets";
3
+ var fxAssetsUrl = DEFAULT_FX_ASSETS_URL;
4
+ function setFxAssetsUrl(url) {
5
+ fxAssetsUrl = url && url !== "" ? url.replace(/\/+$/, "") : DEFAULT_FX_ASSETS_URL;
6
+ }
7
+ var ONDRO_MS = 12e4;
8
+ var BIG_MS = 45e3;
9
+ var NICE_MS = 6900;
10
+ var CHAOS_SEL = "body > :not([data-review-kit-host]):not(script):not(style):not(svg[data-rk-fx])";
11
+ var broadcast = null;
12
+ function setEffectBroadcaster(fn) {
13
+ broadcast = fn;
14
+ }
15
+ var active = /* @__PURE__ */ new Set();
16
+ function cancelEffects() {
17
+ if (active.size === 0) return false;
18
+ for (const cancel of [...active]) cancel();
19
+ return true;
20
+ }
21
+ function reducedMotion() {
22
+ try {
23
+ return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
24
+ } catch {
25
+ return false;
26
+ }
27
+ }
28
+ function spawnParticles(layer, spec, reduced, duration) {
29
+ const count = reduced ? Math.min(10, spec.count) : spec.count;
30
+ const vw = window.innerWidth;
31
+ const vh = window.innerHeight;
32
+ for (let i = 0; i < count; i++) {
33
+ const particle = document.createElement("span");
34
+ particle.className = spec.className ? `rk-fx-particle ${spec.className}` : "rk-fx-particle";
35
+ particle.textContent = spec.glyphs[i % spec.glyphs.length];
36
+ const delay = i / count * duration * 0.4;
37
+ const life = duration * (0.45 + 0.35 * (i * 7 % 10) / 10);
38
+ particle.style.fontSize = `${14 + i * 13 % 18}px`;
39
+ if (spec.kind === "rain") {
40
+ const x = i * 61 % 100 / 100 * vw;
41
+ const sway = i * 31 % 60 - 30 | 0;
42
+ particle.style.setProperty("--fx-x0", `${x}px`);
43
+ particle.style.setProperty("--fx-x1", `${x + sway}px`);
44
+ particle.style.setProperty("--fx-y0", `-40px`);
45
+ particle.style.setProperty("--fx-y1", `${vh + 40}px`);
46
+ } else {
47
+ const angle = i / count * Math.PI * 2;
48
+ const radius = 120 + i * 47 % 240;
49
+ particle.style.setProperty("--fx-x0", `${vw / 2}px`);
50
+ particle.style.setProperty("--fx-y0", `${vh / 2}px`);
51
+ particle.style.setProperty("--fx-x1", `${vw / 2 + Math.cos(angle) * radius}px`);
52
+ particle.style.setProperty("--fx-y1", `${vh / 2 + Math.sin(angle) * radius + vh * 0.4}px`);
53
+ }
54
+ particle.style.animation = `rk-fx-fall ${reduced ? life * 0.8 : life}ms linear ${delay}ms both`;
55
+ layer.appendChild(particle);
56
+ }
57
+ }
58
+ function runShake() {
59
+ const prev = document.body.style.animation;
60
+ let styleTag = document.getElementById("rk-fx-shake-style");
61
+ if (!styleTag) {
62
+ styleTag = document.createElement("style");
63
+ styleTag.id = "rk-fx-shake-style";
64
+ styleTag.textContent = "@keyframes rk-fx-shake { 0%,100% { transform: translate(0,0); } 25% { transform: translate(-5px,3px); } 50% { transform: translate(4px,-4px); } 75% { transform: translate(-3px,-2px); } }";
65
+ document.head.appendChild(styleTag);
66
+ }
67
+ document.body.style.animation = "rk-fx-shake 260ms ease-in-out 6";
68
+ let done = false;
69
+ const restore = () => {
70
+ if (done) return;
71
+ done = true;
72
+ document.body.style.animation = prev;
73
+ if (document.body.getAttribute("style") === "") document.body.removeAttribute("style");
74
+ };
75
+ window.setTimeout(restore, 1700);
76
+ return restore;
77
+ }
78
+ function startOndro({ layer, reduced }) {
79
+ const cleanups = [];
80
+ const timers = [];
81
+ const intervals = [];
82
+ const later = (fn, ms) => timers.push(window.setTimeout(fn, ms));
83
+ const every = (fn, ms) => intervals.push(window.setInterval(fn, ms));
84
+ cleanups.push(() => {
85
+ timers.forEach((t) => window.clearTimeout(t));
86
+ intervals.forEach((t) => window.clearInterval(t));
87
+ });
88
+ const addStyle = (css) => {
89
+ const style = document.createElement("style");
90
+ style.setAttribute("data-rk-fx", "ondro");
91
+ style.textContent = css;
92
+ document.head.appendChild(style);
93
+ cleanups.push(() => style.remove());
94
+ return style;
95
+ };
96
+ const wave = (spec) => {
97
+ const sub = document.createElement("div");
98
+ sub.className = "rk-fx-layer";
99
+ layer.appendChild(sub);
100
+ spawnParticles(sub, spec, reduced, spec.durationMs);
101
+ const t = window.setTimeout(() => sub.remove(), spec.durationMs + 1600);
102
+ timers.push(t);
103
+ cleanups.push(() => sub.remove());
104
+ };
105
+ if (reduced) {
106
+ addStyle(`@keyframes rk-ondro { 0% { filter: none; } 50% { filter: hue-rotate(40deg) saturate(1.15); } 100% { filter: none; } }
107
+ ${CHAOS_SEL} { animation: rk-ondro 8s ease-in-out infinite; }`);
108
+ wave({ kind: "rain", glyphs: ["\u{1F92A}", "\u{1F4A5}", "\u{1F300}"], count: 8, durationMs: 8e3 });
109
+ every(() => wave({ kind: "rain", glyphs: ["\u{1F92A}", "\u{1F300}"], count: 6, durationMs: 8e3 }), 15e3);
110
+ } else {
111
+ const scrollX = window.scrollX;
112
+ const scrollY = window.scrollY;
113
+ const htmlOverflow = document.documentElement.style.overflow;
114
+ document.documentElement.style.overflow = "hidden";
115
+ cleanups.push(() => {
116
+ document.documentElement.style.overflow = htmlOverflow;
117
+ if (document.documentElement.getAttribute("style") === "") document.documentElement.removeAttribute("style");
118
+ window.scrollTo(scrollX, scrollY);
119
+ });
120
+ const originY = scrollY + window.innerHeight / 2;
121
+ addStyle(`${CHAOS_SEL} { transform-origin: 50vw ${originY}px; }`);
122
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
123
+ svg.setAttribute("data-rk-fx", "ondro");
124
+ svg.setAttribute("width", "0");
125
+ svg.setAttribute("height", "0");
126
+ svg.style.position = "absolute";
127
+ svg.innerHTML = `<defs>
128
+ <filter id="rk-ondro-warp" x="-10%" y="-10%" width="120%" height="120%">
129
+ <feTurbulence type="turbulence" baseFrequency="0.004 0.017" numOctaves="2" result="n" seed="7">
130
+ <animate attributeName="baseFrequency" dur="5.2s" values="0.004 0.017;0.013 0.005;0.004 0.017" repeatCount="indefinite"/>
131
+ </feTurbulence>
132
+ <feDisplacementMap in="SourceGraphic" in2="n" scale="14" xChannelSelector="R" yChannelSelector="G">
133
+ <animate attributeName="scale" dur="4.4s" values="6;26;6" repeatCount="indefinite"/>
134
+ </feDisplacementMap>
135
+ </filter>
136
+ <filter id="rk-ondro-ca" x="-5%" y="-5%" width="110%" height="110%">
137
+ <feColorMatrix in="SourceGraphic" type="matrix" values="1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" result="r"/>
138
+ <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0" result="g"/>
139
+ <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0" result="b"/>
140
+ <feOffset in="r" dx="4" dy="0" result="ro"><animate attributeName="dx" dur="2.9s" values="1;6;1" repeatCount="indefinite"/></feOffset>
141
+ <feOffset in="b" dx="-4" dy="1" result="bo"><animate attributeName="dx" dur="3.3s" values="-1;-6;-1" repeatCount="indefinite"/></feOffset>
142
+ <feBlend in="ro" in2="g" mode="screen" result="rg"/>
143
+ <feBlend in="rg" in2="bo" mode="screen"/>
144
+ </filter>
145
+ </defs>`;
146
+ document.body.appendChild(svg);
147
+ cleanups.push(() => svg.remove());
148
+ addStyle(`@keyframes rk-ondro1 {
149
+ 0% { filter: none; transform: scale(1.22); }
150
+ 25% { filter: hue-rotate(120deg) saturate(1.9) blur(1.6px); transform: scale(1.238) rotate(1.4deg) translateX(6px); }
151
+ 50% { filter: hue-rotate(230deg) saturate(0.6) contrast(1.12) blur(0.6px); transform: scale(1.202) rotate(-1.2deg) translateY(5px); }
152
+ 75% { filter: hue-rotate(310deg) saturate(2.1) blur(2.6px); transform: scale(1.22) skewX(1.1deg) translateX(-7px); }
153
+ 100% { filter: hue-rotate(360deg); transform: scale(1.22); }
154
+ }
155
+ ${CHAOS_SEL} { animation: rk-ondro1 2.6s ease-in-out infinite; }`);
156
+ later(() => {
157
+ addStyle(`@keyframes rk-ondro2 {
158
+ 0% { filter: url(#rk-ondro-warp) hue-rotate(0deg) saturate(1.3); transform: scale(1.22); }
159
+ 20% { filter: url(#rk-ondro-ca) hue-rotate(100deg) saturate(2.3) blur(3.4px); transform: scale(1.256) rotate(2.4deg) translate(12px, -6px); }
160
+ 45% { filter: url(#rk-ondro-warp) hue-rotate(190deg) saturate(0.45) contrast(1.2) blur(1.4px); transform: scale(1.19) rotate(-2.2deg) translate(-13px, 8px) skewY(1.2deg); }
161
+ 70% { filter: url(#rk-ondro-ca) hue-rotate(280deg) saturate(2.4) blur(4.6px); transform: scale(1.244) skewX(-1.8deg) translateY(-10px); }
162
+ 100% { filter: url(#rk-ondro-warp) hue-rotate(360deg) saturate(1.3); transform: scale(1.22); }
163
+ }
164
+ ${CHAOS_SEL} { animation: rk-ondro2 2.2s ease-in-out infinite; }
165
+ @keyframes rk-ondro-shake { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-6px,4px); } 40% { transform: translate(5px,-5px); } 60% { transform: translate(-4px,-3px); } 80% { transform: translate(6px,3px); } }
166
+ @keyframes rk-ondro-text {
167
+ 0%,100% { letter-spacing: normal; word-spacing: normal; text-shadow: none; }
168
+ 30% { letter-spacing: 0.12em; word-spacing: 0.3em; text-shadow: 4px 0 rgba(255,0,90,0.6), -4px 1px rgba(0,190,255,0.6); }
169
+ 60% { letter-spacing: -0.05em; word-spacing: -0.1em; text-shadow: -6px 0 rgba(255,0,90,0.55), 6px 2px rgba(0,190,255,0.55), 0 3px rgba(120,255,0,0.4); }
170
+ 80% { letter-spacing: 0.2em; text-shadow: 2px -2px rgba(255,0,90,0.65), -2px 2px rgba(0,190,255,0.65); }
171
+ }
172
+ h1, h2, h3, h4, p, a, li, button, span { animation: rk-ondro-text 3.1s ease-in-out infinite; }`);
173
+ startTextDecay(cleanups, every);
174
+ spawnGlitchBands(layer, cleanups);
175
+ wave({ kind: "burst", glyphs: ["\u{1F4A5}", "\u{1F9E8}", "\u{1F525}", "\u{1F300}"], count: 34, durationMs: 5e3 });
176
+ }, 6e3);
177
+ later(() => {
178
+ addStyle(`@keyframes rk-ondro3 {
179
+ 0% { filter: url(#rk-ondro-warp) hue-rotate(0deg) saturate(1.6) invert(0); transform: scale(1.22); }
180
+ 18% { filter: url(#rk-ondro-ca) hue-rotate(140deg) saturate(2.5) blur(6px) invert(0.35); transform: scale(1.27) rotate(3.2deg) translate(20px, -12px); }
181
+ 38% { filter: url(#rk-ondro-warp) hue-rotate(220deg) saturate(0.4) blur(2px) invert(0.75); transform: scale(1.18) rotate(-3deg) translate(-22px, 12px) skewY(2deg); }
182
+ 58% { filter: url(#rk-ondro-ca) hue-rotate(300deg) saturate(2.2) blur(7px) invert(0.3); transform: scale(1.25) skewX(2.4deg) translateY(-16px); }
183
+ 80% { filter: url(#rk-ondro-warp) hue-rotate(340deg) saturate(1.8) blur(3px) invert(0.05); transform: scale(1.23) rotate(1.6deg) translate(14px, 6px); }
184
+ 100% { filter: url(#rk-ondro-warp) hue-rotate(360deg) saturate(1.6) invert(0); transform: scale(1.22); }
185
+ }
186
+ ${CHAOS_SEL} { animation: rk-ondro3 4s ease-in-out infinite; }
187
+ @keyframes rk-ondro-shake3 { 0%,100% { transform: translate(0,0) rotate(0); } 25% { transform: translate(-9px,6px) rotate(-0.4deg); } 50% { transform: translate(8px,-8px) rotate(0.5deg); } 75% { transform: translate(-7px,-5px) rotate(-0.3deg); } }
188
+ body { animation: rk-ondro-shake3 620ms ease-in-out infinite; }`);
189
+ wave({ kind: "rain", glyphs: ["\u{1F92F}", "\u{1F480}", "\u{1F9E0}", "\u26A1\uFE0F", "\u{1FAE0}", "\u{1F529}"], count: 60, durationMs: 7e3 });
190
+ }, 13e3);
191
+ wave({ kind: "rain", glyphs: ["\u{1F92A}", "\u{1F4A5}", "\u{1F300}", "\u{1F9E0}", "\u26A1\uFE0F"], count: 40, durationMs: 12e3 });
192
+ every(() => wave({ kind: "rain", glyphs: ["\u{1F92A}", "\u{1F4A5}", "\u{1F300}", "\u{1F9E0}", "\u26A1\uFE0F", "\u{1F355}", "\u{1F4C0}"], count: 30, durationMs: 9e3 }), 9500);
193
+ every(() => spawnFallingLetters(layer), 12e3);
194
+ later(() => spawnFallingLetters(layer), 7e3);
195
+ }
196
+ {
197
+ const audio = new Audio(`${fxAssetsUrl}/rick.mp3`);
198
+ audio.volume = 0.8;
199
+ audio.loop = true;
200
+ cleanups.push(() => {
201
+ audio.pause();
202
+ audio.src = "";
203
+ });
204
+ audio.play().catch(() => {
205
+ const chip = document.createElement("button");
206
+ chip.className = "rk-fx-sound";
207
+ chip.type = "button";
208
+ chip.textContent = "\u{1F50A} klikni pre zvuk";
209
+ chip.addEventListener("click", () => {
210
+ audio.play().catch(() => void 0);
211
+ chip.remove();
212
+ });
213
+ layer.appendChild(chip);
214
+ cleanups.push(() => chip.remove());
215
+ });
216
+ }
217
+ installKillWord(cleanups);
218
+ return () => {
219
+ for (const fn of cleanups) fn();
220
+ };
221
+ }
222
+ function installKillWord(cleanups) {
223
+ let buffer = "";
224
+ const inTextField = (event) => event.composedPath().some(
225
+ (node) => node instanceof HTMLElement && (node.tagName === "INPUT" || node.tagName === "TEXTAREA" || node.isContentEditable)
226
+ );
227
+ const KILL_LETTERS = /* @__PURE__ */ new Set(["h", "o", "v", "n"]);
228
+ const onKey = (event) => {
229
+ if (event.key.length !== 1 || event.metaKey || event.ctrlKey || event.altKey) return;
230
+ const key = event.key.toLowerCase();
231
+ buffer = (buffer + key).slice(-8);
232
+ if (KILL_LETTERS.has(key) && !inTextField(event)) event.stopPropagation();
233
+ if (buffer.includes("hovno")) {
234
+ buffer = "";
235
+ broadcast?.("stop");
236
+ cancelEffects();
237
+ }
238
+ };
239
+ document.addEventListener("keydown", onKey, true);
240
+ cleanups.push(() => document.removeEventListener("keydown", onKey, true));
241
+ }
242
+ function bigEffect(build) {
243
+ return function start({ layer, reduced }) {
244
+ const cleanups = [];
245
+ const timers = [];
246
+ const intervals = [];
247
+ const later = (fn, ms) => timers.push(window.setTimeout(fn, ms));
248
+ const every = (fn, ms) => intervals.push(window.setInterval(fn, ms));
249
+ cleanups.push(() => {
250
+ timers.forEach((t) => window.clearTimeout(t));
251
+ intervals.forEach((t) => window.clearInterval(t));
252
+ });
253
+ const addStyle = (css) => {
254
+ const style = document.createElement("style");
255
+ style.setAttribute("data-rk-fx", "");
256
+ style.textContent = css;
257
+ document.head.appendChild(style);
258
+ cleanups.push(() => style.remove());
259
+ };
260
+ const wave = (spec) => {
261
+ const sub = document.createElement("div");
262
+ sub.className = "rk-fx-layer";
263
+ layer.appendChild(sub);
264
+ spawnParticles(sub, spec, reduced, spec.durationMs);
265
+ timers.push(window.setTimeout(() => sub.remove(), spec.durationMs + 1600));
266
+ cleanups.push(() => sub.remove());
267
+ };
268
+ if (!reduced) {
269
+ const scrollX = window.scrollX;
270
+ const scrollY = window.scrollY;
271
+ const htmlOverflow = document.documentElement.style.overflow;
272
+ document.documentElement.style.overflow = "hidden";
273
+ cleanups.push(() => {
274
+ document.documentElement.style.overflow = htmlOverflow;
275
+ if (document.documentElement.getAttribute("style") === "") document.documentElement.removeAttribute("style");
276
+ window.scrollTo(scrollX, scrollY);
277
+ });
278
+ const originY = scrollY + window.innerHeight / 2;
279
+ addStyle(`${CHAOS_SEL} { transform-origin: 50vw ${originY}px; }`);
280
+ }
281
+ build({
282
+ layer,
283
+ reduced,
284
+ addStyle,
285
+ later,
286
+ every,
287
+ wave,
288
+ decayText: () => startTextDecay(cleanups, every),
289
+ cleanups
290
+ });
291
+ installKillWord(cleanups);
292
+ return () => {
293
+ for (const fn of cleanups) fn();
294
+ };
295
+ };
296
+ }
297
+ function startTextDecay(cleanups, every) {
298
+ const GLYPHS = "\u2593\u2592\u2591#@%&$?!\xD7\xD8\u2206\xA7";
299
+ const originals = /* @__PURE__ */ new Map();
300
+ const nodes = [];
301
+ const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
302
+ let node;
303
+ while ((node = walker.nextNode()) && nodes.length < 120) {
304
+ const text = node;
305
+ const value = text.nodeValue ?? "";
306
+ if (value.trim().length < 4) continue;
307
+ const parent = text.parentElement;
308
+ if (!parent || parent.closest("[data-review-kit-host], script, style, [data-rk-edited]")) continue;
309
+ nodes.push(text);
310
+ }
311
+ every(() => {
312
+ for (let i = 0; i < 22; i++) {
313
+ const text = nodes[Math.random() * nodes.length | 0];
314
+ if (!text || !text.isConnected) continue;
315
+ if (!originals.has(text)) originals.set(text, text.nodeValue ?? "");
316
+ const original = originals.get(text) ?? "";
317
+ if (Math.random() < 0.3) {
318
+ text.nodeValue = original;
319
+ continue;
320
+ }
321
+ const chars = [...original];
322
+ const swaps = 1 + (Math.random() * 3 | 0);
323
+ for (let k = 0; k < swaps; k++) {
324
+ const idx = Math.random() * chars.length | 0;
325
+ if (chars[idx] !== " ") chars[idx] = GLYPHS[Math.random() * GLYPHS.length | 0];
326
+ }
327
+ text.nodeValue = chars.join("");
328
+ }
329
+ }, 260);
330
+ cleanups.push(() => {
331
+ for (const [text, value] of originals) {
332
+ if (text.isConnected && text.nodeValue !== value) text.nodeValue = value;
333
+ }
334
+ originals.clear();
335
+ });
336
+ }
337
+ function spawnFallingLetters(layer) {
338
+ const sub = document.createElement("div");
339
+ sub.className = "rk-fx-layer";
340
+ layer.appendChild(sub);
341
+ const headings = [...document.querySelectorAll("h1, h2, h3")].filter((el) => {
342
+ const r = el.getBoundingClientRect();
343
+ return r.width > 0 && r.top < window.innerHeight && r.bottom > 0 && !el.closest("[data-review-kit-host]");
344
+ });
345
+ let spawned = 0;
346
+ for (const heading of headings.slice(0, 3)) {
347
+ const textNode = [...heading.childNodes].find((n) => n.nodeType === 3 && (n.nodeValue ?? "").trim().length > 3);
348
+ const source = textNode ?? heading.firstChild;
349
+ if (!source || source.nodeType !== 3) continue;
350
+ const value = source.nodeValue ?? "";
351
+ const range = document.createRange();
352
+ for (let i = 0; i < value.length && spawned < 26; i++) {
353
+ if (value[i] === " " || Math.random() < 0.55) continue;
354
+ range.setStart(source, i);
355
+ range.setEnd(source, i + 1);
356
+ const rect = range.getBoundingClientRect();
357
+ if (rect.width === 0) continue;
358
+ const span = document.createElement("span");
359
+ span.className = "rk-fx-letter";
360
+ span.textContent = value[i];
361
+ span.style.left = `${rect.left}px`;
362
+ span.style.top = `${rect.top}px`;
363
+ span.style.fontSize = `${rect.height}px`;
364
+ span.style.animationDelay = `${Math.random() * 900 | 0}ms`;
365
+ span.style.setProperty("--fx-drift", `${(Math.random() * 120 | 0) - 60}px`);
366
+ sub.appendChild(span);
367
+ spawned++;
368
+ }
369
+ }
370
+ window.setTimeout(() => sub.remove(), 4600);
371
+ }
372
+ function spawnGlitchBands(layer, cleanups) {
373
+ for (let i = 0; i < 3; i++) {
374
+ const band = document.createElement("div");
375
+ band.className = "rk-fx-band";
376
+ band.style.height = `${34 + i * 16}px`;
377
+ band.style.animationDuration = `${2.8 + i * 0.7}s`;
378
+ band.style.animationDelay = `${i * 0.9}s`;
379
+ layer.appendChild(band);
380
+ cleanups.push(() => band.remove());
381
+ }
382
+ }
383
+ var startLava = bigEffect(({ layer, reduced, addStyle, later, every, wave, decayText, cleanups }) => {
384
+ if (reduced) {
385
+ addStyle(`@keyframes rk-lava-soft { 0%,100% { filter: none; } 50% { filter: sepia(0.35) hue-rotate(-20deg) saturate(1.3); } }
386
+ ${CHAOS_SEL} { animation: rk-lava-soft 9s ease-in-out infinite; }`);
387
+ wave({ kind: "rain", glyphs: ["\u{1FAE0}", "\u{1F525}"], count: 8, durationMs: 9e3 });
388
+ every(() => wave({ kind: "rain", glyphs: ["\u{1FAE0}", "\u{1F4A7}"], count: 6, durationMs: 9e3 }), 14e3);
389
+ return;
390
+ }
391
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
392
+ svg.setAttribute("data-rk-fx", "");
393
+ svg.setAttribute("width", "0");
394
+ svg.setAttribute("height", "0");
395
+ svg.style.position = "absolute";
396
+ svg.innerHTML = `<defs><filter id="rk-lava-warp" x="-10%" y="-10%" width="120%" height="130%">
397
+ <feTurbulence type="fractalNoise" baseFrequency="0.008 0.003" numOctaves="2" result="n" seed="4">
398
+ <animate attributeName="baseFrequency" dur="7s" values="0.008 0.003;0.014 0.006;0.008 0.003" repeatCount="indefinite"/>
399
+ </feTurbulence>
400
+ <feDisplacementMap in="SourceGraphic" in2="n" scale="10" xChannelSelector="R" yChannelSelector="G">
401
+ <animate attributeName="scale" dur="6s" values="4;24;4" repeatCount="indefinite"/>
402
+ </feDisplacementMap>
403
+ </filter></defs>`;
404
+ document.body.appendChild(svg);
405
+ cleanups.push(() => svg.remove());
406
+ addStyle(`@keyframes rk-lava1 {
407
+ 0% { filter: none; transform: scale(1.22); }
408
+ 35% { filter: sepia(0.4) hue-rotate(-24deg) saturate(1.8) blur(0.8px); transform: scale(1.235) skewY(0.5deg) translateY(6px); }
409
+ 70% { filter: sepia(0.6) hue-rotate(-38deg) saturate(2.2) contrast(1.1) blur(1.6px); transform: scale(1.22) scaleY(1.03) translateY(14px) skewX(-0.6deg); }
410
+ 100% { filter: none; transform: scale(1.22); }
411
+ }
412
+ ${CHAOS_SEL} { animation: rk-lava1 7s ease-in-out infinite; }`);
413
+ later(() => {
414
+ addStyle(`@keyframes rk-lava2 {
415
+ 0% { filter: url(#rk-lava-warp) sepia(0.5) hue-rotate(-30deg) saturate(2); transform: scale(1.22) translateY(10px); }
416
+ 40% { filter: url(#rk-lava-warp) sepia(0.8) hue-rotate(-48deg) saturate(2.8) contrast(1.18) blur(2.4px); transform: scale(1.2) scaleY(1.1) translateY(46px) skewX(1deg); }
417
+ 70% { filter: url(#rk-lava-warp) sepia(0.7) hue-rotate(-40deg) saturate(2.4) blur(1.2px); transform: scale(1.23) scaleY(1.06) translateY(28px) skewY(-0.8deg); }
418
+ 100% { filter: url(#rk-lava-warp) sepia(0.5) hue-rotate(-30deg) saturate(2); transform: scale(1.22) translateY(10px); }
419
+ }
420
+ ${CHAOS_SEL} { animation: rk-lava2 6.5s ease-in-out infinite; }
421
+ @keyframes rk-lava-text { 0%,100% { letter-spacing: normal; } 50% { letter-spacing: 0.1em; word-spacing: 0.25em; text-shadow: 0 6px 6px rgba(255,80,0,0.5); } }
422
+ h1, h2, h3, p, a, li, button { animation: rk-lava-text 5s ease-in-out infinite; }`);
423
+ decayText();
424
+ }, 1e4);
425
+ const drips = document.createElement("div");
426
+ drips.className = "rk-fx-layer";
427
+ layer.appendChild(drips);
428
+ cleanups.push(() => drips.remove());
429
+ every(() => {
430
+ const d = document.createElement("div");
431
+ d.className = "rk-fx-drip";
432
+ d.style.left = `${(Math.random() * 96 + 2).toFixed(1)}vw`;
433
+ d.style.animationDuration = `${(3.5 + Math.random() * 3).toFixed(2)}s`;
434
+ d.style.background = `linear-gradient(180deg, transparent, hsl(${Math.random() * 30 + 8 | 0}, 95%, 55%))`;
435
+ drips.appendChild(d);
436
+ window.setTimeout(() => d.remove(), 7e3);
437
+ }, 700);
438
+ wave({ kind: "rain", glyphs: ["\u{1F525}", "\u{1FAE0}", "\u{1F321}\uFE0F", "\u{1F4A7}"], count: 30, durationMs: 1e4 });
439
+ every(() => wave({ kind: "rain", glyphs: ["\u{1F525}", "\u{1FAE0}", "\u{1F4A7}"], count: 22, durationMs: 9e3 }), 9500);
440
+ });
441
+ var startSklo = bigEffect(({ layer, reduced, addStyle, every, wave, decayText, cleanups }) => {
442
+ if (reduced) {
443
+ addStyle(`@keyframes rk-sklo-soft { 0%,100% { filter: none; } 50% { filter: saturate(0.7) brightness(1.06); } }
444
+ ${CHAOS_SEL} { animation: rk-sklo-soft 8s ease-in-out infinite; }`);
445
+ wave({ kind: "burst", glyphs: ["\u2727", "\u2756", "\u{1F4A0}"], count: 10, durationMs: 8e3 });
446
+ return;
447
+ }
448
+ addStyle(`@keyframes rk-sklo-base {
449
+ 0%,10% { transform: scale(1.12); filter: none; }
450
+ 16% { transform: scale(1.125) rotate(0.4deg); filter: brightness(1.12) contrast(1.06); }
451
+ 50% { transform: scale(1.1) rotate(-0.5deg); filter: saturate(0.65) brightness(1.05) blur(0.5px); }
452
+ 72% { transform: scale(1.12); filter: none; }
453
+ 100% { transform: scale(1.12); filter: none; }
454
+ }
455
+ ${CHAOS_SEL} { animation: rk-sklo-base 11s ease-in-out infinite; }
456
+ @keyframes rk-sklo-fly {
457
+ 0%, 12% { transform: translate(0, 0) rotate(0); opacity: 1; }
458
+ 30% { transform: translate(var(--rk-gx), var(--rk-gy)) rotate(var(--rk-gr)); opacity: 0.92; }
459
+ 52% { transform: translate(calc(var(--rk-gx) * 1.18), calc(var(--rk-gy) * 1.18)) rotate(calc(var(--rk-gr) * 1.25)); opacity: 0.85; }
460
+ 74% { transform: translate(0, 0) rotate(0); opacity: 1; }
461
+ 100% { transform: translate(0, 0) rotate(0); opacity: 1; }
462
+ }
463
+ [data-rk-shard] { animation: rk-sklo-fly 11s cubic-bezier(0.55, 0, 0.3, 1) infinite; }`);
464
+ const shards = [...document.querySelectorAll("h1, h2, h3, h4, p, li, img, button, a")].filter((el) => {
465
+ if (el.closest("[data-review-kit-host]")) return false;
466
+ const r = el.getBoundingClientRect();
467
+ return r.width > 8 && r.height > 8 && r.bottom > -200 && r.top < window.innerHeight + 200;
468
+ }).slice(0, 90);
469
+ const rules = [];
470
+ shards.forEach((el, i) => {
471
+ const angle = i * 137.5 * Math.PI / 180;
472
+ const dist = 18 + i * 29 % 46;
473
+ rules.push(
474
+ `[data-rk-shard="${i}"] { --rk-gx: ${(Math.cos(angle) * dist).toFixed(1)}vw; --rk-gy: ${(Math.sin(angle) * dist).toFixed(1)}vh; --rk-gr: ${i * 97 % 640 - 320}deg; }`
475
+ );
476
+ el.setAttribute("data-rk-shard", String(i));
477
+ });
478
+ addStyle(rules.join("\n"));
479
+ cleanups.push(() => {
480
+ for (const el of shards) el.removeAttribute("data-rk-shard");
481
+ });
482
+ const cracks = document.createElement("div");
483
+ cracks.className = "rk-fx-cracks";
484
+ cracks.innerHTML = Array.from({ length: 9 }, (_, i) => {
485
+ const angle = i * 40 + i % 3 * 7;
486
+ return `<span style="transform: rotate(${angle}deg); animation-delay: ${(i * 0.05).toFixed(2)}s"></span>`;
487
+ }).join("");
488
+ layer.appendChild(cracks);
489
+ cleanups.push(() => cracks.remove());
490
+ decayText();
491
+ every(() => wave({ kind: "burst", glyphs: ["\u2727", "\u2756", "\u{1F4A0}", "\u{1F9CA}"], count: 26, durationMs: 5e3 }), 11e3);
492
+ wave({ kind: "burst", glyphs: ["\u2727", "\u2756", "\u{1F4A0}"], count: 26, durationMs: 5e3 });
493
+ });
494
+ var startVir = bigEffect(({ layer, reduced, addStyle, later, wave, decayText, cleanups }) => {
495
+ if (reduced) {
496
+ addStyle(`@keyframes rk-vir-soft { 0%,100% { filter: none; } 50% { filter: hue-rotate(50deg); } }
497
+ ${CHAOS_SEL} { animation: rk-vir-soft 9s ease-in-out infinite; }`);
498
+ wave({ kind: "burst", glyphs: ["\u{1F300}"], count: 8, durationMs: 8e3 });
499
+ return;
500
+ }
501
+ addStyle(`@keyframes rk-vir1 {
502
+ 0% { transform: scale(1.25) rotate(0deg); filter: none; }
503
+ 30% { transform: scale(1.31) rotate(4deg); filter: hue-rotate(50deg) saturate(1.3) blur(0.5px); }
504
+ 60% { transform: scale(1.28) rotate(-3.4deg); filter: hue-rotate(140deg) saturate(0.8) blur(1px); }
505
+ 100% { transform: scale(1.25) rotate(0deg); filter: none; }
506
+ }
507
+ ${CHAOS_SEL} { animation: rk-vir1 6.5s ease-in-out infinite; }`);
508
+ later(() => {
509
+ addStyle(`@keyframes rk-vir2 {
510
+ 0% { transform: scale(1.25) rotate(0deg); filter: hue-rotate(0deg) saturate(1.4); }
511
+ 25% { transform: scale(1.42) rotate(9deg); filter: hue-rotate(90deg) saturate(1.9) blur(1.6px); }
512
+ 50% { transform: scale(1.55) rotate(-7deg); filter: hue-rotate(200deg) saturate(0.6) contrast(1.15) blur(2.6px); }
513
+ 75% { transform: scale(1.38) rotate(10deg); filter: hue-rotate(300deg) saturate(1.8) blur(1.2px); }
514
+ 100% { transform: scale(1.25) rotate(0deg); filter: hue-rotate(360deg) saturate(1.4); }
515
+ }
516
+ ${CHAOS_SEL} { animation: rk-vir2 5.5s ease-in-out infinite; }
517
+ @keyframes rk-vir-text { 0%,100% { letter-spacing: normal; } 50% { letter-spacing: 0.16em; text-shadow: 3px 0 rgba(0,180,255,0.5), -3px 0 rgba(255,60,160,0.5); } }
518
+ h1, h2, h3, p, a, li, button { animation: rk-vir-text 4.5s ease-in-out infinite; }`);
519
+ decayText();
520
+ }, 12e3);
521
+ const GLYPHS = ["\u{1F300}", "\u2728", "\u{1F343}", "\u{1F4C4}", "\u2604\uFE0F"];
522
+ const bits = [];
523
+ const cx = () => window.innerWidth / 2;
524
+ const cy = () => window.innerHeight / 2;
525
+ const maxR = () => Math.hypot(window.innerWidth, window.innerHeight) / 2 + 60;
526
+ for (let i = 0; i < 36; i++) {
527
+ const el = document.createElement("span");
528
+ el.className = "rk-fx-particle";
529
+ el.textContent = GLYPHS[i % GLYPHS.length];
530
+ el.style.fontSize = `${13 + i * 11 % 16}px`;
531
+ layer.appendChild(el);
532
+ bits.push({ el, r: maxR() * ((i + 1) / 36), a: i * 0.7, v: 0.6 + i % 5 * 0.16 });
533
+ }
534
+ let raf = 0;
535
+ const tick = () => {
536
+ raf = requestAnimationFrame(tick);
537
+ for (const bit of bits) {
538
+ bit.a += 0.014 * bit.v * (1 + 140 / Math.max(bit.r, 40));
539
+ bit.r -= 0.55 * bit.v;
540
+ if (bit.r < 16) bit.r = maxR();
541
+ bit.el.style.transform = `translate3d(${cx() + Math.cos(bit.a) * bit.r}px, ${cy() + Math.sin(bit.a) * bit.r}px, 0) rotate(${bit.a}rad)`;
542
+ bit.el.style.opacity = `${Math.min(1, bit.r / 120)}`;
543
+ }
544
+ };
545
+ raf = requestAnimationFrame(tick);
546
+ cleanups.push(() => {
547
+ cancelAnimationFrame(raf);
548
+ bits.forEach((bit) => bit.el.remove());
549
+ });
550
+ });
551
+ var startCrt = bigEffect(({ layer, reduced, addStyle, every, wave, decayText, cleanups }) => {
552
+ if (reduced) {
553
+ addStyle(`${CHAOS_SEL} { filter: sepia(0.7) hue-rotate(55deg) saturate(1.6) contrast(1.05); transition: filter 2s ease; }`);
554
+ return;
555
+ }
556
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
557
+ svg.setAttribute("data-rk-fx", "");
558
+ svg.setAttribute("width", "0");
559
+ svg.setAttribute("height", "0");
560
+ svg.style.position = "absolute";
561
+ svg.innerHTML = `<defs><filter id="rk-crt-tear" x="-10%" y="-10%" width="120%" height="120%">
562
+ <feTurbulence type="turbulence" baseFrequency="0.002 0.09" numOctaves="1" result="n" seed="11">
563
+ <animate attributeName="seed" dur="3s" values="11;37;11" repeatCount="indefinite"/>
564
+ </feTurbulence>
565
+ <feDisplacementMap in="SourceGraphic" in2="n" scale="0" xChannelSelector="R" yChannelSelector="G">
566
+ <animate attributeName="scale" dur="8s" values="0;0;26;4;0;0" keyTimes="0;0.55;0.62;0.7;0.78;1" repeatCount="indefinite"/>
567
+ </feDisplacementMap>
568
+ </filter></defs>`;
569
+ document.body.appendChild(svg);
570
+ cleanups.push(() => svg.remove());
571
+ addStyle(`@keyframes rk-crt-hold {
572
+ 0%, 60% { transform: scale(1.16) translate(0, 0); }
573
+ 64% { transform: scale(1.16) translate(-3px, 14px) skewX(-0.8deg); }
574
+ 68% { transform: scale(1.16) translate(2px, -8px); }
575
+ 74%, 100% { transform: scale(1.16) translate(0, 0); }
576
+ }
577
+ ${CHAOS_SEL} {
578
+ filter: url(#rk-crt-tear) sepia(1) hue-rotate(55deg) saturate(2.6) contrast(1.22) brightness(0.92);
579
+ animation: rk-crt-hold 8s linear infinite;
580
+ }
581
+ @keyframes rk-crt-text { 0%,100% { text-shadow: 1px 0 rgba(0,255,120,0.5); } 50% { text-shadow: -2px 0 rgba(0,255,120,0.7), 2px 0 rgba(0,120,60,0.5); letter-spacing: 0.06em; } }
582
+ h1, h2, h3, p, a, li, button { animation: rk-crt-text 5s ease-in-out infinite; }`);
583
+ const overlay = document.createElement("div");
584
+ overlay.className = "rk-fx-crt";
585
+ overlay.innerHTML = '<div class="rk-fx-crt-scan"></div><div class="rk-fx-crt-roll"></div><div class="rk-fx-crt-vignette"></div><div class="rk-fx-crt-osd">KAN\xC1L 69 \xB7 SLAB\xDD SIGN\xC1L</div>';
586
+ layer.appendChild(overlay);
587
+ cleanups.push(() => overlay.remove());
588
+ decayText();
589
+ every(() => wave({ kind: "rain", glyphs: ["\u{1F4FA}", "\u{1F4E1}", "\u{1D34D}"], count: 10, durationMs: 7e3 }), 16e3);
590
+ });
591
+ function startBanner({ layer, reduced }) {
592
+ const banner = document.createElement("div");
593
+ banner.className = "rk-fx-banner";
594
+ banner.textContent = "\u{1F6A8} KOKOT ALERT \u{1F6A8} KOKOT ALERT \u{1F6A8} KOKOT ALERT \u{1F6A8}";
595
+ if (reduced) banner.classList.add("rk-fx-banner-still");
596
+ layer.appendChild(banner);
597
+ return () => banner.remove();
598
+ }
599
+ function startVrtule({ reduced }) {
600
+ const style = document.createElement("style");
601
+ style.setAttribute("data-rk-fx", "vrtule");
602
+ style.textContent = reduced ? `@keyframes rk-vrtula { 0%,100% { transform: rotate(0); } 50% { transform: rotate(3deg); } }
603
+ img { animation: rk-vrtula 4s ease-in-out infinite; }` : `@keyframes rk-vrtula { from { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(0.9); } to { transform: rotate(360deg) scale(1); } }
604
+ img { animation: rk-vrtula 3.6s ease-in-out infinite; }`;
605
+ document.head.appendChild(style);
606
+ return () => style.remove();
607
+ }
608
+ function makeChase(options) {
609
+ return function startChase({ layer, reduced }) {
610
+ const critters = [];
611
+ const count = reduced ? Math.min(4, options.count) : options.count;
612
+ for (let i = 0; i < count; i++) {
613
+ const el = document.createElement("span");
614
+ el.className = "rk-fx-particle";
615
+ el.textContent = options.glyphs[i % options.glyphs.length];
616
+ el.style.fontSize = `${options.sizePx(i)}px`;
617
+ layer.appendChild(el);
618
+ critters.push({ el, x: window.innerWidth / 2, y: window.innerHeight / 2, seed: i * 137 });
619
+ }
620
+ const wobble = options.wobbleT ?? 400;
621
+ let raf = 0;
622
+ const tick = (t) => {
623
+ raf = requestAnimationFrame(tick);
624
+ const root = layer.getRootNode();
625
+ const chips = [...root.querySelectorAll(".rk-peer-cursor")].filter((c) => c.style.opacity !== "0").map((c) => {
626
+ const m = /translate3d\(([-\d.]+)px, ([-\d.]+)px/.exec(c.style.transform);
627
+ return m ? { x: parseFloat(m[1]), y: parseFloat(m[2]) } : null;
628
+ }).filter((p) => p !== null);
629
+ chips.push({ x: lastPointerFallback.x, y: lastPointerFallback.y });
630
+ for (const critter of critters) {
631
+ const target = chips[critter.seed % chips.length];
632
+ const orbit = reduced ? 14 : options.orbit(critter.seed);
633
+ const wx = target.x + Math.cos(t / wobble + critter.seed) * orbit;
634
+ const wy = target.y + Math.sin(t / (wobble * 0.82) + critter.seed) * orbit;
635
+ const prevX = critter.x;
636
+ critter.x += (wx - critter.x) * options.lag;
637
+ critter.y += (wy - critter.y) * options.lag;
638
+ const face = options.flip && critter.x < prevX ? " scaleX(-1)" : "";
639
+ critter.el.style.transform = `translate3d(${critter.x}px, ${critter.y}px, 0)${face}`;
640
+ }
641
+ };
642
+ raf = requestAnimationFrame(tick);
643
+ const onMove = (event) => {
644
+ lastPointerFallback.x = event.clientX;
645
+ lastPointerFallback.y = event.clientY;
646
+ };
647
+ document.addEventListener("pointermove", onMove, { passive: true });
648
+ return () => {
649
+ cancelAnimationFrame(raf);
650
+ document.removeEventListener("pointermove", onMove);
651
+ for (const critter of critters) critter.el.remove();
652
+ };
653
+ };
654
+ }
655
+ var lastPointerFallback = { x: 300, y: 300 };
656
+ function styleEffect(css) {
657
+ const style = document.createElement("style");
658
+ style.setAttribute("data-rk-fx", "");
659
+ style.textContent = css;
660
+ document.head.appendChild(style);
661
+ return () => style.remove();
662
+ }
663
+ var PAGE_SEL = "body > :not([data-review-kit-host]):not(script):not(style)";
664
+ function startDisko({ layer, reduced }) {
665
+ const remove = styleEffect(
666
+ reduced ? `@keyframes rk-disko { 0%,100% { filter: none; } 50% { filter: hue-rotate(60deg) saturate(1.2); } }
667
+ ${PAGE_SEL} { animation: rk-disko 8s ease-in-out infinite; }` : `@keyframes rk-disko { from { filter: hue-rotate(0deg) saturate(1.35); } to { filter: hue-rotate(360deg) saturate(1.35); } }
668
+ ${PAGE_SEL} { animation: rk-disko 4s linear infinite; }`
669
+ );
670
+ spawnParticles(layer, { kind: "rain", glyphs: ["\u2728", "\u{1FAA9}", "\u{1F483}", "\u{1F57A}"], count: 26, durationMs: 15e3 }, reduced, 15e3);
671
+ return remove;
672
+ }
673
+ function startZrkadlo({ reduced }) {
674
+ if (reduced) {
675
+ return styleEffect(`${PAGE_SEL} { filter: saturate(0.8); transition: filter 2s ease; }`);
676
+ }
677
+ return styleEffect(`@keyframes rk-zrkadlo {
678
+ 0%, 100% { transform: perspective(1400px) rotateY(0); }
679
+ 35%, 65% { transform: perspective(1400px) rotateY(180deg); }
680
+ }
681
+ ${PAGE_SEL} { animation: rk-zrkadlo 12s ease-in-out both; transform-origin: 50% 50%; }`);
682
+ }
683
+ function startPohreb({ layer, reduced }) {
684
+ const remove = styleEffect(`@keyframes rk-pohreb { from { filter: none; } to { filter: grayscale(1) brightness(0.82) sepia(0.15); } }
685
+ ${PAGE_SEL} { animation: rk-pohreb 5s ease-out both; }`);
686
+ spawnParticles(layer, { kind: "rain", glyphs: ["\u{1F940}", "\u26B0\uFE0F", "\u{1F56F}\uFE0F", "\u{1F5A4}"], count: reduced ? 8 : 22, durationMs: 14e3 }, reduced, 14e3);
687
+ return remove;
688
+ }
689
+ function startLaser({ layer, reduced }) {
690
+ const beams = [];
691
+ const count = reduced ? 2 : 5;
692
+ const hues = [330, 190, 120, 45, 265];
693
+ for (let i = 0; i < count; i++) {
694
+ const beam = document.createElement("div");
695
+ beam.className = "rk-fx-laser";
696
+ beam.style.background = `linear-gradient(90deg, transparent, hsla(${hues[i % hues.length]}, 100%, 60%, 0.55), transparent)`;
697
+ beam.style.left = `${i % 2 * 100}%`;
698
+ beam.style.animationDuration = `${3.4 + i * 0.6}s`;
699
+ beam.style.animationDelay = `${i * 0.45}s`;
700
+ if (i % 2) beam.style.animationDirection = "reverse";
701
+ layer.appendChild(beam);
702
+ beams.push(beam);
703
+ }
704
+ return () => beams.forEach((b) => b.remove());
705
+ }
706
+ function startKura({ layer, reduced }) {
707
+ const hen = document.createElement("span");
708
+ hen.className = "rk-fx-kura";
709
+ hen.textContent = "\u{1F414}";
710
+ layer.appendChild(hen);
711
+ const props = [hen];
712
+ const timers = [];
713
+ const walkMs = reduced ? 16e3 : 11e3;
714
+ hen.style.animationDuration = `${walkMs}ms`;
715
+ if (!reduced) {
716
+ for (let i = 1; i <= 5; i++) {
717
+ timers.push(
718
+ window.setTimeout(() => {
719
+ const egg = document.createElement("span");
720
+ egg.className = "rk-fx-egg";
721
+ egg.textContent = "\u{1F95A}";
722
+ egg.style.left = `${i / 6 * 100}%`;
723
+ layer.appendChild(egg);
724
+ props.push(egg);
725
+ timers.push(
726
+ window.setTimeout(() => {
727
+ egg.textContent = "\u{1F423}";
728
+ }, 2600 + i * 400)
729
+ );
730
+ }, walkMs * i / 6)
731
+ );
732
+ }
733
+ }
734
+ return () => {
735
+ timers.forEach((t) => window.clearTimeout(t));
736
+ props.forEach((p) => p.remove());
737
+ };
738
+ }
739
+ function startSpam({ layer, reduced }) {
740
+ const MESSAGES = [
741
+ "\u26A0\uFE0F Kritick\xE1 chyba: str\xE1nka je pr\xEDli\u0161 pekn\xE1",
742
+ "\u{1F525} 69 \u013Eud\xED pr\xE1ve pozer\xE1 tento button",
743
+ "\u{1F4BE} Uklad\xE1m tvoje hriechy\u2026",
744
+ "\u{1F4C8} Konverzia st\xFApla o 420 %",
745
+ "\u{1F9E0} AI navrhuje: prerob to cel\xE9",
746
+ "\u{1F36A} T\xE1to str\xE1nka \u017Eerie kol\xE1\u010Diky",
747
+ "\u{1F4DE} Vol\xE1 ti klient. Zdvihni.",
748
+ "\u{1F4B8} Fakt\xFAra po splatnosti (odjak\u017Eiva)",
749
+ "\u{1F6F8} Zisten\xE1 mimozemsk\xE1 aktivita v p\xE4ti\u010Dke",
750
+ "\u2705 Ni\u010D sa nepodarilo \xFAspe\u0161ne"
751
+ ];
752
+ const toasts = [];
753
+ const timers = [];
754
+ const total = reduced ? 4 : MESSAGES.length;
755
+ for (let i = 0; i < total; i++) {
756
+ timers.push(
757
+ window.setTimeout(() => {
758
+ const toast = document.createElement("div");
759
+ toast.className = "rk-fx-toast";
760
+ toast.textContent = MESSAGES[i % MESSAGES.length];
761
+ toast.style.top = `${14 + i % 5 * 58}px`;
762
+ layer.appendChild(toast);
763
+ toasts.push(toast);
764
+ timers.push(window.setTimeout(() => toast.remove(), 5200));
765
+ }, i * (reduced ? 1800 : 950))
766
+ );
767
+ }
768
+ return () => {
769
+ timers.forEach((t) => window.clearTimeout(t));
770
+ toasts.forEach((t) => t.remove());
771
+ };
772
+ }
773
+ var EFFECTS = {
774
+ ondro: { kind: "custom", durationMs: ONDRO_MS, start: startOndro },
775
+ lava: { kind: "custom", durationMs: BIG_MS, start: startLava },
776
+ sklo: { kind: "custom", durationMs: BIG_MS, start: startSklo },
777
+ vir: { kind: "custom", durationMs: BIG_MS, start: startVir },
778
+ crt: { kind: "custom", durationMs: BIG_MS, start: startCrt },
779
+ hovno: { kind: "rain", glyphs: ["\u{1F4A9}"], count: 44, durationMs: 4200 },
780
+ konfety: { kind: "burst", glyphs: ["\u{1F389}", "\u{1F38A}", "\u2728"], count: 56, durationMs: 3600 },
781
+ srdiecka: { kind: "rain", glyphs: ["\u2764\uFE0F", "\u{1F49A}", "\u{1F49B}"], count: 40, durationMs: 4200 },
782
+ sneh: { kind: "rain", glyphs: ["\u2744\uFE0F", "\u{1F328}\uFE0F"], count: 48, durationMs: 5200 },
783
+ zemetrasenie: { kind: "rain", glyphs: ["\u{1FAA8}", "\u{1F9F1}"], count: 18, durationMs: 2400, shake: true },
784
+ "69": { kind: "burst", glyphs: ["\u{1F346}", "\u{1F351}", "\u{1F4A6}"], count: 69, durationMs: NICE_MS },
785
+ kokot: { kind: "custom", durationMs: 14500, start: startBanner },
786
+ vrtule: { kind: "custom", durationMs: NICE_MS, start: startVrtule },
787
+ muchy: {
788
+ kind: "custom",
789
+ durationMs: NICE_MS,
790
+ start: makeChase({ glyphs: ["\u{1FAB0}"], count: 14, sizePx: (i) => 12 + i % 3 * 4, orbit: (s) => 26 + s % 20, lag: 0.12, wobbleT: 400 })
791
+ },
792
+ pes: {
793
+ kind: "custom",
794
+ durationMs: 12e3,
795
+ start: makeChase({ glyphs: ["\u{1F415}", "\u{1F429}", "\u{1F9AE}"], count: 3, sizePx: (i) => 26 + i % 2 * 6, orbit: (s) => 46 + s % 30, lag: 0.055, wobbleT: 900, flip: true })
796
+ },
797
+ pivo: { kind: "rain", glyphs: ["\u{1F37A}", "\u{1F37B}", "\u{1F37E}"], count: 42, durationMs: 8e3 },
798
+ nikotin: { kind: "rain", glyphs: ["\u{1F6AC}", "\u{1F4A8}", "\u{1F62E}\u200D\u{1F4A8}"], count: 20, durationMs: 13e3 },
799
+ matrix: { kind: "rain", glyphs: [..."\u30A2\u30AB\u30B5\u30BF\u30CA0169\uFF8A\uFF8F\uFF94\uFF97\uFF66"], count: 64, durationMs: 12e3, className: "rk-fx-matrix" },
800
+ disko: { kind: "custom", durationMs: 15e3, start: startDisko },
801
+ zrkadlo: { kind: "custom", durationMs: 12e3, start: startZrkadlo },
802
+ pohreb: { kind: "custom", durationMs: 14e3, start: startPohreb },
803
+ laser: { kind: "custom", durationMs: 12e3, start: startLaser },
804
+ kura: { kind: "custom", durationMs: 11500, start: startKura },
805
+ spam: { kind: "custom", durationMs: 11e3, start: startSpam }
806
+ };
807
+ function effectNames() {
808
+ return Object.keys(EFFECTS);
809
+ }
810
+ function runEffect(name, layerHost) {
811
+ if (name === "stop") {
812
+ cancelEffects();
813
+ return true;
814
+ }
815
+ const spec = EFFECTS[name];
816
+ if (!spec || !layerHost) return spec !== void 0;
817
+ const reduced = reducedMotion();
818
+ const duration = reduced && spec.kind !== "custom" ? Math.min(2e3, spec.durationMs) : spec.durationMs;
819
+ const layer = document.createElement("div");
820
+ layer.className = "rk-fx-layer";
821
+ layerHost.appendChild(layer);
822
+ let customCleanup = null;
823
+ let shakeCleanup = null;
824
+ if (spec.kind === "custom") {
825
+ customCleanup = spec.start({ layer, reduced });
826
+ } else {
827
+ spawnParticles(layer, spec, reduced, duration);
828
+ if (spec.shake && !reduced) shakeCleanup = runShake();
829
+ }
830
+ let timer = 0;
831
+ const cancel = () => {
832
+ window.clearTimeout(timer);
833
+ customCleanup?.();
834
+ shakeCleanup?.();
835
+ layer.remove();
836
+ active.delete(cancel);
837
+ };
838
+ timer = window.setTimeout(cancel, duration + 1200);
839
+ active.add(cancel);
840
+ return true;
841
+ }
842
+ export {
843
+ DEFAULT_FX_ASSETS_URL,
844
+ EFFECTS,
845
+ cancelEffects,
846
+ effectNames,
847
+ runEffect,
848
+ setEffectBroadcaster,
849
+ setFxAssetsUrl
850
+ };
851
+ //# sourceMappingURL=effects-EWKHKUDP.js.map