aicoding101 commited on
Commit
88a780a
·
verified ·
1 Parent(s): d191a9f

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +6 -4
  2. index.html +302 -19
  3. prompts.txt +0 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: J J
3
- emoji: 🏢
4
- colorFrom: yellow
5
  colorTo: red
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: j-j
3
+ emoji: 🐳
4
+ colorFrom: green
5
  colorTo: red
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,302 @@
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>Moonlit Owl Animation</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/gsap@3.11.4/dist/gsap.min.js"></script>
10
+ <style>
11
+ body {
12
+ margin: 0;
13
+ overflow: hidden;
14
+ background-color: #0a0a1a;
15
+ }
16
+ canvas {
17
+ display: block;
18
+ }
19
+ #sound-btn {
20
+ position: absolute;
21
+ bottom: 20px;
22
+ left: 50%;
23
+ transform: translateX(-50%);
24
+ background: rgba(255, 255, 255, 0.2);
25
+ border: 2px solid white;
26
+ color: white;
27
+ padding: 10px 20px;
28
+ border-radius: 30px;
29
+ cursor: pointer;
30
+ font-family: 'Arial', sans-serif;
31
+ font-weight: bold;
32
+ backdrop-filter: blur(5px);
33
+ transition: all 0.3s ease;
34
+ }
35
+ #sound-btn:hover {
36
+ background: rgba(255, 255, 255, 0.3);
37
+ transform: translateX(-50%) scale(1.05);
38
+ }
39
+ #instructions {
40
+ position: absolute;
41
+ top: 20px;
42
+ left: 50%;
43
+ transform: translateX(-50%);
44
+ color: white;
45
+ text-align: center;
46
+ font-family: 'Arial', sans-serif;
47
+ background: rgba(0, 0, 0, 0.5);
48
+ padding: 10px 20px;
49
+ border-radius: 10px;
50
+ font-size: 14px;
51
+ }
52
+ .moon {
53
+ position: absolute;
54
+ top: 50px;
55
+ right: 50px;
56
+ width: 80px;
57
+ height: 80px;
58
+ background: radial-gradient(circle, #f5f3ce 0%, #e8e6b5 70%);
59
+ border-radius: 50%;
60
+ box-shadow: 0 0 40px 15px rgba(245, 243, 206, 0.4);
61
+ z-index: 1;
62
+ }
63
+ </style>
64
+ </head>
65
+ <body>
66
+ <div class="moon"></div>
67
+ <div id="instructions">Click the owl to hear it hoot!</div>
68
+ <button id="sound-btn">Toggle Sound</button>
69
+
70
+ <script>
71
+ // Initialize Three.js scene
72
+ const scene = new THREE.Scene();
73
+ const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
74
+ const renderer = new THREE.WebGLRenderer({ antialias: true });
75
+ renderer.setSize(window.innerWidth, window.innerHeight);
76
+ renderer.setClearColor(0x0a0a1a);
77
+ document.body.appendChild(renderer.domElement);
78
+
79
+ // Add stars
80
+ const starsGeometry = new THREE.BufferGeometry();
81
+ const starsMaterial = new THREE.PointsMaterial({
82
+ color: 0xffffff,
83
+ size: 0.1,
84
+ transparent: true,
85
+ opacity: 0.8
86
+ });
87
+
88
+ const starsVertices = [];
89
+ for (let i = 0; i < 1000; i++) {
90
+ const x = (Math.random() - 0.5) * 2000;
91
+ const y = (Math.random() - 0.5) * 2000;
92
+ const z = (Math.random() - 0.5) * 2000;
93
+ starsVertices.push(x, y, z);
94
+ }
95
+
96
+ starsGeometry.setAttribute('position', new THREE.Float32BufferAttribute(starsVertices, 3));
97
+ const stars = new THREE.Points(starsGeometry, starsMaterial);
98
+ scene.add(stars);
99
+
100
+ // Create owl
101
+ const owlGroup = new THREE.Group();
102
+ scene.add(owlGroup);
103
+
104
+ // Owl body
105
+ const bodyGeometry = new THREE.SphereGeometry(1, 32, 32);
106
+ const bodyMaterial = new THREE.MeshPhongMaterial({
107
+ color: 0x5a4a3a,
108
+ shininess: 30
109
+ });
110
+ const body = new THREE.Mesh(bodyGeometry, bodyMaterial);
111
+ owlGroup.add(body);
112
+
113
+ // Owl head
114
+ const headGeometry = new THREE.SphereGeometry(0.8, 32, 32);
115
+ const headMaterial = new THREE.MeshPhongMaterial({
116
+ color: 0x5a4a3a,
117
+ shininess: 30
118
+ });
119
+ const head = new THREE.Mesh(headGeometry, headMaterial);
120
+ head.position.y = 0.8;
121
+ owlGroup.add(head);
122
+
123
+ // Owl eyes
124
+ const eyeGeometry = new THREE.SphereGeometry(0.2, 32, 32);
125
+ const eyeMaterial = new THREE.MeshPhongMaterial({ color: 0xffffff });
126
+
127
+ const leftEye = new THREE.Mesh(eyeGeometry, eyeMaterial);
128
+ leftEye.position.set(-0.3, 0.9, 0.6);
129
+ owlGroup.add(leftEye);
130
+
131
+ const rightEye = new THREE.Mesh(eyeGeometry, eyeMaterial);
132
+ rightEye.position.set(0.3, 0.9, 0.6);
133
+ owlGroup.add(rightEye);
134
+
135
+ // Owl pupils
136
+ const pupilGeometry = new THREE.SphereGeometry(0.1, 32, 32);
137
+ const pupilMaterial = new THREE.MeshPhongMaterial({ color: 0x000000 });
138
+
139
+ const leftPupil = new THREE.Mesh(pupilGeometry, pupilMaterial);
140
+ leftPupil.position.set(-0.3, 0.9, 0.8);
141
+ owlGroup.add(leftPupil);
142
+
143
+ const rightPupil = new THREE.Mesh(pupilGeometry, pupilMaterial);
144
+ rightPupil.position.set(0.3, 0.9, 0.8);
145
+ owlGroup.add(rightPupil);
146
+
147
+ // Owl beak
148
+ const beakGeometry = new THREE.ConeGeometry(0.1, 0.3, 32);
149
+ const beakMaterial = new THREE.MeshPhongMaterial({ color: 0xf5a742 });
150
+ const beak = new THREE.Mesh(beakGeometry, beakMaterial);
151
+ beak.position.set(0, 0.7, 0.8);
152
+ beak.rotation.x = Math.PI / 2;
153
+ owlGroup.add(beak);
154
+
155
+ // Owl wings
156
+ const wingGeometry = new THREE.SphereGeometry(0.8, 32, 32);
157
+ wingGeometry.scale(1, 0.2, 0.5);
158
+
159
+ const leftWing = new THREE.Mesh(wingGeometry, bodyMaterial);
160
+ leftWing.position.set(-1, 0, 0);
161
+ owlGroup.add(leftWing);
162
+
163
+ const rightWing = new THREE.Mesh(wingGeometry, bodyMaterial);
164
+ rightWing.position.set(1, 0, 0);
165
+ owlGroup.add(rightWing);
166
+
167
+ // Add lighting
168
+ const moonLight = new THREE.PointLight(0xf5f3ce, 1, 100);
169
+ moonLight.position.set(10, 10, 10);
170
+ scene.add(moonLight);
171
+
172
+ const ambientLight = new THREE.AmbientLight(0x404040);
173
+ scene.add(ambientLight);
174
+
175
+ // Position camera
176
+ camera.position.z = 5;
177
+
178
+ // Animation variables
179
+ let wingFlapSpeed = 0.1;
180
+ let owlPosition = { x: 0, y: 0, z: 0 };
181
+ let targetPosition = { x: 0, y: 0, z: 0 };
182
+ let flightPath = [];
183
+ let currentPathIndex = 0;
184
+
185
+ // Generate random flight path
186
+ for (let i = 0; i < 10; i++) {
187
+ flightPath.push({
188
+ x: (Math.random() - 0.5) * 10,
189
+ y: (Math.random() - 0.5) * 5,
190
+ z: (Math.random() - 0.5) * 10
191
+ });
192
+ }
193
+
194
+ // Sound setup
195
+ let audioContext;
196
+ let gainNode;
197
+ let soundEnabled = true;
198
+ const soundBtn = document.getElementById('sound-btn');
199
+
200
+ function initAudio() {
201
+ audioContext = new (window.AudioContext || window.webkitAudioContext)();
202
+ gainNode = audioContext.createGain();
203
+ gainNode.gain.value = 0.5;
204
+ gainNode.connect(audioContext.destination);
205
+ }
206
+
207
+ function playHoot() {
208
+ if (!soundEnabled || !audioContext) return;
209
+
210
+ const oscillator = audioContext.createOscillator();
211
+ const gain = audioContext.createGain();
212
+
213
+ oscillator.type = 'sine';
214
+ oscillator.frequency.setValueAtTime(300, audioContext.currentTime);
215
+ oscillator.frequency.exponentialRampToValueAtTime(200, audioContext.currentTime + 0.5);
216
+
217
+ gain.gain.setValueAtTime(0.3, audioContext.currentTime);
218
+ gain.gain.exponentialRampToValueAtTime(0.001, audioContext.currentTime + 0.5);
219
+
220
+ oscillator.connect(gain);
221
+ gain.connect(gainNode);
222
+
223
+ oscillator.start();
224
+ oscillator.stop(audioContext.currentTime + 0.5);
225
+ }
226
+
227
+ // Toggle sound
228
+ soundBtn.addEventListener('click', () => {
229
+ soundEnabled = !soundEnabled;
230
+ soundBtn.textContent = soundEnabled ? 'Sound: ON' : 'Sound: OFF';
231
+ });
232
+
233
+ // Owl click event
234
+ renderer.domElement.addEventListener('click', (event) => {
235
+ const mouse = new THREE.Vector2(
236
+ (event.clientX / window.innerWidth) * 2 - 1,
237
+ -(event.clientY / window.innerHeight) * 2 + 1
238
+ );
239
+
240
+ const raycaster = new THREE.Raycaster();
241
+ raycaster.setFromCamera(mouse, camera);
242
+
243
+ const intersects = raycaster.intersectObject(owlGroup, true);
244
+
245
+ if (intersects.length > 0) {
246
+ playHoot();
247
+
248
+ // Change flight path when clicked
249
+ currentPathIndex = (currentPathIndex + 1) % flightPath.length;
250
+ targetPosition = flightPath[currentPathIndex];
251
+
252
+ // Increase wing flap speed temporarily
253
+ wingFlapSpeed = 0.3;
254
+ setTimeout(() => { wingFlapSpeed = 0.1; }, 1000);
255
+ }
256
+ });
257
+
258
+ // Handle window resize
259
+ window.addEventListener('resize', () => {
260
+ camera.aspect = window.innerWidth / window.innerHeight;
261
+ camera.updateProjectionMatrix();
262
+ renderer.setSize(window.innerWidth, window.innerHeight);
263
+ });
264
+
265
+ // Animation loop
266
+ function animate() {
267
+ requestAnimationFrame(animate);
268
+
269
+ // Update owl position towards target
270
+ owlPosition.x += (targetPosition.x - owlPosition.x) * 0.01;
271
+ owlPosition.y += (targetPosition.y - owlPosition.y) * 0.01;
272
+ owlPosition.z += (targetPosition.z - owlPosition.z) * 0.01;
273
+
274
+ owlGroup.position.set(owlPosition.x, owlPosition.y, owlPosition.z);
275
+
276
+ // Make owl look forward in its direction of movement
277
+ if (Math.abs(targetPosition.x - owlPosition.x) > 0.1 ||
278
+ Math.abs(targetPosition.z - owlPosition.z) > 0.1) {
279
+ const angle = Math.atan2(
280
+ targetPosition.x - owlPosition.x,
281
+ targetPosition.z - owlPosition.z
282
+ );
283
+ owlGroup.rotation.y = angle;
284
+ }
285
+
286
+ // Wing flapping animation
287
+ const time = Date.now() * 0.001;
288
+ leftWing.rotation.z = Math.sin(time * 5 * wingFlapSpeed) * 0.5;
289
+ rightWing.rotation.z = -Math.sin(time * 5 * wingFlapSpeed) * 0.5;
290
+
291
+ // Rotate stars for parallax effect
292
+ stars.rotation.y += 0.0001;
293
+
294
+ renderer.render(scene, camera);
295
+ }
296
+
297
+ // Initialize audio and start animation
298
+ initAudio();
299
+ animate();
300
+ </script>
301
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=aicoding101/j-j" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
302
+ </html>
prompts.txt ADDED
File without changes