Spaces:
Running
Running
یک سایت ساده که فقط یک شی 3d چرخان و مهندسی رو نشون بده
Browse files- README.md +8 -5
- index.html +105 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Spinny Tech Cube
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Spinny Tech Cube 3D 🌀
|
| 3 |
+
colorFrom: green
|
| 4 |
+
colorTo: pink
|
| 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,106 @@
|
|
| 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>Spinny Tech Cube 3D</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/vanta@latest/dist/vanta.globe.min.js"></script>
|
| 10 |
+
<style>
|
| 11 |
+
body {
|
| 12 |
+
margin: 0;
|
| 13 |
+
overflow: hidden;
|
| 14 |
+
}
|
| 15 |
+
.info {
|
| 16 |
+
position: absolute;
|
| 17 |
+
bottom: 20px;
|
| 18 |
+
width: 100%;
|
| 19 |
+
text-align: center;
|
| 20 |
+
z-index: 100;
|
| 21 |
+
color: white;
|
| 22 |
+
font-family: 'Arial', sans-serif;
|
| 23 |
+
pointer-events: none;
|
| 24 |
+
text-shadow: 0 0 5px rgba(0,0,0,0.5);
|
| 25 |
+
}
|
| 26 |
+
</style>
|
| 27 |
+
</head>
|
| 28 |
+
<body class="bg-gray-900">
|
| 29 |
+
<div id="canvas-container" class="w-full h-screen"></div>
|
| 30 |
+
<div class="info">
|
| 31 |
+
<h1 class="text-4xl font-bold mb-2">Engineering Cube</h1>
|
| 32 |
+
<p class="text-xl opacity-80">A mesmerizing 3D technical object</p>
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
+
<script>
|
| 36 |
+
// Three.js scene setup
|
| 37 |
+
const container = document.getElementById('canvas-container');
|
| 38 |
+
const scene = new THREE.Scene();
|
| 39 |
+
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
|
| 40 |
+
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
|
| 41 |
+
|
| 42 |
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 43 |
+
container.appendChild(renderer.domElement);
|
| 44 |
+
|
| 45 |
+
// Create a technical-looking cube with wireframe
|
| 46 |
+
const geometry = new THREE.BoxGeometry(2, 2, 2);
|
| 47 |
+
const edges = new THREE.EdgesGeometry(geometry);
|
| 48 |
+
const line = new THREE.LineSegments(
|
| 49 |
+
edges,
|
| 50 |
+
new THREE.LineBasicMaterial({ color: 0x00ffff, linewidth: 2 })
|
| 51 |
+
);
|
| 52 |
+
|
| 53 |
+
const material = new THREE.MeshBasicMaterial({
|
| 54 |
+
color: 0x111111,
|
| 55 |
+
wireframe: true,
|
| 56 |
+
transparent: true,
|
| 57 |
+
opacity: 0.8
|
| 58 |
+
});
|
| 59 |
+
|
| 60 |
+
const cube = new THREE.Mesh(geometry, material);
|
| 61 |
+
scene.add(cube);
|
| 62 |
+
scene.add(line);
|
| 63 |
+
|
| 64 |
+
// Add some orbiting spheres
|
| 65 |
+
const spheres = [];
|
| 66 |
+
const sphereGeo = new THREE.SphereGeometry(0.1, 16, 16);
|
| 67 |
+
const sphereMat = new THREE.MeshBasicMaterial({ color: 0xff00ff });
|
| 68 |
+
|
| 69 |
+
for (let i = 0; i < 8; i++) {
|
| 70 |
+
const sphere = new THREE.Mesh(sphereGeo, sphereMat);
|
| 71 |
+
sphere.position.x = 3 * Math.sin(i * Math.PI / 4);
|
| 72 |
+
sphere.position.z = 3 * Math.cos(i * Math.PI / 4);
|
| 73 |
+
scene.add(sphere);
|
| 74 |
+
spheres.push(sphere);
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
camera.position.z = 5;
|
| 78 |
+
|
| 79 |
+
// Animation loop
|
| 80 |
+
function animate() {
|
| 81 |
+
requestAnimationFrame(animate);
|
| 82 |
+
|
| 83 |
+
cube.rotation.x += 0.01;
|
| 84 |
+
cube.rotation.y += 0.01;
|
| 85 |
+
line.rotation.x = cube.rotation.x;
|
| 86 |
+
line.rotation.y = cube.rotation.y;
|
| 87 |
+
|
| 88 |
+
spheres.forEach((sphere, i) => {
|
| 89 |
+
sphere.position.x = 3 * Math.sin(Date.now() * 0.001 + i * Math.PI / 4);
|
| 90 |
+
sphere.position.z = 3 * Math.cos(Date.now() * 0.001 + i * Math.PI / 4);
|
| 91 |
+
});
|
| 92 |
+
|
| 93 |
+
renderer.render(scene, camera);
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
// Handle window resize
|
| 97 |
+
window.addEventListener('resize', () => {
|
| 98 |
+
camera.aspect = window.innerWidth / window.innerHeight;
|
| 99 |
+
camera.updateProjectionMatrix();
|
| 100 |
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 101 |
+
});
|
| 102 |
+
|
| 103 |
+
animate();
|
| 104 |
+
</script>
|
| 105 |
+
</body>
|
| 106 |
</html>
|