Of course. Let's create something that starts out beautiful and serene, but quickly descends into a chaotic, interactive, and slightly unsettling experience.
The Concept: "The Disturbed Void"
This website starts as a peaceful, interactive starfield. But as you move your mouse, you "disturb" the void, awakening something within it. An eye opens, follows your cursor, and the fabric of the page begins to glitch and tear with cryptic messages. This uses HTML for structure, CSS for visuals and animations, and JavaScript for interactivity and dynamic content.
Warning: This experience uses an ominous eye and a low humming sound.
✅ Features:
Interactive Starfield: Stars brighten as your mouse gets closer.
Mouse-Tracking Eye: A giant eye appears and follows your cursor's every move.
Dynamic Glitch Text: Cryptic messages are randomly generated and appear on the screen.
Atmospheric Audio: A low, ominous hum plays to set the mood.
CSS Filters & Animations: The page distorts and glitches as you interact with it.
💻 Code: Copy & Paste into index.html
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>The Disturbed Void</title>
<link href="https://fonts.googleapis.com/css2?family=Creepster&display=swap" rel="stylesheet">
<style>
/* --- Basic Setup --- */
body {
margin: 0;
background-color: #000;
color: #fff;
overflow: hidden;
cursor: none; /* Hide the default cursor for full immersion */
font-family: sans-serif;
}
/* --- The Starfield --- */
.star {
position: absolute;
width: 2px;
height: 2px;
background-color: #fff;
border-radius: 50%;
box-shadow: 0 0 5px #fff, 0 0 10px #fff;
opacity: 0.5;
transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
/* --- The Custom Cursor --- */
#cursor-dot {
position: fixed;
width: 8px;
height: 8px;
background-color: #0ff;
border-radius: 50%;
pointer-events: none;
transform: translate(-50%, -50%);
z-index: 9999;
box-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
}
/* --- The Eye of the Void (The Surprise) --- */
#eye-container {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0); /* Initially hidden */
transition: transform 2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
opacity: 0;
z-index: 100;
}
#eye-container.awake {
transform: translate(-50%, -50%) scale(1);
opacity: 1;
}
#sclera { /* The white part */
width: 200px;
height: 200px;
background: radial-gradient(circle, #fff 40%, #ffaaaa 80%, #a51d1d 100%);
border-radius: 50%;
position: relative;
box-shadow: 0 0 50px rgba(255, 0, 0, 0.5) inset;
}
#pupil {
position: absolute;
top: 50%;
left: 50%;
width: 50px;
height: 50px;
background: radial-gradient(circle, #111, #000);
border-radius: 50%;
transform: translate(-50%, -50%);
transition: transform 0.1s linear;
}
/* --- Glitch Text --- */
#glitch-container {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
pointer-events: none;
z-index: 1000;
}
.glitch-text {
position: absolute;
font-family: 'Creepster', cursive;
font-size: 3rem;
color: #f0f;
text-shadow: 0 0 10px #f0f, 0 0 20px #f00;
animation: fadeInOut 4s forwards;
user-select: none;
}
@keyframes fadeInOut {
0% { opacity: 0; transform: scale(0.5); }
10% { opacity: 1; transform: scale(1); }
90% { opacity: 1; transform: scale(1); }
100% { opacity: 0; transform: scale(1.5); }
}
/* --- Initial Instructions --- */
#instructions {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #555;
font-size: 1.5rem;
transition: opacity 1s;
text-align: center;
}
</style>
</head>
<body>
<div id="cursor-dot"></div>
<div id="star-container"></div>
<div id="glitch-container"></div>
<div id="instructions">
The void is quiet.
<br>
Move your mouse to listen.
</div>
<div id="eye-container">
<div id="sclera">
<div id="pupil"></div>
</div>
</div>
<!-- Ominous background audio -->
<audio id="ambient-sound" loop src="https://www.soundjay.com/misc/sounds/ambience-files/ambience-cave-01.mp3"></audio>
<script>
const starContainer = document.getElementById('star-container');
const eyeContainer = document.getElementById('eye-container');
const pupil = document.getElementById('pupil');
const glitchContainer = document.getElementById('glitch-container');
const instructions = document.getElementById('instructions');
const ambientSound = document.getElementById('ambient-sound');
const cursorDot = document.getElementById('cursor-dot');
const NUM_STARS = 200;
let isAwake = false;
const GLITCH_MESSAGES = [
"WE SEE YOU",
"THE VOID STARES BACK",
"YOU ARE NOT ALONE",
"SILENCE IS BROKEN",
"WHY ARE YOU HERE?",
"IT IS AWAKE"
];
// 1. Generate the starfield
for (let i = 0; i < NUM_STARS; i++) {
const star = document.createElement('div');
star.classList.add('star');
star.style.top = `${Math.random() * 100}%`;
star.style.left = `${Math.random() * 100}%`;
starContainer.appendChild(star);
}
const stars = document.querySelectorAll('.star');
// 2. Handle mouse movement
window.addEventListener('mousemove', (e) => {
const { clientX, clientY } = e;
// Move custom cursor
cursorDot.style.left = `${clientX}px`;
cursorDot.style.top = `${clientY}px`;
// Awaken the void on first move
if (!isAwake) {
isAwake = true;
eyeContainer.classList.add('awake');
instructions.style.opacity = '0';
ambientSound.play();
// Start spawning glitches
setInterval(spawnGlitch, 3000);
}
// Make stars react to the mouse
stars.forEach(star => {
const rect = star.getBoundingClientRect();
const dx = rect.left - clientX;
const dy = rect.top - clientY;
const dist = Math.sqrt(dx * dx + dy * dy);
const proximity = Math.max(0, 1 - dist / 300);
star.style.opacity = 0.5 + proximity * 0.5;
star.style.transform = `scale(${1 + proximity * 0.5})`;
});
// Make the eye follow the cursor
const eyeRect = pupil.parentElement.getBoundingClientRect();
const eyeCenterX = eyeRect.left + eyeRect.width / 2;
const eyeCenterY = eyeRect.top + eyeRect.height / 2;
const angle = Math.atan2(clientY - eyeCenterY, clientX - eyeCenterX);
const radius = Math.min(eyeRect.width / 4, eyeRect.height / 4); // Limit pupil movement
const pupilX = Math.cos(angle) * radius;
const pupilY = Math.sin(angle) * radius;
pupil.style.transform = `translate(-50%, -50%) translate(${pupilX}px, ${pupilY}px)`;
});
// 3. Spawn Glitchy Text
function spawnGlitch() {
if (Math.random() < 0.6) return; // 40% chance to spawn
const glitchText = document.createElement('div');
glitchText.classList.add('glitch-text');
glitchText.style.top = `${Math.random() * 90}%`;
glitchText.style.left = `${Math.random() * 90}%`;
glitchText.innerText = GLITCH_MESSAGES[Math.floor(Math.random() * GLITCH_MESSAGES.length)];
glitchContainer.appendChild(glitchText);
// Clean up the DOM after animation
setTimeout(() => {
glitchText.remove();
}, 4000);
}
</script>
</body>
</html>