File size: 2,944 Bytes
f32cae0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
115
116
class CustomHeader extends HTMLElement {
  connectedCallback() {
    this.attachShadow({ mode: 'open' });
    this.shadowRoot.innerHTML = `
      <style>
        :host {
          display: block;
        }
        
        .header {
          background: linear-gradient(135deg, #fef3c7 0%, #f59e0b 100%);
          box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        
        .container {
          max-width: 1200px;
          margin: 0 auto;
          padding: 0 1rem;
        }
        
        .nav {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 1rem 0;
        }
        
        .logo {
          display: flex;
          align-items: center;
          gap: 0.75rem;
          font-size: 1.5rem;
          font-weight: 700;
          color: #92400e;
        }
        
        .logo-icon {
          background: #92400e;
          color: white;
          width: 36px;
          height: 36px;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
        }
        
        .nav-links {
          display: flex;
          gap: 1.5rem;
        }
        
        .nav-link {
          color: #92400e;
          text-decoration: none;
          font-weight: 500;
          padding: 0.5rem 1rem;
          border-radius: 0.5rem;
          transition: all 0.2s ease;
        }
        
        .nav-link:hover {
          background: rgba(146, 64, 14, 0.1);
        }
        
        .nav-link.active {
          background: rgba(146, 64, 14, 0.2);
        }
        
        @media (max-width: 768px) {
          .nav {
            flex-direction: column;
            gap: 1rem;
          }
          
          .nav-links {
            flex-wrap: wrap;
            justify-content: center;
          }
        }
      </style>
      
      <header class="header">
        <div class="container">
          <nav class="nav">
            <div class="logo">
              <div class="logo-icon">
                <i data-feather="compass"></i>
              </div>
              <span>Qi Men Analyzer</span>
            </div>
            <div class="nav-links">
              <a href="#" class="nav-link active">Dashboard</a>
              <a href="#" class="nav-link">Charts</a>
              <a href="#" class="nav-link">Analysis</a>
              <a href="#" class="nav-link">Reports</a>
              <a href="#" class="nav-link">Settings</a>
            </div>
          </nav>
        </div>
      </header>
    `;
    
    // Initialize Feather Icons
    const script = document.createElement('script');
    script.src = 'https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js';
    script.onload = () => {
      if (this.shadowRoot) {
        feather.replace();
      }
    };
    this.shadowRoot.appendChild(script);
  }
}

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