wop commited on
Commit
d6f98fd
Β·
verified Β·
1 Parent(s): 6ada71c

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +84 -49
index.html CHANGED
@@ -405,64 +405,84 @@
405
  height: 100%;
406
  }
407
 
408
- .avatar.assistant svg,
 
 
 
 
409
  .empty-state svg {
410
- transition: transform 180ms cubic-bezier(.2,.8,.2,1);
 
 
 
411
  }
412
 
 
 
 
 
 
413
  .avatar.assistant svg.clicked,
414
  .empty-state svg.clicked {
415
- transform: scale(0.82) translateY(1px);
416
  }
417
 
418
- .svg-layer-outer-1 {
419
- animation:
420
- spinCW 20s linear infinite,
421
- pulseOuter1 5s ease-in-out infinite;
 
 
 
 
 
 
422
  }
423
 
424
- .svg-layer-outer-2 {
425
- animation:
426
- spinCCW 25s linear infinite,
427
- pulseOuter2 6s ease-in-out infinite 0.6s;
428
- }
 
 
429
 
430
- .svg-layer-inner {
431
- animation:
432
- spinCW 15s linear infinite reverse,
433
- pulseInner 4s ease-in-out infinite 1.2s;
434
- }
435
-
436
- .svg-layer-outer-1.click-burst {
437
- animation: clickOuter1 220ms ease-out;
438
  }
439
 
440
  .svg-layer-outer-2.click-burst {
441
- animation: clickOuter2 220ms ease-out 30ms;
442
  }
443
 
444
  .svg-layer-inner.click-burst {
445
- animation: clickInner 220ms ease-out 60ms;
446
  }
447
 
448
- @keyframes clickOuter1 {
449
- 0% { transform: scale(1); }
450
- 50% { transform: scale(0.90); }
 
 
 
 
451
  100% { transform: scale(1); }
452
  }
453
 
454
- @keyframes clickOuter2 {
455
- 0% { transform: scale(1); }
456
- 50% { transform: scale(0.85); }
457
  100% { transform: scale(1); }
458
  }
459
 
460
- @keyframes clickInner {
461
- 0% { transform: scale(1); }
462
- 50% { transform: scale(0.75); }
463
  100% { transform: scale(1); }
464
  }
465
 
 
 
466
  .avatar.assistant svg path {
467
  stroke: var(--logo-yellow);
468
  }
@@ -2095,7 +2115,14 @@
2095
 
2096
 
2097
  //-------------------------
2098
- function burst(svg) {
 
 
 
 
 
 
 
2099
  const layers = svg.querySelectorAll(
2100
  ".svg-layer-outer-1, .svg-layer-outer-2, .svg-layer-inner"
2101
  );
@@ -2103,35 +2130,43 @@ function burst(svg) {
2103
  layers.forEach(layer => {
2104
  layer.classList.remove("click-burst");
2105
 
2106
- // restart animation
2107
  void layer.offsetWidth;
2108
 
2109
  layer.classList.add("click-burst");
2110
  });
2111
  }
2112
 
2113
- function addClickAnimation(svg) {
2114
- svg.classList.remove("clicked");
2115
-
2116
- // restart animation
2117
- void svg.offsetWidth;
2118
 
2119
- svg.classList.add("clicked");
 
 
2120
 
2121
- setTimeout(() => {
2122
- svg.classList.remove("clicked");
2123
- }, 180);
2124
- }
2125
 
2126
- document
2127
- .querySelectorAll(".avatar.assistant svg, .empty-state svg")
2128
- .forEach(svg => {
2129
  svg.addEventListener("click", () => {
2130
- addClickAnimation(svg);
2131
- burst(svg);
2132
  });
2133
  });
2134
-
 
 
 
 
 
 
 
 
 
 
2135
  </script>
2136
 
2137
  <script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'a089c011ea93a9de',t:'MTc4MDk0MTE0NQ=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>
 
405
  height: 100%;
406
  }
407
 
408
+ /* ─────────────────────────────
409
+ SVG BASE (shared behavior)
410
+ ───────────────────────────── */
411
+
412
+ .avatar.assistant svg,
413
  .empty-state svg {
414
+ transform-origin: center;
415
+ transform-box: fill-box;
416
+ will-change: transform;
417
+ cursor: pointer;
418
  }
419
 
420
+ /* ─────────────────────────────
421
+ CLICK PRESS (whole SVG)
422
+ quick tactile feedback
423
+ ───────────────────────────── */
424
+
425
  .avatar.assistant svg.clicked,
426
  .empty-state svg.clicked {
427
+ animation: svgPress 180ms cubic-bezier(.2,.8,.2,1);
428
  }
429
 
430
+ @keyframes svgPress {
431
+ 0% {
432
+ transform: scale(1) translateY(0px);
433
+ }
434
+ 45% {
435
+ transform: scale(0.82) translateY(1px);
436
+ }
437
+ 100% {
438
+ transform: scale(1) translateY(0px);
439
+ }
440
  }
441
 
442
+ /* ─────────────────────────────
443
+ LAYERED BURST SYSTEM
444
+ (requires SVG layers:
445
+ .svg-layer-outer-1
446
+ .svg-layer-outer-2
447
+ .svg-layer-inner)
448
+ ───────────────────────────── */
449
 
450
+ .svg-layer-outer-1.click-burst {
451
+ animation: burstOuter1 220ms ease-out;
 
 
 
 
 
 
452
  }
453
 
454
  .svg-layer-outer-2.click-burst {
455
+ animation: burstOuter2 260ms ease-out 40ms;
456
  }
457
 
458
  .svg-layer-inner.click-burst {
459
+ animation: burstInner 300ms ease-out 80ms;
460
  }
461
 
462
+ /* ─────────────────────────────
463
+ BURST KEYFRAMES
464
+ ───────────────────────────── */
465
+
466
+ @keyframes burstOuter1 {
467
+ 0% { transform: scale(1); }
468
+ 50% { transform: scale(0.92); }
469
  100% { transform: scale(1); }
470
  }
471
 
472
+ @keyframes burstOuter2 {
473
+ 0% { transform: scale(1); }
474
+ 50% { transform: scale(0.86); }
475
  100% { transform: scale(1); }
476
  }
477
 
478
+ @keyframes burstInner {
479
+ 0% { transform: scale(1); }
480
+ 50% { transform: scale(0.72); }
481
  100% { transform: scale(1); }
482
  }
483
 
484
+
485
+
486
  .avatar.assistant svg path {
487
  stroke: var(--logo-yellow);
488
  }
 
2115
 
2116
 
2117
  //-------------------------
2118
+ function triggerPress(svg) {
2119
+ // restart press animation (whole SVG)
2120
+ svg.classList.remove("clicked");
2121
+ void svg.offsetWidth;
2122
+ svg.classList.add("clicked");
2123
+ }
2124
+
2125
+ function triggerBurst(svg) {
2126
  const layers = svg.querySelectorAll(
2127
  ".svg-layer-outer-1, .svg-layer-outer-2, .svg-layer-inner"
2128
  );
 
2130
  layers.forEach(layer => {
2131
  layer.classList.remove("click-burst");
2132
 
2133
+ // force reflow so animation restarts every click
2134
  void layer.offsetWidth;
2135
 
2136
  layer.classList.add("click-burst");
2137
  });
2138
  }
2139
 
2140
+ function handleClick(svg) {
2141
+ triggerPress(svg);
2142
+ triggerBurst(svg);
2143
+ }
 
2144
 
2145
+ /* ─────────────────────────────
2146
+ Attach to all target SVGs
2147
+ ───────────────────────────── */
2148
 
2149
+ function initSvgInteractions() {
2150
+ const svgs = document.querySelectorAll(
2151
+ ".avatar.assistant svg, .empty-state svg"
2152
+ );
2153
 
2154
+ svgs.forEach(svg => {
 
 
2155
  svg.addEventListener("click", () => {
2156
+ handleClick(svg);
 
2157
  });
2158
  });
2159
+ }
2160
+
2161
+ /* ─────────────────────────────
2162
+ Auto-init on DOM ready
2163
+ ───────────────────────────── */
2164
+
2165
+ if (document.readyState === "loading") {
2166
+ document.addEventListener("DOMContentLoaded", initSvgInteractions);
2167
+ } else {
2168
+ initSvgInteractions();
2169
+ }
2170
  </script>
2171
 
2172
  <script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'a089c011ea93a9de',t:'MTc4MDk0MTE0NQ=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>