Download components/header.js from serdar779/pixelcraft-ui-studio-modern-web-interface-forge: direct link, hf CLI and curl.
- Browser
- Download file 7.04 kB
-
https://huggingface.co/spaces/serdar779/pixelcraft-ui-studio-modern-web-interface-forge/resolve/main/components/header.js
- Command line
-
hf download hf://spaces/serdar779/pixelcraft-ui-studio-modern-web-interface-forge/components/header.js
-
curl -L -o header.js https://huggingface.co/spaces/serdar779/pixelcraft-ui-studio-modern-web-interface-forge/resolve/main/components/header.js
7.04 kB
| class CustomHeader extends HTMLElement { | |
| constructor() { | |
| super(); | |
| } | |
| static get observedAttributes() { | |
| return ['title', 'subtitle', 'description']; | |
| } | |
| attributeChangedCallback(name, oldValue, newValue) { | |
| if (this.shadowRoot) { | |
| this.render(); | |
| } | |
| } | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.render(); | |
| } | |
| render() { | |
| const title = this.getAttribute('title') || 'PixelCraft UI Studio'; | |
| const subtitle = this.getAttribute('subtitle') || 'Modern Web Interface Forge'; | |
| const description = this.getAttribute('description') || 'Professional UI skeleton built with component architecture'; | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| margin-bottom: 2rem; | |
| } | |
| .header { | |
| background: linear-gradient(135deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.8)); | |
| backdrop-filter: blur(10px); | |
| border-radius: 1rem; | |
| padding: 2rem; | |
| border: 1px solid rgba(255, 255, 255, 0.1); | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .header::before { | |
| content: ''; | |
| position: absolute; | |
| top: 0; | |
| right: 0; | |
| width: 200px; | |
| height: 200px; | |
| background: radial-gradient(circle, rgba(107, 114, 128, 0.1) 0%, transparent 70%); | |
| pointer-events: none; | |
| } | |
| .title { | |
| background: linear-gradient(135deg, #F9FAFB 0%, #9CA3AF 100%); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| background-clip: text; | |
| font-weight: 800; | |
| line-height: 1.2; | |
| } | |
| .subtitle { | |
| color: #6B7280; | |
| font-weight: 600; | |
| letter-spacing: 0.05em; | |
| } | |
| .description { | |
| color: #9CA3AF; | |
| max-width: 48rem; | |
| } | |
| .stats { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); | |
| gap: 1rem; | |
| margin-top: 2rem; | |
| } | |
| .stat-item { | |
| background: rgba(255, 255, 255, 0.05); | |
| border-radius: 0.75rem; | |
| padding: 1rem; | |
| border: 1px solid rgba(255, 255, 255, 0.1); | |
| } | |
| .stat-value { | |
| font-size: 1.5rem; | |
| font-weight: 700; | |
| background: linear-gradient(135deg, #6B7280, #9CA3AF); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| background-clip: text; | |
| } | |
| .stat-label { | |
| color: #9CA3AF; | |
| font-size: 0.875rem; | |
| margin-top: 0.25rem; | |
| } | |
| @media (max-width: 768px) { | |
| .header { | |
| padding: 1.5rem; | |
| } | |
| .stats { | |
| grid-template-columns: 1fr; | |
| } | |
| } | |
| </style> | |
| <div class="header fade-in"> | |
| <div class="flex items-start justify-between"> | |
| <div> | |
| <h1 class="title text-3xl md:text-4xl lg:text-5xl">${title}</h1> | |
| <p class="subtitle text-sm md:text-base mt-2">${subtitle}</p> | |
| <p class="description text-sm md:text-base mt-4">${description}</p> | |
| </div> | |
| <div class="hidden md:flex items-center space-x-2"> | |
| <span class="px-3 py-1 rounded-full text-xs font-medium bg-gray-800 text-gray-300 border border-gray-700"> | |
| <i data-feather="zap" class="w-3 h-3 inline mr-1"></i> | |
| Vite | |
| </span> | |
| <span class="px-3 py-1 rounded-full text-xs font-medium bg-gray-800 text-gray-300 border border-gray-700"> | |
| <i data-feather="wind" class="w-3 h-3 inline mr-1"></i> | |
| Tailwind | |
| </span> | |
| <span class="px-3 py-1 rounded-full text-xs font-medium bg-gray-800 text-gray-300 border border-gray-700"> | |
| <i data-feather="box" class="w-3 h-3 inline mr-1"></i> | |
| Components | |
| </span> | |
| </div> | |
| </div> | |
| <div class="stats"> | |
| <div class="stat-item"> | |
| <div class="stat-value">6+</div> | |
| <div class="stat-label">Component Categories</div> | |
| </div> | |
| <div class="stat-item"> | |
| <div class="stat-value">50+</div> | |
| <div class="stat-label">UI Elements</div> | |
| </div> | |
| <div class="stat-item"> | |
| <div class="stat-value">100%</div> | |
| <div class="stat-label">Responsive</div> | |
| </div> | |
| <div class="stat-item"> | |
| <div class="stat-value">∞</div> | |
| <div class="stat-label">Customizable</div> | |
| </div> | |
| </div> | |
| <div class="flex items-center space-x-4 mt-6"> | |
| <button class="btn btn-primary flex items-center"> | |
| <i data-feather="play" class="w-4 h-4 mr-2"></i> | |
| Get Started | |
| </button> | |
| <button class="btn btn-outline flex items-center"> | |
| <i data-feather="github" class="w-4 h-4 mr-2"></i> | |
| View Source | |
| </button> | |
| <button class="btn btn-ghost flex items-center"> | |
| <i data-feather="download" class="w-4 h-4 mr-2"></i> | |
| Download | |
| </button> | |
| </div> | |
| </div> | |
| `; | |
| // Update feather icons | |
| setTimeout(() => { | |
| feather.replace(); | |
| }, 100); | |
| } | |
| } | |
| customElements.define('custom-header', CustomHeader); |