Spaces:
Running
Running
Download components/cta-button.js from nricchelly/buildmaster-elegance: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/spaces/nricchelly/buildmaster-elegance/resolve/main/components/cta-button.js
- Command line
-
hf download hf://spaces/nricchelly/buildmaster-elegance/components/cta-button.js
-
curl -L -o cta-button.js https://huggingface.co/spaces/nricchelly/buildmaster-elegance/resolve/main/components/cta-button.js
1.19 kB
| class CtaButton extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: inline-block; | |
| } | |
| button { | |
| background-color: var(--primary); | |
| color: white; | |
| font-weight: 600; | |
| padding: 0.75rem 2rem; | |
| border-radius: 4px; | |
| border: none; | |
| cursor: pointer; | |
| transition: all 0.3s ease; | |
| text-transform: uppercase; | |
| letter-spacing: 0.05em; | |
| font-size: 0.9rem; | |
| } | |
| button:hover { | |
| background-color: #e05500; | |
| transform: translateY(-2px); | |
| box-shadow: 0 4px 12px rgba(255, 95, 0, 0.2); | |
| } | |
| button.secondary { | |
| background-color: transparent; | |
| border: 2px solid var(--primary); | |
| color: var(--primary); | |
| } | |
| button.secondary:hover { | |
| background-color: var(--primary); | |
| color: white; | |
| } | |
| </style> | |
| <button class="${this.getAttribute('variant') || 'primary'}"> | |
| <slot></slot> | |
| </button> | |
| `; | |
| } | |
| } | |
| customElements.define('cta-button', CtaButton); |