Limen4ik commited on
Commit
fdb67e3
·
verified ·
1 Parent(s): df0eef7

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +259 -93
index.html CHANGED
@@ -7,17 +7,14 @@
7
 
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
- <link href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=IBM+Plex+Mono:wght@400;500&family=Instrument+Serif:ital@0;1&display=swap" rel="stylesheet">
11
 
12
  <link rel="stylesheet" href="style.css">
13
  </head>
14
  <body>
15
 
16
  <div class="bg" aria-hidden="true">
17
- <div class="dust" id="dust"></div>
18
- <div class="bg__spotwrap">
19
- <div class="bg__spot" id="spot"></div>
20
- </div>
21
  </div>
22
 
23
  <div class="cursor" id="cursor" aria-hidden="true">
@@ -106,8 +103,8 @@
106
 
107
  <main class="hero">
108
  <h1 class="headline">
109
- <span class="line line--glow"><span class="w" style="--d:0.05s">Small,</span><span class="w" style="--d:0.14s">but</span><span class="w" style="--d:0.23s">efficient</span><span class="w" style="--d:0.32s">AI</span><span class="w" style="--d:0.41s">models</span></span>
110
- <span class="line line--morph"><span class="w" style="--d:0.55s">for</span><span class="w" style="--d:0.64s">everyone</span><span class="w" style="--d:0.73s">who</span><span class="morph-zone w" id="zone" style="--d:0.84s">
111
  <span class="morph-strut" aria-hidden="true">x</span>
112
  <span class="morph-layer" id="layerA"></span>
113
  <span class="morph-layer" id="layerB"></span>
@@ -180,7 +177,7 @@
180
  <div class="footer__line" style="margin-bottom: clamp(30px, 5vh, 60px);" aria-hidden="true"></div>
181
 
182
  <section class="about">
183
- <div class="about__inner reveal">
184
  <h2 class="about__title">About Faunix</h2>
185
  <p class="about__text">
186
  Faunix is a small team building open AI. At its core — just two schoolkids, 12 and 13 years old: <a class="about__link" href="https://huggingface.co/Didiblud" target="_blank" rel="noopener">阿时时</a> and <a class="about__link" href="https://huggingface.co/Limen4ik" target="_blank" rel="noopener">L1men4ik</a>. Our mission is to create small but efficient AI models for the whole world. We make AI open and accessible for everyone, so people can run their favorite models in a smaller size, locally, on their own hardware.
@@ -191,44 +188,43 @@
191
  <div class="footer__line" style="margin-bottom: clamp(30px, 5vh, 60px);" aria-hidden="true"></div>
192
 
193
  <section class="support" id="support">
194
- <div class="support__inner reveal">
195
  <h2 class="support__title">Support Faunix :)</h2>
196
  <p class="support__text">
197
  Your support is very important to us — just like everyone else, we want to eat, so we are leaving our donation links below!
198
  </p>
199
-
200
  <div class="support__grid">
201
  <a class="support__btn" href="https://app.lava.top/faunix_ai" target="_blank" rel="noopener">
202
  <svg class="support__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
203
  <rect x="2" y="5" width="20" height="14" rx="3"/>
204
  <line x1="2" y1="10" x2="22" y2="10"/>
205
  </svg>
206
- <span>Card / Apple Pay / PayPal</span>
207
  </a>
208
 
209
- <div class="support__item" data-copy="UQArgd4zYOA0I5QSK7ylSlvgyaE5Md8pm-O-RyvSnTTk8Me0">
210
- <button type="button" class="support__btn">
211
  <svg class="support__icon" viewBox="0 0 24 24" fill="currentColor">
212
  <path d="M12 2L3 8.5L12 22L21 8.5L12 4.4ZM5.2 10.6H10.7V17.7L5.2 10.6ZM13.3 17.7V10.6H18.8L13.3 17.7Z"/>
213
  </svg>
214
- <span>TON</span>
215
- </button>
216
- <div class="support__pop">
217
- <div class="support__pop-head">TON Address <span class="support__copy-badge">(Click to copy)</span></div>
218
- <div class="support__pop-val">UQArgd4zYOA0I5QSK7ylSlvgyaE5Md8pm-O-RyvSnTTk8Me0</div>
219
  </div>
220
  </div>
221
 
222
- <div class="support__item" data-copy="TVCgvfbrUQC1nKD6cHcSP7JGirEEx5f4Te">
223
- <button type="button" class="support__btn">
224
  <svg class="support__icon" viewBox="0 0 24 24" fill="currentColor">
225
  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.18 6.47v1.12c2.72.16 4.75.76 4.75 1.48 0 .73-2.03 1.33-4.75 1.49v4.29h-2.36v-4.29c-2.72-.16-4.75-.76-4.75-1.49 0-.72 2.03-1.32 4.75-1.48V8.47H6.5V6.8h11v1.67h-4.32z"/>
226
  </svg>
227
- <span>USDT (TRC-20)</span>
228
- </button>
229
- <div class="support__pop">
230
- <div class="support__pop-head">TRC-20 Address <span class="support__copy-badge">(Click to copy)</span></div>
231
- <div class="support__pop-val">TVCgvfbrUQC1nKD6cHcSP7JGirEEx5f4Te</div>
232
  </div>
233
  </div>
234
  </div>
@@ -364,36 +360,21 @@
364
  if (!REDUCED) setTimeout(() => transition(1), 1400);
365
  });
366
 
367
- if (!REDUCED) {
368
- const dust = document.getElementById("dust");
369
- for (let i = 0; i < 128; i++) {
370
- const p = document.createElement("div");
371
- p.className = "particle";
372
- const s = Math.random() * 1.6 + 0.55;
373
- p.style.width = p.style.height = s + "px";
374
- p.style.left = Math.random() * 100 + "%";
375
- p.style.top = Math.random() * 100 + "%";
376
- p.style.setProperty("--dx", (Math.random() - 0.5) * 120 + "px");
377
- p.style.setProperty("--dy", (Math.random() - 0.5) * 120 + "px");
378
- p.style.setProperty("--dur", (12 + Math.random() * 12) + "s");
379
- p.style.setProperty("--del", (Math.random() * 10) + "s");
380
- p.style.setProperty("--op", (0.10 + Math.random() * 0.20).toFixed(2));
381
- dust.appendChild(p);
382
- }
383
- }
384
-
385
  (function () {
386
  const FINE = window.matchMedia("(hover: hover) and (pointer: fine)").matches;
387
  if (!FINE) return;
388
 
389
  const wrap = document.getElementById("cursor");
 
390
  const cDot = wrap.querySelector(".cursor__dot");
391
  const cRing = wrap.querySelector(".cursor__ring");
392
- if (!wrap || !cDot || !cRing) return;
393
 
394
  const REDUCED_M = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
395
  const EASEC = REDUCED_M ? 1 : 0.18;
 
396
  const HOVER_SEL = "a, button, [data-cursor-hover]";
 
397
 
398
  document.documentElement.classList.add("cursor-on");
399
 
@@ -401,7 +382,7 @@
401
  let rx = tx, ry = ty;
402
 
403
  function place(el, x, y) {
404
- el.style.transform = "translate(" + x + "px, " + y + "px) translate(-50%, -50%)";
405
  }
406
 
407
  window.addEventListener("mousemove", (e) => {
@@ -409,14 +390,24 @@
409
  ty = e.clientY;
410
  place(cDot, tx, ty);
411
  if (!wrap.classList.contains("is-ready")) wrap.classList.add("is-ready");
412
- });
413
 
414
- document.addEventListener("mouseover", (e) => {
415
- if (e.target.closest(HOVER_SEL)) wrap.classList.add("is-hover");
416
- });
417
- document.addEventListener("mouseout", (e) => {
418
- if (e.target.closest(HOVER_SEL)) wrap.classList.remove("is-hover");
 
 
 
 
 
 
 
 
 
 
419
  });
 
420
  window.addEventListener("mousedown", () => wrap.classList.add("is-down"));
421
  window.addEventListener("mouseup", () => wrap.classList.remove("is-down"));
422
 
@@ -456,15 +447,37 @@
456
 
457
  wrapEl.classList.add("vs");
458
 
459
- const INERTIA = 0.09;
460
  let target = window.scrollY;
461
  let current = target;
 
462
 
463
  function resize() {
464
  document.body.style.height = wrapEl.offsetHeight + "px";
465
  }
466
 
467
- window.addEventListener("scroll", () => { target = window.scrollY; }, { passive: true });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  window.addEventListener("resize", resize);
469
  window.addEventListener("load", resize);
470
  document.fonts.ready.then(resize);
@@ -476,13 +489,6 @@
476
  new ResizeObserver(resize).observe(wrapEl);
477
  }
478
 
479
- (function loop() {
480
- current += (target - current) * INERTIA;
481
- if (Math.abs(target - current) < 0.05) current = target;
482
- wrapEl.style.transform = "translate3d(0," + (-current) + "px,0)";
483
- requestAnimationFrame(loop);
484
- })();
485
-
486
  resize();
487
  })();
488
 
@@ -677,6 +683,27 @@
677
  addUser(q);
678
  }
679
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  async function runQwenseek() {
681
  await typeQuery(SCEN.qwenseek.query);
682
  await sleep(550);
@@ -700,13 +727,29 @@
700
 
701
  ai.code.classList.add("is-on");
702
  await sleep(400);
 
703
  for (const L of CODE) {
704
  const line = document.createElement("div");
705
  line.className = "code__line";
706
- line.textContent = L.length ? L : "\u00A0";
707
  ai.body.appendChild(line);
708
- scrollChat();
709
- await sleep(40 + Math.random() * 55);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
  }
711
  await sleep(800);
712
 
@@ -771,41 +814,164 @@
771
  })();
772
 
773
  (function () {
774
- const FINE = window.matchMedia("(hover: hover) and (pointer: fine)").matches;
775
- if (!FINE) return;
776
- const spot = document.getElementById("spot");
777
- if (!spot) return;
778
 
779
- let tx = window.innerWidth / 2, ty = window.innerHeight / 3, x = tx, y = ty;
 
780
 
781
- window.addEventListener("mousemove", (e) => { tx = e.clientX; ty = e.clientY; });
 
 
 
 
 
782
 
783
- (function loop() {
784
- x += (tx - x) * 0.12;
785
- y += (ty - y) * 0.12;
786
- spot.style.setProperty("--sx", x + "px");
787
- spot.style.setProperty("--sy", y + "px");
788
- requestAnimationFrame(loop);
789
- })();
790
- })();
791
 
792
- (function () {
793
- const FINE = window.matchMedia("(hover: hover) and (pointer: fine)").matches;
794
- const REDUCED_M = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
795
- if (!FINE || REDUCED_M) return;
796
-
797
- const bg = document.querySelector(".bg");
798
- if (!bg) return;
799
-
800
- window.addEventListener("mousedown", (e) => {
801
- const w = document.createElement("div");
802
- w.className = "warp";
803
- w.style.left = e.clientX + "px";
804
- w.style.top = e.clientY + "px";
805
- w.style.backgroundPosition = (190 - e.clientX) + "px " + (190 - e.clientY) + "px";
806
- bg.appendChild(w);
807
- setTimeout(() => w.remove(), 950);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
808
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
809
  })();
810
 
811
  (function () {
 
7
 
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=Oxanium:wght@600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&family=IBM+Plex+Mono:wght@500;600;700&family=Instrument+Serif:ital@0;1&display=swap" rel="stylesheet">
11
 
12
  <link rel="stylesheet" href="style.css">
13
  </head>
14
  <body>
15
 
16
  <div class="bg" aria-hidden="true">
17
+ <canvas id="smokeCanvas" class="bg__canvas"></canvas>
 
 
 
18
  </div>
19
 
20
  <div class="cursor" id="cursor" aria-hidden="true">
 
103
 
104
  <main class="hero">
105
  <h1 class="headline">
106
+ <span class="line line--glow"><span class="w" style="--d:0.05s">Building</span><span class="w" style="--d:0.13s">the</span><span class="w" style="--d:0.21s">next</span><span class="w" style="--d:0.29s">layer</span><span class="w" style="--d:0.37s">of</span><span class="w" style="--d:0.45s">intelligence</span></span>
107
+ <span class="line line--morph"><span class="w" style="--d:0.58s">for</span><span class="w" style="--d:0.67s">everyone</span><span class="w" style="--d:0.76s">who</span><span class="morph-zone w" id="zone" style="--d:0.87s">
108
  <span class="morph-strut" aria-hidden="true">x</span>
109
  <span class="morph-layer" id="layerA"></span>
110
  <span class="morph-layer" id="layerB"></span>
 
177
  <div class="footer__line" style="margin-bottom: clamp(30px, 5vh, 60px);" aria-hidden="true"></div>
178
 
179
  <section class="about">
180
+ <div class="about__inner glass-frame reveal">
181
  <h2 class="about__title">About Faunix</h2>
182
  <p class="about__text">
183
  Faunix is a small team building open AI. At its core — just two schoolkids, 12 and 13 years old: <a class="about__link" href="https://huggingface.co/Didiblud" target="_blank" rel="noopener">阿时时</a> and <a class="about__link" href="https://huggingface.co/Limen4ik" target="_blank" rel="noopener">L1men4ik</a>. Our mission is to create small but efficient AI models for the whole world. We make AI open and accessible for everyone, so people can run their favorite models in a smaller size, locally, on their own hardware.
 
188
  <div class="footer__line" style="margin-bottom: clamp(30px, 5vh, 60px);" aria-hidden="true"></div>
189
 
190
  <section class="support" id="support">
191
+ <div class="support__inner glass-frame reveal">
192
  <h2 class="support__title">Support Faunix :)</h2>
193
  <p class="support__text">
194
  Your support is very important to us — just like everyone else, we want to eat, so we are leaving our donation links below!
195
  </p>
 
196
  <div class="support__grid">
197
  <a class="support__btn" href="https://app.lava.top/faunix_ai" target="_blank" rel="noopener">
198
  <svg class="support__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
199
  <rect x="2" y="5" width="20" height="14" rx="3"/>
200
  <line x1="2" y1="10" x2="22" y2="10"/>
201
  </svg>
202
+ <span>Card / Apple Pay / PayPal ✦</span>
203
  </a>
204
 
205
+ <div class="support__item support__pill support__pill--ton" data-copy="UQArgd4zYOA0I5QSK7ylSlvgyaE5Md8pm-O-RyvSnTTk8Me0">
206
+ <div class="support__pill-head">
207
  <svg class="support__icon" viewBox="0 0 24 24" fill="currentColor">
208
  <path d="M12 2L3 8.5L12 22L21 8.5L12 4.4ZM5.2 10.6H10.7V17.7L5.2 10.6ZM13.3 17.7V10.6H18.8L13.3 17.7Z"/>
209
  </svg>
210
+ <span class="support__pill-name">TON</span>
211
+ <span class="support__copy-badge">(Click to copy)</span>
212
+ </div>
213
+ <div class="support__pill-body">
214
+ <span class="support__pill-val">UQArgd4zYOA0I5QSK7ylSlvgyaE5Md8pm-O-RyvSnTTk8Me0</span>
215
  </div>
216
  </div>
217
 
218
+ <div class="support__item support__pill support__pill--usdt" data-copy="TVCgvfbrUQC1nKD6cHcSP7JGirEEx5f4Te">
219
+ <div class="support__pill-head">
220
  <svg class="support__icon" viewBox="0 0 24 24" fill="currentColor">
221
  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.18 6.47v1.12c2.72.16 4.75.76 4.75 1.48 0 .73-2.03 1.33-4.75 1.49v4.29h-2.36v-4.29c-2.72-.16-4.75-.76-4.75-1.49 0-.72 2.03-1.32 4.75-1.48V8.47H6.5V6.8h11v1.67h-4.32z"/>
222
  </svg>
223
+ <span class="support__pill-name">USDT (TRC-20)</span>
224
+ <span class="support__copy-badge">(Click to copy)</span>
225
+ </div>
226
+ <div class="support__pill-body">
227
+ <span class="support__pill-val">TVCgvfbrUQC1nKD6cHcSP7JGirEEx5f4Te</span>
228
  </div>
229
  </div>
230
  </div>
 
360
  if (!REDUCED) setTimeout(() => transition(1), 1400);
361
  });
362
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
  (function () {
364
  const FINE = window.matchMedia("(hover: hover) and (pointer: fine)").matches;
365
  if (!FINE) return;
366
 
367
  const wrap = document.getElementById("cursor");
368
+ if (!wrap) return;
369
  const cDot = wrap.querySelector(".cursor__dot");
370
  const cRing = wrap.querySelector(".cursor__ring");
371
+ if (!cDot || !cRing) return;
372
 
373
  const REDUCED_M = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
374
  const EASEC = REDUCED_M ? 1 : 0.18;
375
+
376
  const HOVER_SEL = "a, button, [data-cursor-hover]";
377
+ const TEXT_SEL = "p, h1, h2, h3, code, pre, input, textarea, .msg__text, .code__line, .about__text, .support__text, .news-card__desc, .news-card__name";
378
 
379
  document.documentElement.classList.add("cursor-on");
380
 
 
382
  let rx = tx, ry = ty;
383
 
384
  function place(el, x, y) {
385
+ el.style.transform = `translate(${x}px, ${y}px) translate(-50%, -50%)`;
386
  }
387
 
388
  window.addEventListener("mousemove", (e) => {
 
390
  ty = e.clientY;
391
  place(cDot, tx, ty);
392
  if (!wrap.classList.contains("is-ready")) wrap.classList.add("is-ready");
 
393
 
394
+ if (e.buttons === 1 && window.getSelection().toString().length > 0) {
395
+ wrap.classList.add("is-text");
396
+ return;
397
+ }
398
+
399
+ const target = e.target;
400
+ if (target.closest(HOVER_SEL)) {
401
+ wrap.classList.add("is-hover");
402
+ wrap.classList.remove("is-text");
403
+ } else if (target.closest(TEXT_SEL)) {
404
+ wrap.classList.add("is-text");
405
+ wrap.classList.remove("is-hover");
406
+ } else {
407
+ wrap.classList.remove("is-hover", "is-text");
408
+ }
409
  });
410
+
411
  window.addEventListener("mousedown", () => wrap.classList.add("is-down"));
412
  window.addEventListener("mouseup", () => wrap.classList.remove("is-down"));
413
 
 
447
 
448
  wrapEl.classList.add("vs");
449
 
450
+ const INERTIA = 0.085;
451
  let target = window.scrollY;
452
  let current = target;
453
+ let isRunning = false;
454
 
455
  function resize() {
456
  document.body.style.height = wrapEl.offsetHeight + "px";
457
  }
458
 
459
+ function loop() {
460
+ current += (target - current) * INERTIA;
461
+ const snap = Math.round(current * 100) / 100;
462
+ wrapEl.style.transform = `translate3d(0, ${-snap}px, 0)`;
463
+
464
+ if (Math.abs(target - current) > 0.1) {
465
+ requestAnimationFrame(loop);
466
+ } else {
467
+ current = target;
468
+ wrapEl.style.transform = `translate3d(0, ${-target}px, 0)`;
469
+ isRunning = false;
470
+ }
471
+ }
472
+
473
+ window.addEventListener("scroll", () => {
474
+ target = window.scrollY;
475
+ if (!isRunning) {
476
+ isRunning = true;
477
+ requestAnimationFrame(loop);
478
+ }
479
+ }, { passive: true });
480
+
481
  window.addEventListener("resize", resize);
482
  window.addEventListener("load", resize);
483
  document.fonts.ready.then(resize);
 
489
  new ResizeObserver(resize).observe(wrapEl);
490
  }
491
 
 
 
 
 
 
 
 
492
  resize();
493
  })();
494
 
 
683
  addUser(q);
684
  }
685
 
686
+ function highlightPython(text) {
687
+ if (!text || text.trim() === "") return "\u00A0";
688
+
689
+ const esc = text
690
+ .replace(/&/g, "&amp;")
691
+ .replace(/</g, "&lt;")
692
+ .replace(/>/g, "&gt;");
693
+
694
+ const tokens = /("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')|(#.*$)|(\b(?:import|from|def|return|if|else|elif|while|for|in|break|global|lambda)\b)|(\b(?:True|False|None)\b)|(\b\d+(?:\.\d+)?\b)|(\b[a-zA-Z_]\w*(?=\s*\())/g;
695
+
696
+ return esc.replace(tokens, (match, str, comment, kw, boolVal, num, fn) => {
697
+ if (str) return `<span class="tok-str">${str}</span>`;
698
+ if (comment) return `<span class="tok-comment">${comment}</span>`;
699
+ if (kw) return `<span class="tok-kw">${kw}</span>`;
700
+ if (boolVal) return `<span class="tok-bool">${boolVal}</span>`;
701
+ if (num) return `<span class="tok-num">${num}</span>`;
702
+ if (fn) return `<span class="tok-fn">${fn}</span>`;
703
+ return match;
704
+ });
705
+ }
706
+
707
  async function runQwenseek() {
708
  await typeQuery(SCEN.qwenseek.query);
709
  await sleep(550);
 
727
 
728
  ai.code.classList.add("is-on");
729
  await sleep(400);
730
+
731
  for (const L of CODE) {
732
  const line = document.createElement("div");
733
  line.className = "code__line";
 
734
  ai.body.appendChild(line);
735
+
736
+ if (!L.length) {
737
+ line.innerHTML = "\u00A0";
738
+ scrollChat();
739
+ await sleep(35);
740
+ continue;
741
+ }
742
+
743
+ let buffer = "";
744
+ for (let i = 0; i < L.length; i += 2) {
745
+ buffer += L.slice(i, i + 2);
746
+ line.innerHTML = highlightPython(buffer) + '<span class="code__cursor"></span>';
747
+ scrollChat();
748
+ await sleep(10 + Math.random() * 14);
749
+ }
750
+
751
+ line.innerHTML = highlightPython(L);
752
+ await sleep(30 + Math.random() * 35);
753
  }
754
  await sleep(800);
755
 
 
814
  })();
815
 
816
  (function () {
817
+ const canvas = document.getElementById("smokeCanvas");
818
+ if (!canvas) return;
 
 
819
 
820
+ const gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
821
+ if (!gl) return;
822
 
823
+ const vsSource = `
824
+ attribute vec2 a_pos;
825
+ void main() {
826
+ gl_Position = vec4(a_pos, 0.0, 1.0);
827
+ }
828
+ `;
829
 
830
+ const fsSource = `
831
+ precision mediump float;
832
+ uniform vec2 u_res;
833
+ uniform float u_time;
834
+ uniform vec2 u_mouse;
 
 
 
835
 
836
+ vec2 hash(vec2 p) {
837
+ p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));
838
+ return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);
839
+ }
840
+
841
+ float noise(vec2 p) {
842
+ vec2 i = floor(p);
843
+ vec2 f = fract(p);
844
+ vec2 u = f * f * (3.0 - 2.0 * f);
845
+ return mix(mix(dot(hash(i + vec2(0.0, 0.0)), f - vec2(0.0, 0.0)),
846
+ dot(hash(i + vec2(1.0, 0.0)), f - vec2(1.0, 0.0)), u.x),
847
+ mix(dot(hash(i + vec2(0.0, 1.0)), f - vec2(0.0, 1.0)),
848
+ dot(hash(i + vec2(1.0, 1.0)), f - vec2(1.0, 1.0)), u.x), u.y);
849
+ }
850
+
851
+ float fbm(vec2 p) {
852
+ float v = 0.0;
853
+ float a = 0.55;
854
+ for (int i = 0; i < 4; ++i) {
855
+ v += a * noise(p);
856
+ p = p * 2.05 + vec2(20.0);
857
+ a *= 0.5;
858
+ }
859
+ return v;
860
+ }
861
+
862
+ float getBayer(vec2 coord) {
863
+ vec2 p = mod(floor(coord / 2.0), 4.0);
864
+ int y = int(p.y);
865
+ int x = int(p.x);
866
+
867
+ vec4 row;
868
+ if (y == 0) row = vec4(0.0, 8.0, 2.0, 10.0);
869
+ else if (y == 1) row = vec4(12.0, 4.0, 14.0, 6.0);
870
+ else if (y == 2) row = vec4(3.0, 11.0, 1.0, 9.0);
871
+ else row = vec4(15.0, 7.0, 13.0, 5.0);
872
+
873
+ if (x == 0) return row.x / 16.0;
874
+ if (x == 1) return row.y / 16.0;
875
+ if (x == 2) return row.z / 16.0;
876
+ return row.w / 16.0;
877
+ }
878
+
879
+ void main() {
880
+ vec2 uv = (gl_FragCoord.xy - 0.5 * u_res) / min(u_res.x, u_res.y);
881
+
882
+ vec2 m = (u_mouse - 0.5 * u_res) / min(u_res.x, u_res.y);
883
+ float dMouse = length(uv - m);
884
+ vec2 swirl = vec2(-(uv.y - m.y), uv.x - m.x) * exp(-dMouse * 3.0) * 0.45;
885
+
886
+ float t = u_time * 0.09;
887
+
888
+ vec2 q = vec2(fbm(uv + vec2(0.0, t * 0.4) + swirl),
889
+ fbm(uv + vec2(5.2, 1.3) + swirl));
890
+
891
+ vec2 r = vec2(fbm(uv + 2.8 * q + vec2(1.7, 9.2) + vec2(t * 0.3, 0.0)),
892
+ fbm(uv + 2.8 * q + vec2(8.3, 2.8) - vec2(0.0, t * 0.2)));
893
+
894
+ float density = fbm(uv + 3.2 * r);
895
+ density = smoothstep(-0.35, 0.65, density);
896
+
897
+ float bayer = getBayer(gl_FragCoord.xy);
898
+ float levels = 6.0;
899
+ float dithered = floor(density * levels + (bayer - 0.5)) / levels;
900
+
901
+ vec3 darkBg = vec3(0.03, 0.03, 0.035);
902
+ vec3 smokeMid = vec3(0.32, 0.32, 0.36);
903
+ vec3 smokeHi = vec3(0.70, 0.70, 0.75);
904
+
905
+ vec3 color = mix(darkBg, smokeMid, clamp(dithered * 1.4, 0.0, 1.0));
906
+ color = mix(color, smokeHi, clamp((dithered - 0.5) * 2.0, 0.0, 1.0));
907
+
908
+ gl_FragColor = vec4(color, 1.0);
909
+ }
910
+ `;
911
+
912
+ function compile(type, src) {
913
+ const s = gl.createShader(type);
914
+ gl.shaderSource(s, src);
915
+ gl.compileShader(s);
916
+ if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) return null;
917
+ return s;
918
+ }
919
+
920
+ const vs = compile(gl.VERTEX_SHADER, vsSource);
921
+ const fs = compile(gl.FRAGMENT_SHADER, fsSource);
922
+ if (!vs || !fs) return;
923
+
924
+ const prog = gl.createProgram();
925
+ gl.attachShader(prog, vs);
926
+ gl.attachShader(prog, fs);
927
+ gl.linkProgram(prog);
928
+ gl.useProgram(prog);
929
+
930
+ const buf = gl.createBuffer();
931
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
932
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
933
+ -1, -1, 1, -1, -1, 1,
934
+ -1, 1, 1, -1, 1, 1
935
+ ]), gl.STATIC_DRAW);
936
+
937
+ const aPos = gl.getAttribLocation(prog, "a_pos");
938
+ gl.enableVertexAttribArray(aPos);
939
+ gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);
940
+
941
+ const uRes = gl.getUniformLocation(prog, "u_res");
942
+ const uTime = gl.getUniformLocation(prog, "u_time");
943
+ const uMouse = gl.getUniformLocation(prog, "u_mouse");
944
+
945
+ let mx = window.innerWidth / 2, my = window.innerHeight / 2;
946
+ let targetMX = mx, targetMY = my;
947
+
948
+ window.addEventListener("mousemove", (e) => {
949
+ targetMX = e.clientX;
950
+ targetMY = window.innerHeight - e.clientY;
951
  });
952
+
953
+ function resize() {
954
+ const dpr = Math.min(window.devicePixelRatio || 1, 1.5);
955
+ canvas.width = Math.floor(window.innerWidth * dpr);
956
+ canvas.height = Math.floor(window.innerHeight * dpr);
957
+ gl.viewport(0, 0, canvas.width, canvas.height);
958
+ }
959
+ window.addEventListener("resize", resize);
960
+ resize();
961
+
962
+ const t0 = performance.now();
963
+ function render() {
964
+ mx += (targetMX * (canvas.width / window.innerWidth) - mx) * 0.08;
965
+ my += (targetMY * (canvas.height / window.innerHeight) - my) * 0.08;
966
+
967
+ gl.uniform2f(uRes, canvas.width, canvas.height);
968
+ gl.uniform1f(uTime, (performance.now() - t0) * 0.001);
969
+ gl.uniform2f(uMouse, mx, my);
970
+
971
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
972
+ requestAnimationFrame(render);
973
+ }
974
+ requestAnimationFrame(render);
975
  })();
976
 
977
  (function () {