stadv's picture
<!DOCTYPE html>
24f91e1 verified
class DocumentEditor extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: flex;
height: 100vh;
background: #f8f4f0;
font-family: 'Crimson Pro', serif;
}
.editor-container {
flex: 1;
display: flex;
padding: 2rem;
gap: 2rem;
}
.input-pane, .preview-pane {
flex: 1;
background: white;
padding: 3rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
border-radius: 2px;
border: 1px solid #e0d6cc;
}
.input-pane {
font-family: 'Inter', sans-serif;
background: #fffefc;
}
textarea {
width: 100%;
height: 100%;
border: none;
resize: none;
font-size: 1rem;
line-height: 1.8;
padding: 1rem;
color: #444;
background: transparent;
}
.preview-content {
height: 100%;
overflow-y: auto;
font-size: 1.1rem;
color: #333;
padding: 1rem;
}
.toolbar {
position: fixed;
top: 0;
left: 0;
right: 0;
background: #fff;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
z-index: 100;
}
.document-title {
font-size: 1.2rem;
color: #555;
font-weight: 500;
}
.action-buttons {
display: flex;
gap: 1rem;
}
button {
background: none;
border: none;
color: #888;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.2s;
}
button:hover {
color: #333;
}
</style>
<div class="toolbar">
<div class="document-title">Novo Documento</div>
<div class="action-buttons">
<button id="save-btn">Salvar</button>
<button id="preview-btn">Visualizar</button>
<button id="export-btn">Exportar</button>
</div>
</div>
<div class="editor-container">
<div class="input-pane">
<textarea placeholder="Digite seu conteúdo aqui..."></textarea>
</div>
<div class="preview-pane">
<div class="preview-content"></div>
</div>
</div>
`;
}
}
customElements.define('document-editor', DocumentEditor);