Spaces:
Running
Running
| class PdfPreview extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| .preview-container { | |
| border: 2px dashed #e2e8f0; | |
| border-radius: 0.5rem; | |
| padding: 1rem; | |
| background-color: #f8fafc; | |
| text-align: center; | |
| transition: all 0.2s; | |
| } | |
| .preview-container:hover { | |
| border-color: #818cf8; | |
| } | |
| .preview-text { | |
| color: #64748b; | |
| margin-bottom: 0.5rem; | |
| } | |
| .preview-image { | |
| max-width: 100%; | |
| max-height: 300px; | |
| margin-top: 1rem; | |
| border-radius: 0.25rem; | |
| box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); | |
| } | |
| </style> | |
| <div class="preview-container"> | |
| <p class="preview-text">PDF preview will appear here</p> | |
| <slot></slot> | |
| </div> | |
| `; | |
| } | |
| } | |
| customElements.define('pdf-preview', PdfPreview); |