File size: 2,601 Bytes
8e477ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
class HeaderComponent extends HTMLElement {
  connectedCallback() {
    this.attachShadow({ mode: 'open' });
    this.shadowRoot.innerHTML = `
      <style>
        :host {
          display: block;
        }
        
        .header {
          background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
          color: white;
          padding: 1rem;
          box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        
        .container {
          max-width: 1200px;
          margin: 0 auto;
          display: flex;
          justify-content: space-between;
          align-items: center;
        }
        
        .logo {
          display: flex;
          align-items: center;
          font-weight: 700;
          font-size: 1.5rem;
        }
        
        .logo-icon {
          margin-right: 10px;
        }
        
        nav ul {
          display: flex;
          list-style: none;
        }
        
        nav li {
          margin-left: 1.5rem;
        }
        
        nav a {
          color: rgba(255, 255, 255, 0.9);
          text-decoration: none;
          font-weight: 500;
          transition: color 0.3s;
          display: flex;
          align-items: center;
        }
        
        nav a:hover {
          color: white;
        }
        
        nav i {
          margin-right: 5px;
        }
        
        @media (max-width: 768px) {
          .container {
            flex-direction: column;
          }
          
          nav ul {
            margin-top: 1rem;
          }
          
          nav li {
            margin: 0 0.5rem;
          }
        }
      </style>
      
      <header class="header">
        <div class="container">
          <div class="logo">
            <i data-feather="book-open" class="logo-icon"></i>
            <span>LinguaBot Tutor</span>
          </div>
          <nav>
            <ul>
              <li><a href="#"><i data-feather="home"></i> Home</a></li>
              <li><a href="#"><i data-feather="book"></i> Lessons</a></li>
              <li><a href="#"><i data-feather="bar-chart-2"></i> Progress</a></li>
              <li><a href="#"><i data-feather="user"></i> Profile</a></li>
            </ul>
          </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 = () => {
      feather.replace();
    };
    this.shadowRoot.appendChild(script);
  }
}

customElements.define('header-component', HeaderComponent);