Spaces:
Running
Running
make a realistic 3D game where you control a barbie woman with a narrow waist big tights and blonde hair tied with a ponytail and wearing a pink swimsuit with the word "Barbie" on it
Browse files- README.md +7 -4
- index.html +357 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Barbie Beach Bonanza
|
| 3 |
-
|
| 4 |
-
colorFrom: purple
|
| 5 |
colorTo: yellow
|
|
|
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Barbie Beach Bonanza 🏖️
|
| 3 |
+
colorFrom: yellow
|
|
|
|
| 4 |
colorTo: yellow
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://deepsite.hf.co).
|
index.html
CHANGED
|
@@ -1,19 +1,358 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Barbie Beach Bonanza</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/controls/OrbitControls.min.js"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/loaders/GLTFLoader.min.js"></script>
|
| 11 |
+
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.waves.min.js"></script>
|
| 12 |
+
<style>
|
| 13 |
+
body {
|
| 14 |
+
margin: 0;
|
| 15 |
+
overflow: hidden;
|
| 16 |
+
font-family: 'Arial', sans-serif;
|
| 17 |
+
}
|
| 18 |
+
#ui-container {
|
| 19 |
+
position: absolute;
|
| 20 |
+
top: 0;
|
| 21 |
+
left: 0;
|
| 22 |
+
width: 100%;
|
| 23 |
+
pointer-events: none;
|
| 24 |
+
z-index: 100;
|
| 25 |
+
}
|
| 26 |
+
#loading-screen {
|
| 27 |
+
position: fixed;
|
| 28 |
+
top: 0;
|
| 29 |
+
left: 0;
|
| 30 |
+
width: 100%;
|
| 31 |
+
height: 100%;
|
| 32 |
+
background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
|
| 33 |
+
display: flex;
|
| 34 |
+
flex-direction: column;
|
| 35 |
+
justify-content: center;
|
| 36 |
+
align-items: center;
|
| 37 |
+
z-index: 9999;
|
| 38 |
+
}
|
| 39 |
+
.progress-bar {
|
| 40 |
+
width: 50%;
|
| 41 |
+
height: 20px;
|
| 42 |
+
background-color: #fff;
|
| 43 |
+
border-radius: 10px;
|
| 44 |
+
margin-top: 20px;
|
| 45 |
+
overflow: hidden;
|
| 46 |
+
}
|
| 47 |
+
.progress {
|
| 48 |
+
height: 100%;
|
| 49 |
+
width: 0%;
|
| 50 |
+
background: linear-gradient(90deg, #ff758c 0%, #ff7eb3 100%);
|
| 51 |
+
transition: width 0.3s ease;
|
| 52 |
+
}
|
| 53 |
+
.control-btn {
|
| 54 |
+
pointer-events: all;
|
| 55 |
+
background-color: rgba(255, 255, 255, 0.3);
|
| 56 |
+
border: 2px solid white;
|
| 57 |
+
border-radius: 50%;
|
| 58 |
+
width: 60px;
|
| 59 |
+
height: 60px;
|
| 60 |
+
display: flex;
|
| 61 |
+
justify-content: center;
|
| 62 |
+
align-items: center;
|
| 63 |
+
margin: 10px;
|
| 64 |
+
cursor: pointer;
|
| 65 |
+
transition: all 0.3s ease;
|
| 66 |
+
}
|
| 67 |
+
.control-btn:hover {
|
| 68 |
+
background-color: rgba(255, 255, 255, 0.5);
|
| 69 |
+
transform: scale(1.1);
|
| 70 |
+
}
|
| 71 |
+
.control-btn i {
|
| 72 |
+
color: white;
|
| 73 |
+
font-size: 24px;
|
| 74 |
+
}
|
| 75 |
+
</style>
|
| 76 |
+
</head>
|
| 77 |
+
<body>
|
| 78 |
+
<div id="loading-screen">
|
| 79 |
+
<h1 class="text-4xl font-bold text-white mb-4">Barbie Beach Bonanza</h1>
|
| 80 |
+
<p class="text-xl text-white mb-8">Loading fabulous adventure...</p>
|
| 81 |
+
<div class="progress-bar">
|
| 82 |
+
<div class="progress" id="progress-bar"></div>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
<div id="ui-container">
|
| 87 |
+
<div class="flex justify-between p-4">
|
| 88 |
+
<div class="bg-pink-500 bg-opacity-50 rounded-full p-2">
|
| 89 |
+
<h2 class="text-white font-bold text-xl">Score: <span id="score">0</span></h2>
|
| 90 |
+
</div>
|
| 91 |
+
<div class="bg-pink-500 bg-opacity-50 rounded-full p-2">
|
| 92 |
+
<h2 class="text-white font-bold text-xl">Time: <span id="timer">60</span>s</h2>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
<div class="absolute bottom-4 left-0 right-0 flex justify-center">
|
| 97 |
+
<div class="flex items-center">
|
| 98 |
+
<div class="control-btn" id="left-btn">
|
| 99 |
+
<i data-feather="chevron-left"></i>
|
| 100 |
+
</div>
|
| 101 |
+
<div class="flex flex-col items-center">
|
| 102 |
+
<div class="control-btn" id="up-btn">
|
| 103 |
+
<i data-feather="chevron-up"></i>
|
| 104 |
+
</div>
|
| 105 |
+
<div class="control-btn" id="down-btn">
|
| 106 |
+
<i data-feather="chevron-down"></i>
|
| 107 |
+
</div>
|
| 108 |
+
</div>
|
| 109 |
+
<div class="control-btn" id="right-btn">
|
| 110 |
+
<i data-feather="chevron-right"></i>
|
| 111 |
+
</div>
|
| 112 |
+
<div class="control-btn ml-4" id="jump-btn">
|
| 113 |
+
<i data-feather="arrow-up"></i>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
|
| 119 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 120 |
+
<script>
|
| 121 |
+
// Loading simulation
|
| 122 |
+
let progress = 0;
|
| 123 |
+
const progressBar = document.getElementById('progress-bar');
|
| 124 |
+
const loadingInterval = setInterval(() => {
|
| 125 |
+
progress += Math.random() * 10;
|
| 126 |
+
if (progress > 100) progress = 100;
|
| 127 |
+
progressBar.style.width = `${progress}%`;
|
| 128 |
+
|
| 129 |
+
if (progress === 100) {
|
| 130 |
+
clearInterval(loadingInterval);
|
| 131 |
+
setTimeout(() => {
|
| 132 |
+
document.getElementById('loading-screen').style.display = 'none';
|
| 133 |
+
initGame();
|
| 134 |
+
}, 500);
|
| 135 |
+
}
|
| 136 |
+
}, 300);
|
| 137 |
+
|
| 138 |
+
// Game initialization
|
| 139 |
+
function initGame() {
|
| 140 |
+
feather.replace();
|
| 141 |
+
|
| 142 |
+
// Three.js setup
|
| 143 |
+
const scene = new THREE.Scene();
|
| 144 |
+
scene.background = new THREE.Color(0x87CEEB); // Sky blue
|
| 145 |
+
|
| 146 |
+
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
|
| 147 |
+
camera.position.set(0, 10, 20);
|
| 148 |
+
|
| 149 |
+
const renderer = new THREE.WebGLRenderer({ antialias: true });
|
| 150 |
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 151 |
+
renderer.shadowMap.enabled = true;
|
| 152 |
+
document.body.appendChild(renderer.domElement);
|
| 153 |
+
|
| 154 |
+
// Controls
|
| 155 |
+
const controls = new THREE.OrbitControls(camera, renderer.domElement);
|
| 156 |
+
controls.enableDamping = true;
|
| 157 |
+
controls.dampingFactor = 0.05;
|
| 158 |
+
|
| 159 |
+
// Lights
|
| 160 |
+
const ambientLight = new THREE.AmbientLight(0xffffff, 0.5);
|
| 161 |
+
scene.add(ambientLight);
|
| 162 |
+
|
| 163 |
+
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
|
| 164 |
+
directionalLight.position.set(10, 20, 10);
|
| 165 |
+
directionalLight.castShadow = true;
|
| 166 |
+
directionalLight.shadow.mapSize.width = 2048;
|
| 167 |
+
directionalLight.shadow.mapSize.height = 2048;
|
| 168 |
+
scene.add(directionalLight);
|
| 169 |
+
|
| 170 |
+
// Simple beach environment
|
| 171 |
+
const sandGeometry = new THREE.PlaneGeometry(100, 100);
|
| 172 |
+
const sandMaterial = new THREE.MeshStandardMaterial({
|
| 173 |
+
color: 0xF5DEB3,
|
| 174 |
+
roughness: 1.0
|
| 175 |
+
});
|
| 176 |
+
const sand = new THREE.Mesh(sandGeometry, sandMaterial);
|
| 177 |
+
sand.rotation.x = -Math.PI / 2;
|
| 178 |
+
sand.receiveShadow = true;
|
| 179 |
+
scene.add(sand);
|
| 180 |
+
|
| 181 |
+
// Ocean
|
| 182 |
+
const waterGeometry = new THREE.PlaneGeometry(200, 200);
|
| 183 |
+
const waterMaterial = new THREE.MeshStandardMaterial({
|
| 184 |
+
color: 0x1E90FF,
|
| 185 |
+
transparent: true,
|
| 186 |
+
opacity: 0.8,
|
| 187 |
+
roughness: 0.1,
|
| 188 |
+
metalness: 0.5
|
| 189 |
+
});
|
| 190 |
+
const water = new THREE.Mesh(waterGeometry, waterMaterial);
|
| 191 |
+
water.rotation.x = -Math.PI / 2;
|
| 192 |
+
water.position.y = -0.5;
|
| 193 |
+
water.position.z = -50;
|
| 194 |
+
scene.add(water);
|
| 195 |
+
|
| 196 |
+
// Simple placeholder for Barbie (we would normally use a 3D model here)
|
| 197 |
+
const barbieGeometry = new THREE.BoxGeometry(1, 2, 0.5);
|
| 198 |
+
const barbieMaterial = new THREE.MeshStandardMaterial({
|
| 199 |
+
color: 0xFF69B4,
|
| 200 |
+
roughness: 0.3,
|
| 201 |
+
metalness: 0.1
|
| 202 |
+
});
|
| 203 |
+
const barbie = new THREE.Mesh(barbieGeometry, barbieMaterial);
|
| 204 |
+
barbie.castShadow = true;
|
| 205 |
+
barbie.position.y = 1;
|
| 206 |
+
scene.add(barbie);
|
| 207 |
+
|
| 208 |
+
// Add some beach items
|
| 209 |
+
const addBeachItem = (x, z, color, size) => {
|
| 210 |
+
const geometry = new THREE.SphereGeometry(size[0], size[1], size[2]);
|
| 211 |
+
const material = new THREE.MeshStandardMaterial({ color });
|
| 212 |
+
const item = new THREE.Mesh(geometry, material);
|
| 213 |
+
item.position.set(x, size[0], z);
|
| 214 |
+
item.castShadow = true;
|
| 215 |
+
scene.add(item);
|
| 216 |
+
return item;
|
| 217 |
+
};
|
| 218 |
+
|
| 219 |
+
const beachBall = addBeachItem(5, 0, 0xFF0000, [1, 16, 16]);
|
| 220 |
+
const umbrella = addBeachItem(-5, 5, 0x00FF00, [0.5, 8, 4]);
|
| 221 |
+
|
| 222 |
+
// Game state
|
| 223 |
+
let score = 0;
|
| 224 |
+
let time = 60;
|
| 225 |
+
let gameActive = true;
|
| 226 |
+
|
| 227 |
+
const scoreElement = document.getElementById('score');
|
| 228 |
+
const timerElement = document.getElementById('timer');
|
| 229 |
+
|
| 230 |
+
// Game timer
|
| 231 |
+
const timerInterval = setInterval(() => {
|
| 232 |
+
if (!gameActive) return;
|
| 233 |
+
|
| 234 |
+
time--;
|
| 235 |
+
timerElement.textContent = time;
|
| 236 |
+
|
| 237 |
+
if (time <= 0) {
|
| 238 |
+
gameActive = false;
|
| 239 |
+
clearInterval(timerInterval);
|
| 240 |
+
alert(`Game Over! Your score: ${score}`);
|
| 241 |
+
}
|
| 242 |
+
}, 1000);
|
| 243 |
+
|
| 244 |
+
// Controls
|
| 245 |
+
const moveSpeed = 0.2;
|
| 246 |
+
const jumpHeight = 5;
|
| 247 |
+
let isJumping = false;
|
| 248 |
+
|
| 249 |
+
document.getElementById('up-btn').addEventListener('click', () => {
|
| 250 |
+
barbie.position.z -= moveSpeed;
|
| 251 |
+
});
|
| 252 |
+
|
| 253 |
+
document.getElementById('down-btn').addEventListener('click', () => {
|
| 254 |
+
barbie.position.z += moveSpeed;
|
| 255 |
+
});
|
| 256 |
+
|
| 257 |
+
document.getElementById('left-btn').addEventListener('click', () => {
|
| 258 |
+
barbie.position.x -= moveSpeed;
|
| 259 |
+
barbie.rotation.y = -Math.PI / 2;
|
| 260 |
+
});
|
| 261 |
+
|
| 262 |
+
document.getElementById('right-btn').addEventListener('click', () => {
|
| 263 |
+
barbie.position.x += moveSpeed;
|
| 264 |
+
barbie.rotation.y = Math.PI / 2;
|
| 265 |
+
});
|
| 266 |
+
|
| 267 |
+
document.getElementById('jump-btn').addEventListener('click', () => {
|
| 268 |
+
if (!isJumping) {
|
| 269 |
+
isJumping = true;
|
| 270 |
+
barbie.position.y += jumpHeight;
|
| 271 |
+
setTimeout(() => {
|
| 272 |
+
barbie.position.y = 1;
|
| 273 |
+
isJumping = false;
|
| 274 |
+
}, 500);
|
| 275 |
+
}
|
| 276 |
+
});
|
| 277 |
+
|
| 278 |
+
// Keyboard controls
|
| 279 |
+
document.addEventListener('keydown', (event) => {
|
| 280 |
+
switch(event.key) {
|
| 281 |
+
case 'ArrowUp':
|
| 282 |
+
barbie.position.z -= moveSpeed;
|
| 283 |
+
barbie.rotation.y = 0;
|
| 284 |
+
break;
|
| 285 |
+
case 'ArrowDown':
|
| 286 |
+
barbie.position.z += moveSpeed;
|
| 287 |
+
barbie.rotation.y = Math.PI;
|
| 288 |
+
break;
|
| 289 |
+
case 'ArrowLeft':
|
| 290 |
+
barbie.position.x -= moveSpeed;
|
| 291 |
+
barbie.rotation.y = -Math.PI / 2;
|
| 292 |
+
break;
|
| 293 |
+
case 'ArrowRight':
|
| 294 |
+
barbie.position.x += moveSpeed;
|
| 295 |
+
barbie.rotation.y = Math.PI / 2;
|
| 296 |
+
break;
|
| 297 |
+
case ' ':
|
| 298 |
+
if (!isJumping) {
|
| 299 |
+
isJumping = true;
|
| 300 |
+
barbie.position.y += jumpHeight;
|
| 301 |
+
setTimeout(() => {
|
| 302 |
+
barbie.position.y = 1;
|
| 303 |
+
isJumping = false;
|
| 304 |
+
}, 500);
|
| 305 |
+
}
|
| 306 |
+
break;
|
| 307 |
+
}
|
| 308 |
+
});
|
| 309 |
+
|
| 310 |
+
// Collision detection
|
| 311 |
+
const checkCollision = () => {
|
| 312 |
+
const distanceToBall = barbie.position.distanceTo(beachBall.position);
|
| 313 |
+
if (distanceToBall < 2) {
|
| 314 |
+
score += 10;
|
| 315 |
+
scoreElement.textContent = score;
|
| 316 |
+
|
| 317 |
+
// Move the beach ball to a new random position
|
| 318 |
+
beachBall.position.x = Math.random() * 30 - 15;
|
| 319 |
+
beachBall.position.z = Math.random() * 30 - 15;
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
const distanceToUmbrella = barbie.position.distanceTo(umbrella.position);
|
| 323 |
+
if (distanceToUmbrella < 2) {
|
| 324 |
+
score += 5;
|
| 325 |
+
scoreElement.textContent = score;
|
| 326 |
+
|
| 327 |
+
// Move the umbrella to a new random position
|
| 328 |
+
umbrella.position.x = Math.random() * 30 - 15;
|
| 329 |
+
umbrella.position.z = Math.random() * 30 - 15;
|
| 330 |
+
}
|
| 331 |
+
};
|
| 332 |
+
|
| 333 |
+
// Animation loop
|
| 334 |
+
function animate() {
|
| 335 |
+
requestAnimationFrame(animate);
|
| 336 |
+
|
| 337 |
+
controls.update();
|
| 338 |
+
checkCollision();
|
| 339 |
+
|
| 340 |
+
// Simple wave animation for the beach ball
|
| 341 |
+
beachBall.rotation.x += 0.01;
|
| 342 |
+
beachBall.rotation.z += 0.01;
|
| 343 |
+
|
| 344 |
+
renderer.render(scene, camera);
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
// Handle window resize
|
| 348 |
+
window.addEventListener('resize', () => {
|
| 349 |
+
camera.aspect = window.innerWidth / window.innerHeight;
|
| 350 |
+
camera.updateProjectionMatrix();
|
| 351 |
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 352 |
+
});
|
| 353 |
+
|
| 354 |
+
animate();
|
| 355 |
+
}
|
| 356 |
+
</script>
|
| 357 |
+
</body>
|
| 358 |
</html>
|