-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbcci.html
More file actions
72 lines (61 loc) · 2.03 KB
/
bcci.html
File metadata and controls
72 lines (61 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Three.js Full Page Animation</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r148/three.min.js"></script>
<style>
body, html {
margin: 0;
padding: 0;
overflow: hidden;
font-family: 'Signika', sans-serif;
}
canvas {
display: block;
}
</style>
</head>
<body class="bg-black text-white">
<div class="absolute z-10 top-0 left-0 w-full h-full flex items-center justify-center">
<h1 class="text-4xl md:text-6xl font-bold text-white drop-shadow-lg">Welcome to the 3D Vibe</h1>
</div>
<script>
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, innerWidth / innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(innerWidth, innerHeight);
document.body.appendChild(renderer.domElement);
const particlesCount = 5000;
const geometry = new THREE.BufferGeometry();
const positions = new Float32Array(particlesCount * 3);
for (let i = 0; i < particlesCount * 3; i++) {
positions[i] = (Math.random() - 0.5) * 100;
}
geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
const material = new THREE.PointsMaterial({
color: 0xffffff,
size: 0.2,
transparent: true,
opacity: 0.7
});
const particles = new THREE.Points(geometry, material);
scene.add(particles);
camera.position.z = 30;
function animate() {
requestAnimationFrame(animate);
particles.rotation.y += 0.0015;
particles.rotation.x += 0.001;
renderer.render(scene, camera);
}
animate();
window.addEventListener('resize', () => {
camera.aspect = innerWidth / innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(innerWidth, innerHeight);
});
</script>
</body>
</html>