zachery.lol/routes/root/index.html
Zachery Aaron Shores-Chmielewski 50e3a49d4f feat: fractal animation
Add a pleasant fractal animation background to the main page
2026-02-06 11:44:23 +07:00

124 lines
2.9 KiB
HTML
Executable file

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Zach's page</title>
<style>
body {
font-family: system-ui, sans-serif;
margin: 0;
padding: 0;
overflow: hidden;
}
#fractal-canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.content-overlay {
position: relative;
z-index: 1;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
header h2 {
font-weight: normal;
font-family: "Gill Sans", sans-serif;
text-align: center;
color: #fff;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
background: rgba(0, 0, 0, 0.3);
padding: 0.5rem 1.5rem;
border-radius: 8px;
}
nav.directory {
text-align: center;
padding: 1rem 0;
}
nav.directory dt {
margin: 1.2rem 0;
font-size: 1.1rem;
}
nav.directory dt a {
text-decoration: none;
color: #fff;
padding: 0.5rem 1rem;
display: inline-block;
background: rgba(0, 0, 0, 0.3);
border-radius: 4px;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
transition: background 0.2s;
}
nav.directory dt a:hover {
background: rgba(0, 0, 0, 0.5);
}
</style>
</head>
<body>
<canvas id="fractal-canvas"></canvas>
<div class="content-overlay">
<header>
<h2>Zachery Aaron Shores-Chmielewski</h2>
</header>
<nav class="directory">
<nav>
<dl>
<dt><a href="./who">Who</a></dt>
<dt><a href="./contact">Send me a message</a></dt>
</dl>
</nav>
</nav>
</div>
<script src="/routes/root/pkg/fractal_engine.js"></script>
<script>
(async function() {
await wasm_bindgen('/routes/root/pkg/fractal_engine_bg.wasm');
const canvas = document.getElementById('fractal-canvas');
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}
resizeCanvas();
window.addEventListener('resize', resizeCanvas);
let startTime = performance.now();
const animationSpeed = 0.0001;
const scale = 4; // Render at 1/4 resolution for performance
function animate() {
const elapsed = performance.now() - startTime;
const time = elapsed * animationSpeed;
try {
wasm_bindgen.render_fractal_animated('fractal-canvas', time, scale);
} catch (e) {
console.error('Fractal render error:', e);
}
requestAnimationFrame(animate);
}
animate();
})();
</script>
</body>
</html>