Spaces:
Running
Running
make me a program, program of a simulation in which we can choose a rectangfle or circle that we can place a tiny ball or square like the dvd player bouncing off but its a ball or a square in a rectangle, square or ball and we can choose in wich direction/angle we are going to throw it and it is going to bounce like the dvd and also make it so that there is an option to see a trail
86134e2 verified Download components/header.js from SA34764/bouncebox-simulator: direct link, hf CLI and curl.
- Browser
- Download file 3.17 kB
-
https://huggingface.co/spaces/SA34764/bouncebox-simulator/resolve/main/components/header.js
- Command line
-
hf download hf://spaces/SA34764/bouncebox-simulator/components/header.js
-
curl -L -o header.js https://huggingface.co/spaces/SA34764/bouncebox-simulator/resolve/main/components/header.js
3.17 kB
| class CustomHeader extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| header { | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| color: white; | |
| padding: 1rem 0; | |
| box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); | |
| } | |
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 0 1rem; | |
| } | |
| .nav-content { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .logo { | |
| display: flex; | |
| align-items: center; | |
| font-size: 1.5rem; | |
| font-weight: bold; | |
| text-decoration: none; | |
| color: white; | |
| } | |
| .logo:hover { | |
| transform: scale(1.05); | |
| transition: transform 0.2s; | |
| } | |
| .nav-links { | |
| display: flex; | |
| gap: 2rem; | |
| align-items: center; | |
| } | |
| .nav-link { | |
| color: white; | |
| text-decoration: none; | |
| font-weight: 500; | |
| transition: color 0.2s; | |
| } | |
| .nav-link:hover { | |
| color: #e5e7eb; | |
| } | |
| @media (max-width: 768px) { | |
| .nav-links { | |
| gap: 1rem; | |
| } | |
| .logo-text { | |
| display: none; | |
| } | |
| } | |
| </style> | |
| <header> | |
| <div class="container"> | |
| <nav class="nav-content"> | |
| <a href="/" class="logo"> | |
| <i data-feather="target"></i> | |
| <span class="logo-text ml-2">BounceBox Simulator</span> | |
| </a> | |
| <div class="nav-links"> | |
| <a href="/" class="nav-link flex items-center"> | |
| <i data-feather="home" class="w-4 h-4 mr-1"></i> | |
| <span class="hidden sm:inline">Home</span> | |
| </a> | |
| <a href="#" class="nav-link flex items-center"> | |
| <i data-feather="info" class="w-4 h-4 mr-1"></i> | |
| <span class="hidden sm:inline">About</span> | |
| </a> | |
| </div> | |
| </nav> | |
| </div> | |
| </header> | |
| `; | |
| // Replace feather icons after rendering | |
| setTimeout(() => { | |
| if (window.feather) { | |
| window.feather.replace(); | |
| } | |
| }, 100); | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |