Spaces:
Running
Running
Download components/loading-spinner.js from bsateeshk/techfolio-nexus: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/bsateeshk/techfolio-nexus/resolve/main/components/loading-spinner.js
- Command line
-
hf download hf://spaces/bsateeshk/techfolio-nexus/components/loading-spinner.js
-
curl -L -o loading-spinner.js https://huggingface.co/spaces/bsateeshk/techfolio-nexus/resolve/main/components/loading-spinner.js
1.18 kB
| // Loading Spinner Web Component | |
| class LoadingSpinner extends HTMLElement { | |
| constructor() { | |
| super(); | |
| this.attachShadow({ mode: 'open' }); | |
| } | |
| connectedCallback() { | |
| const size = this.getAttribute('size') || '40'; | |
| const color = this.getAttribute('color') || '#f59e0b'; | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: inline-block; | |
| } | |
| .spinner { | |
| animation: rotate 2s linear infinite; | |
| width: ${size}px; | |
| height: ${size}px; | |
| } | |
| .circle { | |
| stroke: ${color}; | |
| stroke-width: 3; | |
| stroke-linecap: round; | |
| animation: dash 1.5s ease-in-out infinite; | |
| fill: none; | |
| } | |
| @keyframes rotate { | |
| 100% { transform: rotate(360deg); } | |
| } | |
| @keyframes dash { | |
| 0% { | |
| stroke-dasharray: 1, |