Skip to content

Commit 9553324

Browse files
p4gsclaudehappy-otter
committed
Make 3D graph canvas fixed to viewport behind scrolling content
Canvas now position:fixed covering full viewport. Content scrolls over it while the 3D vendor network stays in place as a persistent background effect. 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 5abd688 commit 9553324

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/projects/nthpartyfinder/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -770,11 +770,11 @@
770770
pointer-events: none;
771771
}
772772
#vendor-graph {
773-
position: absolute;
773+
position: fixed;
774774
top: 0;
775775
left: 0;
776776
width: 100%;
777-
height: 100%;
777+
height: 100vh;
778778
z-index: 0;
779779
pointer-events: none;
780780
}
@@ -821,8 +821,9 @@
821821
<div class="haze haze-blue"></div>
822822
<div class="haze haze-purple"></div>
823823

824+
<canvas id="vendor-graph"></canvas>
825+
824826
<header class="hero">
825-
<canvas id="vendor-graph"></canvas>
826827
<div class="hero-overlay"></div>
827828
<div class="container">
828829
<h1 class="hero-title">
@@ -1069,7 +1070,7 @@ <h2 class="section-title">Ready to Find Your Nth Party?</h2>
10691070

10701071
// ── SETUP ──
10711072
const canvas = document.getElementById('vendor-graph');
1072-
const hero = canvas.parentElement;
1073+
const hero = document.querySelector('.hero');
10731074
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });
10741075
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
10751076

@@ -1304,9 +1305,8 @@ <h2 class="section-title">Ready to Find Your Nth Party?</h2>
13041305

13051306
// ── RESIZE ──
13061307
function resize() {
1307-
const rect = hero.getBoundingClientRect();
1308-
const w = rect.width;
1309-
const h = rect.height;
1308+
const w = window.innerWidth;
1309+
const h = window.innerHeight;
13101310
renderer.setSize(w, h);
13111311
camera.aspect = w / h;
13121312
camera.updateProjectionMatrix();

0 commit comments

Comments
 (0)