File size: 2,758 Bytes
24f91e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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);