CRMHUB's picture
https://webjedi.net/
763ef71 verified
Raw History Blame Contribute Delete
1.59 kB
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);