File size: 2,821 Bytes
7bffc23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
class CustomNavbar extends HTMLElement {
  connectedCallback() {
    this.attachShadow({ mode: 'open' });
    this.shadowRoot.innerHTML = `
      <style>
        :host {
          display: block;
          width: 100%;
          position: fixed;
          top: 0;
          left: 0;
          z-index: 1000;
          background-color: white;
          box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        nav {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 1.5rem 2rem;
          max-width: 1200px;
          margin: 0 auto;
          width: 100%;
        }
        .nav-brand {
          font-size: 1.5rem;
          font-weight: bold;
          color: rgb(88, 28, 135);
          display: flex;
          align-items: center;
        }
        .nav-brand i {
          margin-right: 0.5rem;
        }
        .nav-links {
          display: flex;
          gap: 2rem;
        }
        .nav-link {
          color: rgb(88, 28, 135);
          font-weight: 500;
          text-decoration: none;
          transition: color 0.3s;
          position: relative;
        }
        .nav-link:hover {
          color: rgb(234, 179, 8);
        }
        .nav-link::after {
          content: '';
          position: absolute;
          left: 0;
          bottom: -4px;
          width: 0;
          height: 2px;
          background: rgb(234, 179, 8);
          transition: width 0.3s;
        }
        .nav-link:hover::after {
          width: 100%;
        }
        .mobile-menu-btn {
          display: none;
          background: none;
          border: none;
          color: rgb(88, 28, 135);
          cursor: pointer;
        }
        @media (max-width: 768px) {
          .mobile-menu-btn {
            display: block;
          }
          .nav-links {
            display: none;
          }
        }
      </style>
      <nav>
        <a href="#" class="nav-brand">
          <i data-feather="activity"></i>
          DataAlchemy
        </a>
        <div class="nav-links">
                                <a href="#about" class="nav-link">About</a>
                                <a href="#experience" class="nav-link">Experience</a>
                                <a href="#projects" class="nav-link">Projects</a>
                                <a href="#education" class="nav-link">Education</a>
                                <a href="#publications" class="nav-link">Publications</a>
                                <a href="#blog" class="nav-link">Blog</a>
                                <a href="#contact" class="nav-link">Contact</a>
</div>
        <button class="mobile-menu-btn">
          <i data-feather="menu"></i>
        </button>
      </nav>
    `;
  }
}

customElements.define('custom-navbar', CustomNavbar);