Spaces:
Running
Running
File size: 4,597 Bytes
6d80bc9 | 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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | class CustomSidebar extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
}
aside {
width: 16rem;
background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(249,250,251,0.95) 100%);
backdrop-filter: blur(10px);
padding: 1.5rem;
height: 100vh;
position: fixed;
left: 0;
top: 0;
border-right: 1px solid rgba(229,231,235,0.5);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 30;
box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.1);
}
.dark aside {
background: linear-gradient(180deg, rgba(17,24,39,0.95) 0%, rgba(31,41,55,0.95) 100%);
border-right: 1px solid rgba(55,65,81,0.5);
}
@media (max-width: 1023px) {
aside {
transform: translateX(-100%);
}
aside.open {
transform: translateX(0);
}
}
.logo {
font-size: 1.75rem;
font-weight: 800;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 2rem;
display: flex;
align-items: center;
gap: 0.75rem;
}
.logo-icon {
width: 2.5rem;
height: 2.5rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 0.75rem;
display: flex;
align-items: center;
justify-content: center;
color: white;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
li {
margin: 0.25rem 0;
}
a {
color: #6b7280;
text-decoration: none;
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.75rem 1rem;
border-radius: 0.75rem;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
font-weight: 500;
}
.dark a {
color: #9ca3af;
}
a:hover {
background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
color: #6366f1;
transform: translateX(0.25rem);
}
a.active {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.menu-section {
margin-bottom: 2rem;
}
.menu-title {
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
color: #9ca3af;
margin-bottom: 0.5rem;
padding: 0 1rem;
letter-spacing: 0.05em;
}
.dark .menu-title {
color: #6b7280;
}
</style>
<aside>
<div class="logo">
<div class="logo-icon">
<i data-feather="hexagon"></i>
</div>
Nexus
</div>
<div class="menu-section">
<div class="menu-title">Main</div>
<ul>
<li><a href="/" class="active"><i data-feather="home"></i>Dashboard</a></li>
<li><a href="#"><i data-feather="users"></i>Clients</a></li>
<li><a href="#"><i data-feather="target"></i>Leads</a></li>
<li><a href="#"><i data-feather="calendar"></i>Calendar</a></li>
</ul>
</div>
<div class="menu-section">
<div class="menu-title">Analytics</div>
<ul>
<li><a href="#"><i data-feather="bar-chart-2"></i>Reports</a></li>
<li><a href="#"><i data-feather="trending-up"></i>Performance</a></li>
<li><a href="#"><i data-feather="pie-chart"></i>Insights</a></li>
</ul>
</div>
<div class="menu-section">
<div class="menu-title">Tools</div>
<ul>
<li><a href="#"><i data-feather="mail"></i>Messages</a></li>
<li><a href="#"><i data-feather="file-text"></i>Documents</a></li>
<li><a href="#"><i data-feather="settings"></i>Settings</a></li>
</ul>
</div>
</aside>
`;
// Initialize feather icons
setTimeout(() => feather.replace(), 0);
}
}
customElements.define('custom-sidebar', CustomSidebar); |