tfrere HF Staff Cursor commited on
Commit
02b8766
Β·
1 Parent(s): 05e2a0c

fix: prevent vertical scroll when embedded in a small box

Browse files

Cap the orb size by height as well as width (min(38vw, 46vh)) and let the
stage shrink so a short container scales the orb down instead of overflowing.
Tighten paddings/gaps on short viewports and drop the (duplicate) footer under
480px tall, keeping the identity header intact.

Co-authored-by: Cursor <cursoragent@cursor.com>

Files changed (1) hide show
  1. style.css +32 -2
style.css CHANGED
@@ -569,6 +569,9 @@ a:hover {
569
  justify-content: center;
570
  padding: 24px 24px 32px;
571
  gap: 20px;
 
 
 
572
  }
573
 
574
  /* ─── Central circle ──────────────────────────────────────────────────── */
@@ -584,7 +587,11 @@ a:hover {
584
 
585
  .circle {
586
  position: relative;
587
- width: clamp(220px, 38vw, 320px);
 
 
 
 
588
  aspect-ratio: 1 / 1;
589
  border-radius: 50%;
590
  border: none;
@@ -1976,7 +1983,8 @@ body.cam-on .footer {
1976
  }
1977
 
1978
  .circle {
1979
- width: clamp(170px, 56vw, 240px);
 
1980
  }
1981
 
1982
  /* In the column layout the side controls must collapse by HEIGHT, not
@@ -2594,3 +2602,25 @@ body.cam-on .footer {
2594
 
2595
  .ident-title { font-size: 24px; }
2596
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  justify-content: center;
570
  padding: 24px 24px 32px;
571
  gap: 20px;
572
+ /* Let the stage shrink inside the grid's 1fr row so a height-capped orb can
573
+ * give back space rather than forcing the whole app to overflow. */
574
+ min-height: 0;
575
  }
576
 
577
  /* ─── Central circle ──────────────────────────────────────────────────── */
 
587
 
588
  .circle {
589
  position: relative;
590
+ /* Cap by height as well as width (min(vw, vh)-style): in a short container
591
+ * the orb shrinks instead of overflowing, so the page stays scroll-free even
592
+ * when embedded in a small box. On normal screens the 320px cap still wins,
593
+ * so the desktop size is unchanged. */
594
+ width: clamp(140px, min(38vw, 46vh), 320px);
595
  aspect-ratio: 1 / 1;
596
  border-radius: 50%;
597
  border: none;
 
1983
  }
1984
 
1985
  .circle {
1986
+ /* Height-capped like the base rule so a narrow AND short box still fits. */
1987
+ width: clamp(130px, min(56vw, 52vh), 240px);
1988
  }
1989
 
1990
  /* In the column layout the side controls must collapse by HEIGHT, not
 
2602
 
2603
  .ident-title { font-size: 24px; }
2604
  }
2605
+
2606
+ /* ─── Short viewports: fit without a vertical scrollbar ─────────────────────
2607
+ * The base media queries only react to WIDTH, so a short container (e.g. the
2608
+ * app embedded in a small box on a blog page) used to overflow vertically and
2609
+ * get clipped. We KEEP the identity header, orb, caption and credits, and only
2610
+ * tighten the vertical rhythm β€” paddings and gaps β€” so everything fits. The
2611
+ * orb is already height-capped (see `.circle` β†’ min(38vw, 46vh)), so it yields
2612
+ * the extra room instead of pushing content off-screen. No opt-in needed. */
2613
+ @media (max-height: 640px) {
2614
+ .topbar { padding: 12px 22px; }
2615
+ .stage { padding: 14px 20px 18px; gap: 14px; }
2616
+ .footer { padding: 8px 22px 12px; }
2617
+ }
2618
+
2619
+ @media (max-height: 480px) {
2620
+ .topbar { padding: 8px 16px; }
2621
+ .stage { padding: 8px 14px 10px; gap: 8px; }
2622
+ /* The footer is a verbatim duplicate of the "Powered by" credit already in
2623
+ * the header, so it's the one safe thing to drop for space β€” the header
2624
+ * (title + blurb + credits) stays intact. */
2625
+ .footer { display: none; }
2626
+ }