File size: 2,165 Bytes
819efbb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
class ChatInput extends HTMLElement {
    connectedCallback() {
        this.attachShadow({ mode: 'open' });
        this.shadowRoot.innerHTML = `
            <style>
                :host {
                    display: block;
                    width: 100%;
                }
                .input-container {
                    position: relative;
                    width: 100%;
                }
                textarea {
                    width: 100%;
                    padding: 1rem;
                    padding-right: 4rem;
                    border-radius: 0.5rem;
                    border: 1px solid #D1D5DB;
                    resize: none;
                    min-height: 60px;
                    font-family: inherit;
                    line-height: 1.5;
                }
                textarea:focus {
                    outline: none;
                    box-shadow: 0 0 0 2px #3B82F6;
                    border-color: transparent;
                }
                .send-btn {
                    position: absolute;
                    right: 0.75rem;
                    bottom: 0.75rem;
                    padding: 0.5rem;
                    border-radius: 0.375rem;
                    background-color: #3B82F6;
                    color: white;
                    transition: background-color 0.2s;
                }
                .send-btn:hover {
                    background-color: #2563EB;
                }
                .disclaimer {
                    font-size: 0.75rem;
                    color: #6B7280;
                    margin-top: 0.5rem;
                    text-align: center;
                }
            </style>
            <div class="input-container">
                <textarea placeholder="Message Chatty McChatFace..." rows="1"></textarea>
                <button class="send-btn">
                    <i data-feather="send"></i>
                </button>
            </div>
            <p class="disclaimer">
                Chatty McChatFace can make mistakes. Consider checking important information.
            </p>
        `;
    }
}

customElements.define('chat-input', ChatInput);