Download components/preview-window.js from GabHtml/lovelyscript-dreamweaver: direct link, hf CLI and curl.
- Browser
- Download file 2.26 kB
-
https://huggingface.co/spaces/GabHtml/lovelyscript-dreamweaver/resolve/main/components/preview-window.js
- Command line
-
hf download hf://spaces/GabHtml/lovelyscript-dreamweaver/components/preview-window.js
-
curl -L -o preview-window.js https://huggingface.co/spaces/GabHtml/lovelyscript-dreamweaver/resolve/main/components/preview-window.js
2.26 kB
| class PreviewWindow extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| width: 50%; | |
| height: 100%; | |
| position: relative; | |
| } | |
| #preview-container { | |
| width: 100%; | |
| height: 100%; | |
| background-color: #fff1f2; | |
| overflow: hidden; | |
| position: relative; | |
| } | |
| .background-image { | |
| width: 100%; | |
| height: 100%; | |
| object-fit: cover; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| } | |
| .character-sprite { | |
| position: absolute; | |
| bottom: 0; | |
| transition: all 0.3s ease; | |
| max-width: 80%; | |
| max-height: 70%; | |
| } | |
| .dialogue-box { | |
| position: absolute; | |
| bottom: 0; | |
| width: 100%; | |
| background-color: rgba(255, 255, 255, 0.9); | |
| border-top: 2px solid #f9a8d4; | |
| padding: 1rem; | |
| box-sizing: border-box; | |
| } | |
| .menu-options { | |
| display: flex; | |
| flex-direction: column; | |
| gap: 0.5rem; | |
| margin-top: 1rem; | |
| } | |
| .menu-option { | |
| background-color: #fbcfe8; | |
| padding: 0.5rem 1rem; | |
| border-radius: 0.5rem; | |
| cursor: pointer; | |
| transition: background-color 0.2s; | |
| } | |
| .menu-option:hover { | |
| background-color: #f9a8d4; | |
| } | |
| </style> | |
| <div id="preview-container"> | |
| <!-- Preview content will be rendered here by the engine --> | |
| </div> | |
| `; | |
| } | |
| } | |
| customElements.define('preview-window', PreviewWindow); |