eloigil6 commited on
Commit
a58205b
·
1 Parent(s): 2b68966

Refactor overlay behavior to improve user interaction during descent transition. The start button now has its pointer events disabled when the overlay is hidden, preventing click interference with underlying elements while maintaining a smooth fade-out effect.

Browse files
Files changed (2) hide show
  1. frontend/main.js +2 -4
  2. frontend/style.css +10 -0
frontend/main.js CHANGED
@@ -550,10 +550,8 @@ function startDescent() {
550
  intro.phase = "descending";
551
  intro.t0 = performance.now();
552
  overlay.classList.add("hidden");
553
- // The overlay only fades out (opacity), so its still-`ready` start button
554
- // would stay pinned on top and swallow clicks meant for the scene behind it
555
- // (e.g. the bench / cassette collection). Hide the spent button outright.
556
- startBtn.hidden = true;
557
  }
558
 
559
  const pageLoaded = new Promise((resolve) =>
 
550
  intro.phase = "descending";
551
  intro.t0 = performance.now();
552
  overlay.classList.add("hidden");
553
+ // The button stops capturing clicks via CSS (#title-overlay.hidden #start-btn)
554
+ // so it can keep fading out with the overlay instead of popping out of layout.
 
 
555
  }
556
 
557
  const pageLoaded = new Promise((resolve) =>
frontend/style.css CHANGED
@@ -35,6 +35,16 @@ body {
35
  transform: translateY(-48px);
36
  }
37
 
 
 
 
 
 
 
 
 
 
 
38
  #title {
39
  font-family: "Baloo 2", sans-serif;
40
  font-weight: 800;
 
35
  transform: translateY(-48px);
36
  }
37
 
38
+ /* Once the intro is dismissed the overlay only fades (no display:none, so the
39
+ exit animation can play). But the spent start button keeps .ready, i.e.
40
+ pointer-events: auto, leaving an invisible button on top that swallows clicks
41
+ on the scene behind it (e.g. the bench / cassette collection). Drop its
42
+ pointer-events the instant the overlay hides — it still fades out in place,
43
+ so there's no layout jump. */
44
+ #title-overlay.hidden #start-btn {
45
+ pointer-events: none;
46
+ }
47
+
48
  #title {
49
  font-family: "Baloo 2", sans-serif;
50
  font-weight: 800;