siruser commited on
Commit
f738c05
·
verified ·
1 Parent(s): f3e1876

یک سایت ساده که فقط یک شی 3d چرخان و مهندسی رو نشون بده

Browse files
Files changed (2) hide show
  1. README.md +8 -5
  2. index.html +105 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Spinny Tech Cube 3d
3
- emoji: 🌍
4
- colorFrom: gray
5
- colorTo: blue
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
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
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>