Spaces:
Running
Running
File size: 1,590 Bytes
132e52e 763ef71 132e52e | 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 CustomSidebar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
aside {
width: 80px;
height: 100vh;
position: fixed;
left: 0;
top: 0;
background: rgba(0,0,0,0.9);
border-right: 1px solid rgba(255, 255, 255, 0.1);
display: flex;
flex-direction: column;
align-items: center;
padding-top: 20px;
z-index: 1000;
}
.sidebar-item {
width: 40px;
height: 40px;
margin: 15px 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: all 0.3s ease;
color: white;
}
.sidebar-item:hover {
background: rgba(255,255,255,0.2);
transform: scale(1.1);
}
.sidebar-item.active {
background: #6366f1;
}
i {
width: 24px;
height: 24px;
}
</style>
<aside>
<a href="/" class="sidebar-item active">
<i data-feather="home"></i>
</a>
<a href="#projects" class="sidebar-item">
<i data-feather="briefcase"></i>
</a>
<a href="#about" class="sidebar-item">
<i data-feather="user"></i>
</a>
<a href="#contact" class="sidebar-item">
<i data-feather="mail"></i>
</a>
</aside>
`;
}
}
customElements.define('custom-sidebar', CustomSidebar); |