File size: 2,432 Bytes
5740c7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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);