Skip to content

Commit f88b00c

Browse files
p4gsclaudehappy-otter
committed
fix: 3D canvas covers full viewport on all mobile devices
- Use inset:0 + width/height:100% instead of 100vh to avoid mobile browser chrome gaps - Size renderer from canvas.clientWidth/Height for accuracy - Listen to visualViewport resize for mobile address bar changes Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
1 parent 9f9bfaf commit f88b00c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

docs/projects/nthpartyfinder/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -824,10 +824,9 @@
824824
/* The .hero-overlay div is no longer used — dark tint is on body::after */
825825
#vendor-graph {
826826
position: fixed;
827-
top: 0;
828-
left: 0;
827+
inset: 0;
829828
width: 100%;
830-
height: 100vh;
829+
height: 100%;
831830
z-index: -2;
832831
pointer-events: none;
833832
}
@@ -1391,14 +1390,17 @@ <h2 class="section-title">Ready to Find Your Nth Party?</h2>
13911390

13921391
// ── RESIZE ──
13931392
function resize() {
1394-
const w = window.innerWidth;
1395-
const h = window.innerHeight;
1396-
renderer.setSize(w, h);
1393+
const w = canvas.clientWidth;
1394+
const h = canvas.clientHeight;
1395+
renderer.setSize(w, h, false);
1396+
canvas.width = w * devicePixelRatio;
1397+
canvas.height = h * devicePixelRatio;
13971398
camera.aspect = w / h;
13981399
camera.updateProjectionMatrix();
13991400
}
14001401
resize();
14011402
window.addEventListener('resize', resize);
1403+
if (window.visualViewport) window.visualViewport.addEventListener('resize', resize);
14021404

14031405
// ── REDUCED MOTION CHECK ──
14041406
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;

0 commit comments

Comments
 (0)