Skip to content

Commit b394886

Browse files
committed
just seeing if this does anything
1 parent 2b90516 commit b394886

File tree

1 file changed

+91
-1
lines changed

1 file changed

+91
-1
lines changed

404.html

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,112 @@
5252
}
5353
</style>
5454
<link rel="stylesheet" href="/styles/lazy-styles.css">
55+
<script nonce="aem" src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
56+
<style>
57+
#three-container {
58+
position: fixed;
59+
top: 0;
60+
left: 0;
61+
width: 100%;
62+
height: 100%;
63+
z-index: -1;
64+
pointer-events: none;
65+
}
66+
</style>
5567
</head>
5668

5769
<body>
5870
<header></header>
71+
<div id="three-container"></div>
5972
<main class="error">
6073
<div class="section">
6174
<svg viewBox="1 0 38 18" class="error-number">
6275
<text x="0" y="17">404</text>
6376
</svg>
64-
<h2 class="error-message">Page Not Found</h2>
77+
<h2 class="error-message">Page Not Found!</h2>
6578
<p class="button-container">
6679
<a href="/" class="button secondary error-button-home">Go home</a>
6780
</p>
6881
</div>
6982
</main>
7083
<footer></footer>
84+
<script nonce="aem">
85+
(function() {
86+
const container = document.getElementById('three-container');
87+
const scene = new THREE.Scene();
88+
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
89+
const renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });
90+
91+
renderer.setSize(window.innerWidth, window.innerHeight);
92+
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
93+
container.appendChild(renderer.domElement);
94+
95+
const shapes = [];
96+
const geometries = [
97+
new THREE.TetrahedronGeometry(0.5),
98+
new THREE.OctahedronGeometry(0.4),
99+
new THREE.IcosahedronGeometry(0.35),
100+
new THREE.TorusGeometry(0.3, 0.1, 8, 16)
101+
];
102+
103+
for (let i = 0; i < 20; i++) {
104+
const geometry = geometries[Math.floor(Math.random() * geometries.length)];
105+
const material = new THREE.MeshBasicMaterial({
106+
color: new THREE.Color().setHSL(Math.random() * 0.2 + 0.55, 0.7, 0.6),
107+
wireframe: true,
108+
transparent: true,
109+
opacity: 0.6
110+
});
111+
const mesh = new THREE.Mesh(geometry, material);
112+
113+
mesh.position.set(
114+
(Math.random() - 0.5) * 15,
115+
(Math.random() - 0.5) * 10,
116+
(Math.random() - 0.5) * 10 - 5
117+
);
118+
mesh.rotation.set(
119+
Math.random() * Math.PI,
120+
Math.random() * Math.PI,
121+
Math.random() * Math.PI
122+
);
123+
mesh.userData = {
124+
rotationSpeed: {
125+
x: (Math.random() - 0.5) * 0.02,
126+
y: (Math.random() - 0.5) * 0.02,
127+
z: (Math.random() - 0.5) * 0.02
128+
},
129+
floatSpeed: Math.random() * 0.5 + 0.5,
130+
floatOffset: Math.random() * Math.PI * 2
131+
};
132+
133+
shapes.push(mesh);
134+
scene.add(mesh);
135+
}
136+
137+
camera.position.z = 5;
138+
139+
function animate(time) {
140+
requestAnimationFrame(animate);
141+
142+
shapes.forEach((shape) => {
143+
shape.rotation.x += shape.userData.rotationSpeed.x;
144+
shape.rotation.y += shape.userData.rotationSpeed.y;
145+
shape.rotation.z += shape.userData.rotationSpeed.z;
146+
shape.position.y += Math.sin(time * 0.001 * shape.userData.floatSpeed + shape.userData.floatOffset) * 0.002;
147+
});
148+
149+
renderer.render(scene, camera);
150+
}
151+
152+
window.addEventListener('resize', () => {
153+
camera.aspect = window.innerWidth / window.innerHeight;
154+
camera.updateProjectionMatrix();
155+
renderer.setSize(window.innerWidth, window.innerHeight);
156+
});
157+
158+
animate(0);
159+
})();
160+
</script>
71161
</body>
72162

73163
</html>

0 commit comments

Comments
 (0)