elfsong commited on
Commit
4e7c411
·
1 Parent(s): f751a05

Remove unused hero image and related styles for cleaner layout

Browse files
index.html CHANGED
@@ -10,7 +10,6 @@
10
  Anti Coding Coding Club — cover page.
11
  Layout language borrowed, with admiration, from labs.ramp.com/swebench.
12
  All text is original. All artwork is public domain / CC0:
13
- hero — Jean-Honoré Fragonard, "Young Girl Reading" (c. 1769), NGA, CC0
14
  typewriter — Jewett typewriter advertisement engraving, PD
15
  fern — Boston Public Library fern specimen chromolithograph, PD
16
  brain — Gray's Anatomy, plate 724, PD
@@ -143,17 +142,6 @@ h1.classic-title {
143
 
144
  .hero-stage { position: absolute; inset: 0; z-index: 4; }
145
 
146
- .hero-figure {
147
- position: absolute;
148
- left: 50%;
149
- bottom: 37px;
150
- transform: translateX(-50%);
151
- width: clamp(240px, 27.5vw, 430px);
152
- z-index: 5;
153
- animation: image-enter 1.6s cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
154
- }
155
-
156
- .hero-figure img,
157
  .satellite img,
158
  .desk-object img {
159
  display: block;
@@ -163,21 +151,6 @@ h1.classic-title {
163
  -webkit-user-drag: none;
164
  }
165
 
166
- .hero-figure img {
167
- pointer-events: none;
168
- filter: url(#sticker-lg) drop-shadow(2px 3px 3px rgba(18, 13, 6, 0.28)) drop-shadow(10px 16px 20px rgba(18, 13, 6, 0.20));
169
- transition: filter 0.28s ease;
170
- }
171
-
172
- .hero-figure:hover img {
173
- filter: url(#sticker-lg) drop-shadow(3px 5px 4px rgba(18, 13, 6, 0.30)) drop-shadow(16px 26px 32px rgba(18, 13, 6, 0.24));
174
- }
175
-
176
- @keyframes image-enter {
177
- 0% { filter: blur(4px); opacity: 0; transform: translateX(-50%) translate3d(0, 44%, 0) scale(0.98); }
178
- 100% { filter: blur(0); opacity: 1; transform: translateX(-50%) translate3d(0, 0, 0) scale(1); }
179
- }
180
-
181
  .satellite {
182
  position: absolute;
183
  top: 50%;
@@ -211,15 +184,13 @@ h1.classic-title {
211
  }
212
 
213
  .satellite.wiggling img,
214
- .hero-figure.wiggling img,
215
  .desk-object.wiggling img { animation: sticker-wiggle 0.6s ease-in-out; }
216
 
217
- .satellite, .hero-figure, .desk-object { cursor: grab; touch-action: none; }
218
  .dragging { cursor: grabbing !important; }
219
  .dragging img { animation: none !important; }
220
  .satellite.dragging img,
221
  .desk-object.dragging img { filter: url(#sticker) drop-shadow(3px 6px 5px rgba(18, 13, 6, 0.30)) drop-shadow(16px 26px 30px rgba(18, 13, 6, 0.27)) !important; }
222
- .hero-figure.dragging img { filter: url(#sticker-lg) drop-shadow(4px 7px 6px rgba(18, 13, 6, 0.30)) drop-shadow(20px 32px 40px rgba(18, 13, 6, 0.26)) !important; }
223
 
224
  @keyframes satellite-enter {
225
  0% {
@@ -340,7 +311,6 @@ h1.classic-title {
340
  @media (max-width: 767px) {
341
  .hero-copy { margin-top: max(8vh, 52px); }
342
  .ct-line { font-size: clamp(24px, 7.4vw, 38px); letter-spacing: 0.11em; margin-right: -0.11em; }
343
- .hero-figure { width: clamp(220px, 64vw, 340px); }
344
  .desk-object { left: calc(50% + 31vw); bottom: 48px; width: clamp(44px, 13vw, 64px); }
345
  .credit { display: none; }
346
  }
@@ -348,11 +318,11 @@ h1.classic-title {
348
  /* ---------- reduced motion ---------- */
349
 
350
  @media (prefers-reduced-motion: reduce) {
351
- .hero-copy, .hero-figure { animation: none; }
352
  .satellite { animation: none; }
353
  .ticker-track { animation: none; }
354
  .desk-object[data-knocked="true"] img { animation: none; }
355
- .satellite.wiggling img, .hero-figure.wiggling img, .desk-object.wiggling img { animation: none; }
356
  }
357
  </style>
358
  </head>
@@ -366,12 +336,6 @@ h1.classic-title {
366
  <feComposite in="edge" in2="dil" operator="in" result="border"/>
367
  <feMerge><feMergeNode in="border"/><feMergeNode in="SourceGraphic"/></feMerge>
368
  </filter>
369
- <filter id="sticker-lg" x="-12%" y="-12%" width="124%" height="124%">
370
- <feMorphology in="SourceAlpha" operator="dilate" radius="12" result="dil"/>
371
- <feFlood flood-color="#ffffff" result="edge"/>
372
- <feComposite in="edge" in2="dil" operator="in" result="border"/>
373
- <feMerge><feMergeNode in="border"/><feMergeNode in="SourceGraphic"/></feMerge>
374
- </filter>
375
  </defs>
376
  </svg>
377
 
@@ -386,11 +350,7 @@ h1.classic-title {
386
  </h1>
387
  </div>
388
 
389
- <div class="hero-stage" aria-hidden="true">
390
- <div class="hero-figure">
391
- <img src="static/images/collage/hero-reader.webp" alt="" fetchpriority="high" draggable="false">
392
- </div>
393
- </div>
394
 
395
  <button class="desk-object" id="snail" aria-label="The club snail. Click, gently.">
396
  <img src="static/images/collage/sat-snail.webp" alt="" draggable="false">
@@ -419,13 +379,25 @@ h1.classic-title {
419
  (function () {
420
  "use strict";
421
 
422
- var DESKTOP = [{"x": "-38vw", "y": "-25vh", "w": "clamp(150px, 18.5vw, 285px)", "rot": "-13deg", "delay": 0, "src": "static/images/collage/sat-typewriter.webp"}, {"x": "-26.5vw", "y": "-44vh", "w": "clamp(105px, 13vw, 195px)", "rot": "8deg", "delay": 45, "src": "static/images/collage/sat-fern.webp"}, {"x": "35vw", "y": "-8vh", "w": "clamp(115px, 14.5vw, 220px)", "rot": "-9deg", "delay": 35, "src": "static/images/collage/sat-books.webp"}, {"x": "41.5vw", "y": "24vh", "w": "clamp(82px, 10.5vw, 158px)", "rot": "-12deg", "delay": 60, "src": "static/images/collage/sat-watch.webp"}, {"x": "24vw", "y": "23vh", "w": "clamp(110px, 14vw, 215px)", "rot": "6deg", "delay": 85, "src": "static/images/collage/sat-coffee.webp"}, {"x": "-34.5vw", "y": "9vh", "w": "clamp(110px, 14vw, 215px)", "rot": "-7deg", "delay": 30, "src": "static/images/collage/sat-phone.webp"}, {"x": "-41vw", "y": "-9vh", "w": "clamp(82px, 10.5vw, 158px)", "rot": "10deg", "delay": 105, "src": "static/images/collage/sat-armchair.webp"}, {"x": "29vw", "y": "-34vh", "w": "clamp(78px, 9.5vw, 145px)", "rot": "-8deg", "delay": 75, "src": "static/images/collage/sat-hourglass.webp"}];
423
- var MOBILE = [{"x": "-30vw", "y": "-8vh", "w": "clamp(80px, 23vw, 116px)", "rot": "-13deg", "delay": 0, "src": "static/images/collage/sat-typewriter.webp"}, {"x": "-41vw", "y": "-45vh", "w": "clamp(64px, 19vw, 96px)", "rot": "8deg", "delay": 45, "src": "static/images/collage/sat-fern.webp"}, null, null, {"x": "33vw", "y": "26vh", "w": "clamp(68px, 21vw, 104px)", "rot": "6deg", "delay": 85, "src": "static/images/collage/sat-coffee.webp"}, {"x": "37vw", "y": "-4vh", "w": "clamp(64px, 20vw, 100px)", "rot": "-7deg", "delay": 30, "src": "static/images/collage/sat-phone.webp"}, null, {"x": "-36vw", "y": "22vh", "w": "clamp(52px, 15vw, 80px)", "rot": "-8deg", "delay": 75, "src": "static/images/collage/sat-hourglass.webp"}];
 
 
 
 
 
 
 
 
 
 
424
 
425
  var stage = document.querySelector(".hero-stage");
 
 
426
  var els = [];
427
 
428
- DESKTOP.forEach(function (s, i) {
429
  var el = document.createElement("div");
430
  el.className = "satellite";
431
  var img = document.createElement("img");
@@ -438,27 +410,67 @@ h1.classic-title {
438
  els.push(el);
439
  });
440
 
441
- function apply(configs) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
  els.forEach(function (el, i) {
443
- var s = configs[i % configs.length];
444
- var hideOnMobile = configs === MOBILE && !s;
445
- if (!s) { el.style.display = "none"; return; }
446
  el.style.display = "";
447
- var ang = i * 1.92 + 0.8;
448
- el.style.setProperty("--x", s.x);
449
- el.style.setProperty("--y", s.y);
450
- el.style.setProperty("--w", s.w);
451
- el.style.setProperty("--rot", s.rot);
452
- el.style.setProperty("--delay", (s.delay * 4) + "ms");
453
- el.style.setProperty("--fx", (Math.cos(ang) * 7).toFixed(1) + "px");
454
- el.style.setProperty("--fy", (Math.sin(ang) * 8 + 4).toFixed(1) + "px");
455
- el.style.setProperty("--fr", ((i % 2 === 0 ? 1 : -1) * 1.6) + "deg");
456
- el.style.setProperty("--fdur", (5.5 + (i % 5)) + "s");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  });
458
  }
459
 
460
  var mq = window.matchMedia("(max-width: 767px)");
461
- function layout() { apply(mq.matches ? MOBILE : DESKTOP); }
462
  layout();
463
  if (mq.addEventListener) mq.addEventListener("change", layout);
464
 
@@ -536,8 +548,6 @@ h1.classic-title {
536
  }
537
 
538
  els.forEach(function (el) { makeDraggable(el, satRot); addWiggle(el); });
539
- var heroFig = document.querySelector(".hero-figure");
540
- makeDraggable(heroFig); addWiggle(heroFig);
541
  var snailEl = document.getElementById("snail");
542
  makeDraggable(snailEl); addWiggle(snailEl);
543
 
 
10
  Anti Coding Coding Club — cover page.
11
  Layout language borrowed, with admiration, from labs.ramp.com/swebench.
12
  All text is original. All artwork is public domain / CC0:
 
13
  typewriter — Jewett typewriter advertisement engraving, PD
14
  fern — Boston Public Library fern specimen chromolithograph, PD
15
  brain — Gray's Anatomy, plate 724, PD
 
142
 
143
  .hero-stage { position: absolute; inset: 0; z-index: 4; }
144
 
 
 
 
 
 
 
 
 
 
 
 
145
  .satellite img,
146
  .desk-object img {
147
  display: block;
 
151
  -webkit-user-drag: none;
152
  }
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  .satellite {
155
  position: absolute;
156
  top: 50%;
 
184
  }
185
 
186
  .satellite.wiggling img,
 
187
  .desk-object.wiggling img { animation: sticker-wiggle 0.6s ease-in-out; }
188
 
189
+ .satellite, .desk-object { cursor: grab; touch-action: none; }
190
  .dragging { cursor: grabbing !important; }
191
  .dragging img { animation: none !important; }
192
  .satellite.dragging img,
193
  .desk-object.dragging img { filter: url(#sticker) drop-shadow(3px 6px 5px rgba(18, 13, 6, 0.30)) drop-shadow(16px 26px 30px rgba(18, 13, 6, 0.27)) !important; }
 
194
 
195
  @keyframes satellite-enter {
196
  0% {
 
311
  @media (max-width: 767px) {
312
  .hero-copy { margin-top: max(8vh, 52px); }
313
  .ct-line { font-size: clamp(24px, 7.4vw, 38px); letter-spacing: 0.11em; margin-right: -0.11em; }
 
314
  .desk-object { left: calc(50% + 31vw); bottom: 48px; width: clamp(44px, 13vw, 64px); }
315
  .credit { display: none; }
316
  }
 
318
  /* ---------- reduced motion ---------- */
319
 
320
  @media (prefers-reduced-motion: reduce) {
321
+ .hero-copy { animation: none; }
322
  .satellite { animation: none; }
323
  .ticker-track { animation: none; }
324
  .desk-object[data-knocked="true"] img { animation: none; }
325
+ .satellite.wiggling img, .desk-object.wiggling img { animation: none; }
326
  }
327
  </style>
328
  </head>
 
336
  <feComposite in="edge" in2="dil" operator="in" result="border"/>
337
  <feMerge><feMergeNode in="border"/><feMergeNode in="SourceGraphic"/></feMerge>
338
  </filter>
 
 
 
 
 
 
339
  </defs>
340
  </svg>
341
 
 
350
  </h1>
351
  </div>
352
 
353
+ <div class="hero-stage" aria-hidden="true"></div>
 
 
 
 
354
 
355
  <button class="desk-object" id="snail" aria-label="The club snail. Click, gently.">
356
  <img src="static/images/collage/sat-snail.webp" alt="" draggable="false">
 
379
  (function () {
380
  "use strict";
381
 
382
+ /* w: desktop width spec, mw: mobile width spec (null = hidden on mobile),
383
+ each spec is [min px, vw, max px] for clamp() */
384
+ var STICKERS = [
385
+ { src: "static/images/collage/sat-typewriter.webp", w: [150, 18.5, 285], mw: [80, 23, 116] },
386
+ { src: "static/images/collage/sat-fern.webp", w: [105, 13, 195], mw: [64, 19, 96] },
387
+ { src: "static/images/collage/sat-books.webp", w: [115, 14.5, 220], mw: null },
388
+ { src: "static/images/collage/sat-watch.webp", w: [82, 10.5, 158], mw: null },
389
+ { src: "static/images/collage/sat-coffee.webp", w: [110, 14, 215], mw: [68, 21, 104] },
390
+ { src: "static/images/collage/sat-phone.webp", w: [110, 14, 215], mw: [64, 20, 100] },
391
+ { src: "static/images/collage/sat-armchair.webp", w: [82, 10.5, 158], mw: null },
392
+ { src: "static/images/collage/sat-hourglass.webp", w: [78, 9.5, 145], mw: [52, 15, 80] }
393
+ ];
394
 
395
  var stage = document.querySelector(".hero-stage");
396
+ var heroEl = document.querySelector(".hero");
397
+ var copyEl = document.querySelector(".hero-copy");
398
  var els = [];
399
 
400
+ STICKERS.forEach(function (s) {
401
  var el = document.createElement("div");
402
  el.className = "satellite";
403
  var img = document.createElement("img");
 
410
  els.push(el);
411
  });
412
 
413
+ function resolveClamp(spec, W) {
414
+ return Math.min(Math.max(spec[0], spec[1] * W / 100), spec[2]);
415
+ }
416
+
417
+ /* Fresh random arrangement on every load: best-candidate sampling —
418
+ each sticker tries many random spots and keeps the one farthest from
419
+ the stickers already placed, so the spread stays even. Spots that
420
+ would sit on the title are rejected. */
421
+ function layout() {
422
+ var mobile = mq.matches;
423
+ var W = heroEl.clientWidth, H = heroEl.clientHeight;
424
+ var hr = heroEl.getBoundingClientRect();
425
+ var cr = copyEl.getBoundingClientRect();
426
+ var title = { l: cr.left - hr.left - 10, t: cr.top - hr.top - 10, r: cr.right - hr.left + 10, b: cr.bottom - hr.top + 10 };
427
+ var bottomSafe = 58; /* ticker strip */
428
+ var placed = [{ x: (title.l + title.r) / 2, y: (title.t + title.b) / 2 }];
429
+
430
+ els.forEach(function (el) { el.style.display = "none"; });
431
+
432
  els.forEach(function (el, i) {
433
+ var spec = mobile ? STICKERS[i].mw : STICKERS[i].w;
434
+ if (!spec) return;
 
435
  el.style.display = "";
436
+
437
+ var w = resolveClamp(spec, W), h = w; /* height unknown pre-load; square is close enough for spacing */
438
+ var margin = Math.min(24, w * 0.2);
439
+ var best = null, bestD = -1, fallback = null;
440
+
441
+ for (var k = 0; k < 60; k++) {
442
+ var x = margin + w / 2 + Math.random() * Math.max(1, W - w - margin * 2);
443
+ var y = margin + h / 2 + Math.random() * Math.max(1, H - bottomSafe - h - margin * 2);
444
+ if (!fallback) fallback = { x: x, y: y };
445
+
446
+ /* how much of the title this spot would cover — allow a grazing edge only */
447
+ var ox = Math.min(x + w / 2, title.r) - Math.max(x - w / 2, title.l);
448
+ var oy = Math.min(y + h / 2, title.b) - Math.max(y - h / 2, title.t);
449
+ if (ox > 0 && oy > 0 && ox * oy > 0.08 * w * h) continue;
450
+
451
+ var d = Infinity;
452
+ for (var p = 0; p < placed.length; p++) {
453
+ var dx = x - placed[p].x, dy = y - placed[p].y;
454
+ d = Math.min(d, dx * dx + dy * dy);
455
+ }
456
+ if (d > bestD) { bestD = d; best = { x: x, y: y }; }
457
+ }
458
+ if (!best) best = fallback;
459
+ placed.push(best);
460
+
461
+ el.style.setProperty("--x", (best.x - W / 2).toFixed(1) + "px");
462
+ el.style.setProperty("--y", (best.y - H / 2).toFixed(1) + "px");
463
+ el.style.setProperty("--w", w.toFixed(0) + "px");
464
+ el.style.setProperty("--rot", (Math.random() * 26 - 13).toFixed(1) + "deg");
465
+ el.style.setProperty("--delay", Math.round(Math.random() * 420) + "ms");
466
+ el.style.setProperty("--fx", (Math.random() * 14 - 7).toFixed(1) + "px");
467
+ el.style.setProperty("--fy", (Math.random() * 10 + 2).toFixed(1) + "px");
468
+ el.style.setProperty("--fr", ((Math.random() < 0.5 ? 1 : -1) * (1 + Math.random())).toFixed(2) + "deg");
469
+ el.style.setProperty("--fdur", (5.5 + Math.random() * 4).toFixed(1) + "s");
470
  });
471
  }
472
 
473
  var mq = window.matchMedia("(max-width: 767px)");
 
474
  layout();
475
  if (mq.addEventListener) mq.addEventListener("change", layout);
476
 
 
548
  }
549
 
550
  els.forEach(function (el) { makeDraggable(el, satRot); addWiggle(el); });
 
 
551
  var snailEl = document.getElementById("snail");
552
  makeDraggable(snailEl); addWiggle(snailEl);
553
 
static/images/collage/hero-reader.webp DELETED

Git LFS Details

  • SHA256: 3a49fcf0863d69418da64ba0b8295f17e9fe86fb0f9b6eee68eace330f9ecacd
  • Pointer size: 131 Bytes
  • Size of remote file: 117 kB