File size: 2,084 Bytes
fc96140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
716c855
fc96140
 
 
71cdd8f
 
 
fc96140
71cdd8f
fc96140
 
 
 
 
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
class CustomHeader extends HTMLElement {
    connectedCallback() {
        this.attachShadow({ mode: 'open' });
        this.shadowRoot.innerHTML = `
            <style>
                :host {
                    display: block;
                    width: 100%;
                    background-color: white;
                    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
                }
                
                .header-container {
                    max-width: 1200px;
                    margin: 0 auto;
                    padding: 1rem 2rem;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                }
                
                .logo {
                    display: flex;
                    align-items: center;
                    gap: 0.75rem;
                    font-weight: 600;
                    color: #1F2937;
                    text-decoration: none;
                }
                
                .logo-icon {
                    color: #3B82F6;
                }
                
                @media (max-width: 640px) {
                    .header-container {
                        padding: 1rem;
                    }
                }
            </style>
            <header class="header-container">
                <a href="/" class="logo">
                    <i data-feather="code" class="logo-icon"></i>
                    <span>XML Explorer</span>
                </a>
                <div class="flex items-center gap-4">
                    <theme-toggle></theme-toggle>
                    <a href="#" class="text-gray-600 hover:text-primary transition duration-200">
                        <i data-feather="help-circle"></i>
                    </a>
                    <a href="/api.html" class="text-gray-600 hover:text-primary transition duration-200">
                        <i data-feather="cpu"></i>
                    </a>
                </div>
</header>
        `;
    }
}

customElements.define('custom-header', CustomHeader);