File size: 4,249 Bytes
7912cc3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e0ef379
 
 
 
7912cc3
 
 
 
e0ef379
7912cc3
e0ef379
 
7912cc3
e0ef379
7912cc3
e0ef379
7912cc3
 
 
 
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
class SpectreSidebar extends HTMLElement {
  connectedCallback() {
    this.attachShadow({ mode: 'open' });
    this.shadowRoot.innerHTML = `
      <style>
        :host {
            display: block;
            background-color: #1e293b;
            border-radius: 1rem;
            border: 1px solid #334155;
            overflow: hidden;
        }
        .sidebar-menu {
            padding: 1rem;
        }
        .menu-item {
            display: flex;
            align-items: center;
            width: 100%;
            padding: 0.75rem 1rem;
            margin-bottom: 0.5rem;
            border-radius: 0.5rem;
            background: transparent;
            border: none;
            color: #94a3b8;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            text-decoration: none;
            gap: 0.75rem;
        }
        .menu-item:hover {
            background-color: rgba(255,255,255,0.05);
            color: #fff;
        }
        .menu-item.active {
            background-color: rgba(34, 197, 94, 0.1);
            color: #22c55e;
            border-left: 3px solid #22c55e;
        }
        .menu-icon {
            width: 18px;
            height: 18px;
        }
        .stats-box {
            padding: 1.5rem;
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            border-top: 1px solid #334155;
        }
        .stat-label {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: #64748b;
            margin-bottom: 0.5rem;
        }
        .stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: #fff;
            margin-bottom: 0.25rem;
        }
        .stat-indicator {
            font-size: 0.75rem;
            color: #22c55e;
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
      </style>
      <div class="sidebar-menu">
        <a href="#" class="menu-item active">
            <svg class="menu-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></svg>
            Modules
        </a>
        <a href="#" class="menu-item">
            <svg class="menu-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
            Extract Data
        </a>
        <a href="#" class="menu-item">
            <svg class="menu-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>
            System Logs
        </a>
        <a href="#" class="menu-item" onclick="document.querySelector('chat-assistant').toggle()">
            <svg class="menu-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>
            AI Assistant
        </a>
        <a href="#" class="menu-item">
            <svg class="menu-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg>
            Notifications
        </a>
</div>
      <div class="stats-box">
        <div class="stat-label">AI Assistant</div>
        <div class="stat-value text-primary">READY</div>
        <div class="stat-indicator">
            <span style="font-size: 10px; color: #22c55e;">Press Ctrl+K</span>
        </div>
</div>
    `;
  }
}
customElements.define('spectre-sidebar', SpectreSidebar);