Spaces:
Running
Running
| class CustomSidebar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| width: 100%; | |
| padding: 16px; | |
| } | |
| .logo { | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| font-weight: 700; | |
| font-size: 18px; | |
| color: var(--text-color, rgb(15 23 42)); | |
| text-decoration: none; | |
| } | |
| .menu { | |
| display: flex; | |
| flex-direction: column; | |
| gap: 8px; | |
| margin: 16px 0; | |
| } | |
| .btn { | |
| width: 100%; | |
| display: inline-flex; | |
| align-items: center; | |
| justify-content: flex-start; | |
| gap: 8px; | |
| padding: 10px 12px; | |
| background: var(--btn-bg, rgb(241 245 249)); | |
| color: var(--btn-text, rgb(15 23 42)); | |
| border: 1px solid var(--btn-border, rgb(226 232 240)); | |
| border-radius: 8px; | |
| cursor: pointer; | |
| transition: all 0.2s ease; | |
| } | |
| .btn:hover { | |
| background: var(--btn-hover, rgb(226 232 240)); | |
| } | |
| .projects h3 { | |
| font-size: 14px; | |
| color: var(--subtext-color, rgb(100 116 139)); | |
| margin-bottom: 8px; | |
| text-transform: uppercase; | |
| letter-spacing: 0.06em; | |
| } | |
| .project-list { | |
| list-style: none; | |
| padding: 0; | |
| margin: 0; | |
| display: flex; | |
| flex-direction: column; | |
| gap: 6px; | |
| } | |
| </style> | |
| <div class="sidebar-content"> | |
| <div class="logo"> | |
| <i class="fa-solid fa-code"></i> | |
| <span>Espace Codage</span> | |
| </div> | |
| <nav class="menu"> | |
| <button id="newTaskBtn" class="btn"> | |
| <i class="fa-solid fa-plus"></i> | |
| Nouvelle tâche | |
| </button> | |
| <button id="searchBtn" class="btn"> | |
| <i class="fa-solid fa-magnifying-glass"></i> | |
| Rechercher | |
| </button> | |
| <button id="libraryBtn" class="btn"> | |
| <i class="fa-solid fa-book"></i> | |
| Bibliothèque | |
| </button> | |
| </nav> | |
| <div class="projects"> | |
| <h3>Projets</h3> | |
| <ul id="projectList" class="project-list"></ul> | |
| </div> | |
| </div> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-sidebar', CustomSidebar); |