File size: 2,068 Bytes
7fa209a 2a1f177 7fa209a 2a1f177 7fa209a 2a1f177 7fa209a |
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 |
class CustomNavbar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
nav {
background-color: var(--primary-color);
color: var(--light-text);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: var(--shadow-md);
position: sticky;
top: 0;
z-index: 1000;
}
.logo {
display: flex;
align-items: center;
font-weight: bold;
font-size: 1.2rem;
}
.logo img {
height: 40px;
margin-left: 10px;
}
.nav-links {
display: flex;
gap: 20px;
}
.nav-links a {
color: white;
text-decoration: none;
padding: 0.5rem 1rem;
border-radius: 5px;
transition: background-color 0.3s;
}
.nav-links a:hover {
background-color: rgba(255, 255, 255, 0.2);
}
@media (max-width: 768px) {
nav {
flex-direction: column;
padding: 1rem;
}
.nav-links {
margin-top: 1rem;
width: 100%;
justify-content: space-around;
}
.nav-links a {
padding: 0.5rem;
}
}
</style>
<nav>
<div class="logo">
<img src="http://static.photos/education/200x200/1" alt="School Logo">
<span>ืืืช ืกืคืจ ืืฆืืง ืฉืืืจ</span>
</div>
<div class="nav-links">
<a href="/">ืืืช</a>
<a href="/chat.html">ืฆ'ืื AI</a>
<a href="/materials.html">ืืืืจื ืืืืื</a>
<a href="/announcements.html">ืืืจืืืช</a>
<a href="/login.html">ืืชืืืจืืช</a>
</div>
</nav>
`;
}
}
customElements.define('custom-navbar', CustomNavbar); |