File size: 2,260 Bytes
7e144db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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);