Download index.html from 5XPU223/a-href-https-example-com-a: direct link, hf CLI and curl.
- Browser
- Download file 8.01 kB
-
https://huggingface.co/spaces/5XPU223/a-href-https-example-com-a/resolve/7733bea70077906f2f0a3017239639cc3e49edd5/index.html
- Command line
-
hf download hf://spaces/5XPU223/a-href-https-example-com-a@7733bea70077906f2f0a3017239639cc3e49edd5/index.html
-
curl -L -o index.html https://huggingface.co/spaces/5XPU223/a-href-https-example-com-a/resolve/7733bea70077906f2f0a3017239639cc3e49edd5/index.html
8.01 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>3D Particle Animation</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script> | |
| <style> | |
| body { | |
| margin: 0; | |
| overflow: hidden; | |
| background-color: #000; | |
| } | |
| canvas { | |
| display: block; | |
| } | |
| .loading { | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| transform: translate(-50%, -50%); | |
| color: white; | |
| font-family: 'Arial', sans-serif; | |
| font-size: 24px; | |
| } | |
| .ui-overlay { | |
| position: absolute; | |
| bottom: 2rem; | |
| left: 50%; | |
| transform: translateX(-50%); | |
| color: white; | |
| text-align: center; | |
| font-family: 'Arial', sans-serif; | |
| z-index: 100; | |
| } | |
| .controls { | |
| position: absolute; | |
| top: 2rem; | |
| right: 2rem; | |
| z-index: 100; | |
| display: flex; | |
| gap: 1rem; | |
| } | |
| .control-btn { | |
| background: rgba(255,255,255,0.2); | |
| border: none; | |
| color: white; | |
| width: 40px; | |
| height: 40px; | |
| border-radius: 50%; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| cursor: pointer; | |
| transition: all 0.3s ease; | |
| } | |
| .control-btn:hover { | |
| background: rgba(255,255,255,0.4); | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="loading">Loading...</div> | |
| <div class="ui-overlay" id="uiOverlay"> | |
| <h1 class="text-4xl font-bold mb-2">S N X</h1> | |
| <p class="opacity-80">Interactive 3D particle experience</p> | |
| </div> | |
| <div class="controls"> | |
| <button class="control-btn" id="colorBtn"> | |
| <i data-feather="droplet"></i> | |
| </button> | |
| <button class="control-btn" id="sizeBtn"> | |
| <i data-feather="maximize-2"></i> | |
| </button> | |
| <button class="control-btn" id="resetBtn"> | |
| <i data-feather="refresh-cw"></i> | |
| </button> | |
| </div> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script> | |
| // Scene setup | |
| const scene = new THREE.Scene(); | |
| const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); | |
| const renderer = new THREE.WebGLRenderer({ antialias: true }); | |
| renderer.setSize(window.innerWidth, window.innerHeight); | |
| renderer.setPixelRatio(window.devicePixelRatio); | |
| document.body.appendChild(renderer.domElement); | |
| // Remove loading text | |
| document.querySelector('.loading').remove(); | |
| feather.replace(); | |
| // Particle setup | |
| const particleGeometry = new THREE.BufferGeometry(); | |
| const particleCount = 15000; | |
| const posArray = new Float32Array(particleCount * 3); | |
| for(let i = 0; i < particleCount * 3; i++) { | |
| posArray[i] = (Math.random() - 0.5) * 15; | |
| } | |
| particleGeometry.setAttribute('position', new THREE.BufferAttribute(posArray, 3)); | |
| const particleMaterial = new THREE.PointsMaterial({ | |
| size: 0.03, | |
| color: 0xffffff, | |
| transparent: true, | |
| opacity: 1, | |
| blending: THREE.AdditiveBlending | |
| }); | |
| const particles = new THREE.Points(particleGeometry, particleMaterial); | |
| scene.add(particles); | |
| // Text setup | |
| const fontLoader = new THREE.FontLoader(); | |
| fontLoader.load('https://threejs.org/examples/fonts/helvetiker_regular.typeface.json', (font) => { | |
| const textGeometry = new THREE.TextGeometry('S N X', { | |
| font: font, | |
| size: 0.8, | |
| height: 0.3, | |
| curveSegments: 12, | |
| bevelEnabled: true, | |
| bevelThickness: 0.05, | |
| bevelSize: 0.03, | |
| bevelOffset: 0, | |
| bevelSegments: 5 | |
| }); | |
| const textMaterial = new THREE.MeshBasicMaterial({ | |
| color: 0xffffff, | |
| wireframe: true, | |
| transparent: true, | |
| opacity: 1.5 | |
| }); | |
| const textMesh = new THREE.Mesh(textGeometry, textMaterial); | |
| // Positioning text in the center | |
| textGeometry.computeBoundingBox(); | |
| const textWidth = textGeometry.boundingBox.max.x - textGeometry.boundingBox.min.x; | |
| textMesh.position.set(-textWidth / 2, -0.5, 0); | |
| // Add subtle duplicate text behind | |
| const textMaterial2 = new THREE.MeshBasicMaterial({ | |
| color: 0xffffff, | |
| wireframe: true, | |
| transparent: true, | |
| opacity: 0.5 | |
| }); | |
| scene.add(textMesh); | |
| }); | |
| // Camera position | |
| camera.position.z = 5; | |
| // Animation variables | |
| let rotationSpeedX = 0.0005; | |
| let rotationSpeedY = 0.001; | |
| let isAnimating = true; | |
| // Animation loop | |
| function animate() { | |
| requestAnimationFrame(animate); | |
| if(isAnimating) { | |
| particles.rotation.x += rotationSpeedX; | |
| particles.rotation.y += rotationSpeedY; | |
| } | |
| renderer.render(scene, camera); | |
| } | |
| animate(); | |
| // Handle window resize | |
| window.addEventListener('resize', () => { | |
| camera.aspect = window.innerWidth / window.innerHeight; | |
| camera.updateProjectionMatrix(); | |
| renderer.setSize(window.innerWidth, window.innerHeight); | |
| }); | |
| // UI Controls | |
| const colorBtn = document.getElementById('colorBtn'); | |
| const sizeBtn = document.getElementById('sizeBtn'); | |
| const resetBtn = document.getElementById('resetBtn'); | |
| const uiOverlay = document.getElementById('uiOverlay'); | |
| const colors = [ | |
| 0xffffff, // white | |
| 0xffffff, // white | |
| 0xffffff, // white | |
| 0xffffff, // white | |
| 0xffffff // white | |
| ]; | |
| let colorIndex = 0; | |
| colorBtn.addEventListener('click', () => { | |
| colorIndex = (colorIndex + 1) % colors.length; | |
| particleMaterial.color.setHex(colors[colorIndex]); | |
| }); | |
| sizeBtn.addEventListener('click', () => { | |
| particleMaterial.size = particleMaterial.size === 0.03 ? 0.1 : 0.03; | |
| }); | |
| resetBtn.addEventListener('click', () => { | |
| particleMaterial.color.setHex(0xffffff); | |
| particleMaterial.size = 0.03; | |
| colorIndex = 0; | |
| }); | |
| // Mouse interaction | |
| let mouseX = 0; | |
| let mouseY = 0; | |
| document.addEventListener('mousemove', (event) => { | |
| mouseX = (event.clientX / window.innerWidth) * 2 - 1; | |
| mouseY = -(event.clientY / window.innerHeight) * 2 + 1; | |
| // Update rotation speeds based on mouse position | |
| rotationSpeedX = mouseY * 0.002; | |
| rotationSpeedY = mouseX * 0.002; | |
| }); | |
| // Hide UI after 5 seconds | |
| setTimeout(() => { | |
| uiOverlay.style.opacity = '0'; | |
| uiOverlay.style.transition = 'opacity 1s ease'; | |
| }, 5000); | |
| // Show UI on mouse move | |
| document.addEventListener('mousemove', () => { | |
| uiOverlay.style.opacity = '1'; | |
| clearTimeout(uiTimeout); | |
| uiTimeout = setTimeout(() => { | |
| uiOverlay.style.opacity = '0'; | |
| }, 3000); | |
| }); | |
| let uiTimeout; | |
| </script> | |
| </body> | |
| </html> | |