lovelyscript-dreamweaver / components /preview-window.js
GabHtml's picture
Deve ser funcional, e em arquivos separados o css js e html
7e144db verified
Raw History Blame Contribute Delete
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);