Spaces:
Running
Running
Download components/button.js from Sjokode/matiniktaff: direct link, hf CLI and curl.
- Browser
- Download file 538 Bytes
-
https://huggingface.co/spaces/Sjokode/matiniktaff/resolve/main/components/button.js
- Command line
-
hf download hf://spaces/Sjokode/matiniktaff/components/button.js
-
curl -L -o button.js https://huggingface.co/spaces/Sjokode/matiniktaff/resolve/main/components/button.js
538 Bytes
| class CustomButton extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| button { | |
| background: #667eea; | |
| color: white; | |
| padding: 0.5rem 1rem; | |
| border-radius: 0.375rem; | |
| transition: all 0.3s ease; | |
| } | |
| button:hover { | |
| background: #5a67d8; | |
| } | |
| </style> | |
| <button> | |
| <slot></slot> | |
| </button> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-button', CustomButton); |