-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathuninstallation.html
More file actions
534 lines (522 loc) · 22.1 KB
/
uninstallation.html
File metadata and controls
534 lines (522 loc) · 22.1 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Safely uninstall Droidspaces from Android and Linux. Remove containers, backend data, APK, and system files completely.">
<meta name="keywords" content="uninstall, droidspaces, remove, android, delete, rootfs, cleanup, container, runtime, backend, data">
<title>Uninstallation - Droidspaces Docs</title>
<meta property="og:title" content="Uninstallation - Droidspaces Docs">
<meta property="og:description" content="Safely uninstall Droidspaces from Android and Linux. Remove containers, backend data, APK, and system files completely.">
<meta property="og:url" content="https://www.droidspaces.org/docs/uninstallation.html">
<meta property="og:type" content="website">
<meta property="og:image" content="https://i.ibb.co/d4PLN7Gg/og-image.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Uninstallation - Droidspaces Docs">
<meta name="twitter:description" content="Safely uninstall Droidspaces from Android and Linux. Remove containers, backend data, APK, and system files completely.">
<meta name="twitter:image" content="https://i.ibb.co/d4PLN7Gg/og-image.png">
<link rel="canonical" href="https://www.droidspaces.org/docs/uninstallation.html">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap" rel="stylesheet">
<link rel="icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/favicon.ico">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
<link rel="stylesheet" href="../style.css">
<style>
.docs-layout {
display: flex; min-height: calc(100vh - 56px);
}
.sidebar {
width: 300px; flex-shrink: 0;
border-right: 1px solid var(--border);
background: var(--bg2);
overflow-y: auto;
position: sticky; top: 56px; height: calc(100vh - 56px);
}
.sidebar-inner {
padding: 0;
position: relative;
width: 100%;
min-width: 0;
}
.sidebar-group {
margin-bottom: 0;
}
.sidebar-heading {
font-family: var(--mono); font-size: 0.7rem; font-weight: 700;
text-transform: uppercase; letter-spacing: 0.08em;
color: var(--muted); padding: 1rem 1rem 0.25rem;
}
.sidebar-link {
display: block; padding: 0.5rem 1rem;
font-size: 0.9rem; color: var(--muted);
text-decoration: none; border-radius: 0;
transition: all 0.1s;
}
.sidebar-link:hover {
color: var(--text); background: var(--bg3);
}
.sidebar-link.active {
color: var(--accent2); background: rgba(79,142,247,0.08);
font-weight: 600;
}
.sidebar-content {
flex: 1; min-width: 0;
padding: 2rem 2rem 4rem;
max-width: none;
}
.sidebar-content h1 {
font-family: var(--mono); font-size: clamp(1.5rem, 2.5vw, 2rem);
font-weight: 700; letter-spacing: -0.03em; color: var(--text);
margin-bottom: 1.5rem; padding-bottom: 0.75rem;
border-bottom: 1px solid var(--border);
}
.sidebar-content h2 {
font-family: var(--mono); font-size: 1.25rem; font-weight: 700;
color: var(--text); margin: 2rem 0 0.75rem;
letter-spacing: -0.02em;
}
.sidebar-content h2:target {
border-left: 3px solid var(--accent);
padding-left: 0.75rem;
}
.sidebar-content h3 {
font-family: var(--mono); font-size: 1rem; font-weight: 600;
color: var(--accent2); margin: 1.5rem 0 0.5rem;
}
.sidebar-content h3:target {
border-left: 2px solid var(--accent);
padding-left: 0.5rem;
}
.sidebar-content p {
color: var(--muted); line-height: 1.7; margin-bottom: 1rem;
}
.sidebar-content strong { color: var(--text); }
.sidebar-content a {
color: var(--accent2); text-decoration: none;
word-break: break-word; overflow-wrap: anywhere;
}
.sidebar-content a:hover { text-decoration: underline; }
.sidebar-content code {
font-family: var(--mono); font-size: 0.82rem;
background: var(--bg3); padding: 0.15rem 0.4rem;
border-radius: 4px; color: var(--accent2);
word-break: break-word; overflow-wrap: anywhere;
}
.sidebar-content pre {
background: var(--bg2); border: 1px solid var(--border);
border-radius: 8px; padding: 1rem; overflow-x: auto;
margin-bottom: 1rem;
}
.sidebar-content pre code {
background: none; padding: 0; font-size: 0.78rem;
color: var(--text); line-height: 1.6;
}
.code-block {
position: relative;
}
.code-block:hover .copy-btn {
opacity: 1;
}
.copy-btn {
position: absolute; top: 0.5rem; right: 0.5rem;
background: var(--bg3); border: 1px solid var(--border);
color: var(--muted); font-size: 0.7rem;
font-family: var(--sans); padding: 0.2rem 0.5rem;
border-radius: 4px; cursor: pointer;
opacity: 0; transition: opacity 0.15s; z-index: 1;
display: inline-flex; align-items: center; gap: 0.25rem;
}
.copy-btn:hover {
color: var(--accent2); border-color: var(--accent2);
}
@media (max-width: 768px) {
.copy-btn { opacity: 1; }
}
.sidebar-content ul, .sidebar-content ol {
color: var(--muted); line-height: 1.7;
margin-bottom: 1rem; padding-left: 1.25rem;
}
.sidebar-content li { margin-bottom: 0.25rem; }
.sidebar-content li > .code-block { margin-top: 0.5rem; }
.sidebar-content blockquote {
border-left: 3px solid var(--accent); background: var(--bg3);
padding: 0.75rem 1rem; margin-bottom: 1rem;
border-radius: 0 6px 6px 0;
color: var(--text); font-size: 0.9rem;
}
.sidebar-content blockquote p { color: var(--text); margin-bottom: 0; }
.sidebar-content hr {
border: none; border-top: 1px solid var(--border); margin: 2rem 0;
}
.table-wrap {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin-bottom: 1.5rem;
}
.table-wrap table {
width: max-content;
min-width: 100%;
margin-bottom: 0;
}
.sidebar-content table {
width: max-content; min-width: 100%;
border-collapse: collapse; font-size: 0.85rem;
margin-bottom: 1.5rem;
}
.sidebar-content th {
font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
text-transform: uppercase; letter-spacing: 0.06em;
padding: 0.75rem 1rem; text-align: left; color: var(--muted);
border-bottom: 1px solid var(--border); background: var(--bg3);
white-space: nowrap;
}
.sidebar-content td {
padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
color: var(--muted);
white-space: normal; word-break: normal;
overflow-wrap: break-word; max-width: 300px;
}
.sidebar-content img {
max-width: 100%; border-radius: 8px; border: 1px solid var(--border);
margin: 1rem 0;
}
.sidebar-content details {
background: var(--bg2); border: 1px solid var(--border);
border-radius: 8px; padding: 1rem; margin-bottom: 1rem;
}
.sidebar-content summary {
font-family: var(--mono); font-size: 0.85rem;
cursor: pointer; color: var(--accent2);
}
.callout {
border-left: 4px solid var(--accent);
background: var(--bg3); padding: 0.75rem 1rem;
margin-bottom: 1rem; border-radius: 0 6px 6px 0;
font-size: 0.9rem; color: var(--text);
}
.callout-title {
font-family: var(--mono); font-size: 0.72rem;
text-transform: uppercase; letter-spacing: 0.06em;
display: block; margin-bottom: 0.25rem;
}
.callout-note { border-left-color: var(--accent); }
.callout-note .callout-title { color: var(--accent); }
.callout-tip { border-left-color: var(--green); }
.callout-tip .callout-title { color: var(--green); }
.callout-warning { border-left-color: #f59e0b; }
.callout-warning .callout-title { color: #f59e0b; }
.callout-caution { border-left-color: #f59e0b; }
.callout-caution .callout-title { color: #f59e0b; }
.callout-important { border-left-color: #ef4444; }
.callout-important .callout-title { color: #ef4444; }
.doc-nav-buttons {
display: flex; justify-content: space-between; gap: 1rem;
margin: 2rem 0 1rem;
}
.doc-nav-btn {
padding: 0.5rem 1rem; border-radius: 8px;
font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
text-decoration: none; color: var(--muted);
border: 1px solid var(--border);
transition: all 0.15s; max-width: 50%;
}
.doc-nav-btn:hover {
color: var(--text); border-color: var(--muted);
}
.doc-nav-next {
margin-left: auto; text-align: right;
}
.doc-nav-prev {
text-align: left;
}
.doc-copyright {
font-size: 0.78rem; color: var(--border2);
padding-top: 1rem; border-top: 1px solid var(--border);
margin-top: 1.5rem; text-align: center;
}
.doc-copyright a {
color: var(--border2); text-decoration: none;
}
.doc-copyright a:hover {
color: var(--muted);
}
.nav-overlay {
display: none; position: fixed;
top: 56px; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.5); z-index: 199;
}
.nav-overlay.active { display: block; }
.sidebar-close {
display: none;
position: absolute; top: 0.5rem; right: 1rem;
background: none; border: none;
color: var(--muted); font-size: 1.5rem;
cursor: pointer; padding: 0.25rem 0.5rem;
line-height: 1; border-radius: 4px;
}
.sidebar-close:hover {
color: var(--text); background: var(--bg3);
}
.doc-breadcrumb {
display: none;
position: sticky;
top: 56px;
z-index: 50;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
background: var(--bg2);
border-bottom: 1px solid var(--border);
font-size: 0.78rem;
color: var(--muted);
user-select: none;
cursor: pointer;
}
.doc-breadcrumb .bc-sep {
color: var(--border2);
}
.doc-breadcrumb .bc-section {
color: var(--text);
}
.doc-breadcrumb .bc-label {
color: var(--accent2);
}
@media (max-width: 768px) {
.sidebar {
display: flex;
position: fixed; top: 56px; left: 0;
width: 300px; height: calc(100dvh - 56px); z-index: 200;
border-right: 1px solid var(--border);
transform: translateX(-100%);
transition: transform 0.25s ease;
box-shadow: 4px 0 12px rgba(0,0,0,0.2);
}
.sidebar.open { transform: translateX(0); }
.sidebar-close { display: block; }
.sidebar-content { padding: 1.5rem 1rem 3rem; }
.doc-breadcrumb { display: flex; }
.docs-layout { flex-direction: column; }
.sidebar-content th,
.sidebar-content td {
padding: 0.5rem 0.5rem;
font-size: 0.78rem;
}
}
</style>
<script>
(function () {
const savedTheme = localStorage.getItem('theme');
if (savedTheme) document.documentElement.setAttribute('data-theme', savedTheme);
})();
</script>
</head>
<body>
<nav aria-label="Main navigation">
<div class="container" style="display:flex;align-items:center;justify-content:space-between;height:100%;">
<a href="/" class="nav-logo">
<svg class="logo-icon" viewBox="8.25 10.35 31.5 27.3" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M36.85 30.16H11.15c-0.82 0-1.48 0.68-1.48 1.52v3.05c0 0.84 0.66 1.52 1.48 1.52h25.69c0.82 0 1.48-0.68 1.48-1.52v-3.05c0-0.84-0.66-1.52-1.48-1.52ZM12.58 34.97c-0.95 0-1.73-0.79-1.73-1.77s0.77-1.77 1.73-1.77 1.73 0.79 1.73 1.77-0.77 1.77-1.73 1.77Z"/>
<path d="M36.85 21.00H11.15c-0.82 0-1.48 0.68-1.48 1.52v3.05c0 0.84 0.66 1.52 1.48 1.52h25.69c0.82 0 1.48-0.68 1.48-1.52v-3.05c0-0.84-0.66-1.52-1.48-1.52ZM12.58 25.82c-0.95 0-1.73-0.79-1.73-1.77s0.77-1.77 1.73-1.77 1.73 0.79 1.73 1.77-0.77 1.77-1.73 1.77Z"/>
<path d="M36.84 11.74H11.15c-0.82 0-1.48 0.68-1.48 1.52v3.05c0 0.84 0.66 1.52 1.48 1.52h25.69c0.82 0 1.48-0.68 1.48-1.52v-3.05c0-0.84-0.66-1.52-1.48-1.52ZM12.58 16.57c-0.95 0-1.73-0.79-1.73-1.77s0.77-1.77 1.73-1.77 1.73 0.79 1.73 1.77-0.77 1.77-1.73 1.77Z"/>
</svg>
<span class="logo-text">Droidspaces</span>
</a>
<div style="display:flex;align-items:center;gap:0.5rem;">
<ul class="nav-links">
<li class="nav-features"><a href="/#features">Features</a></li>
<li><a href="/docs/" style="color:var(--accent2)"><i class="fas fa-book nav-icon nav-icon-docs"></i><span class="nav-label">Documentation</span></a></li>
<li class="nav-downloads"><a href="/downloads.html"><i class="fas fa-download nav-icon nav-icon-docs"></i><span class="nav-label">Downloads</span></a></li>
<li><a href="https://github.com/ravindu644/Droidspaces-OSS" rel="noopener noreferrer"><i class="fab fa-github nav-icon"></i><span class="nav-label nav-label-gt">GitHub</span></a></li>
<li><a href="https://t.me/Droidspaces" rel="noopener noreferrer"><i class="fab fa-telegram nav-icon"></i><span class="nav-label nav-label-gt">Telegram</span></a></li>
</ul>
<button class="theme-toggle" id="theme-toggle" title="Toggle theme">
<svg class="sun-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display:none">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
<svg class="moon-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
</button>
</div>
</div>
</nav>
<div class="nav-overlay" id="sidebar-overlay"></div>
<div class="doc-breadcrumb" id="sidebar-toggle" role="button" tabindex="0" aria-label="Toggle docs navigation">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" style="flex-shrink:0">
<rect x="3" y="3" width="18" height="18" rx="2"/>
<line x1="9" y1="3" x2="9" y2="21"/>
</svg>
<span>Docs</span><span class="bc-sep">/</span><span class="bc-section">Reference</span><span class="bc-sep">/</span><span class="bc-label">Uninstallation</span>
</div>
<div class="docs-layout">
<aside class="sidebar" id="sidebar">
<div class="sidebar-inner">
<button class="sidebar-close" id="sidebar-close" aria-label="Close sidebar">×</button>
<div class="sidebar-group">
<div class="sidebar-heading">Basics</div>
<a href="installation-android.html" class="sidebar-link">Android Installation</a>
<a href="installation-linux.html" class="sidebar-link">Linux Installation</a>
</div>
<div class="sidebar-group">
<div class="sidebar-heading">Guides</div>
<a href="features.html" class="sidebar-link">Feature Deep Dives</a>
<a href="gpu-acceleration.html" class="sidebar-link">GPU Acceleration</a>
<a href="kernel-configuration.html" class="sidebar-link">Kernel Configuration</a>
<a href="usage-android-app.html" class="sidebar-link">Android App Usage</a>
<a href="linux-cli.html" class="sidebar-link">Linux CLI</a>
</div>
<div class="sidebar-group">
<div class="sidebar-heading">Recipes</div>
<a href="cool-things-you-can-do.html" class="sidebar-link">Cool Things You Can Do</a>
</div>
<div class="sidebar-group">
<div class="sidebar-heading">Reference</div>
<a href="troubleshooting.html" class="sidebar-link">Troubleshooting</a>
<a href="community-supported-devices.html" class="sidebar-link">Community-Supported Devices</a>
<a href="nix-nixos.html" class="sidebar-link">Nix/NixOS</a>
<a href="uninstallation.html" class="sidebar-link active">Uninstallation</a>
</div>
</div>
</aside>
<div class="sidebar-content">
<h1 id="uninstallation-guide">Uninstallation Guide</h1>
<p>This guide explains how to safely and completely remove Droidspaces from your system.</p>
<hr>
<h2 id="android-app">Android (App)</h2>
<p>Follow these steps to ensure all container data and backend files are removed.</p>
<ol>
<li><strong>Stop Containers</strong>: Ensure all running containers are stopped from the <strong>Containers</strong> tab.
</li>
<li><strong>Delete Containers</strong>:
<ul>
<li>Go to the <strong>Containers</strong> tab.
</li>
<li>Long-press each container card and select <strong>Uninstall Container</strong>. This deletes the rootfs image and its configuration.
</li>
</ul>
</li>
<li><strong>Remove Backend Data</strong>:
<ul>
<li>Using a root file manager or a terminal (like Termux with root access), delete the following directory:
</li>
</ul>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>su -c "rm -rf /data/local/Droidspaces"
</code></pre></div>
</li>
<li><strong>Uninstall APK</strong>: Uninstall the Droidspaces app from your Android settings or launcher.
</li>
<li><strong>Reboot</strong>: Disable or remove the Magisk/KernelSU <code>Droidspaces: Run-at-boot</code> module from your root manager, then reboot to clear any remaining Droidspaces stuff.
</li>
</ol>
<hr>
<h2 id="linux-cli">Linux (CLI)</h2>
<ol>
<li><strong>Stop Containers</strong>: Stop all running containers.
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces --name=web,db stop
</code></pre></div>
</li>
<li><strong>Remove Filesystem</strong>: Delete the Droidspaces workspace directory. This will remove stale PID files, and logs.
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo rm -rf /var/lib/Droidspaces
</code></pre></div>
</li>
<li><strong>Remove Binary</strong>: Delete the <code>droidspaces</code> binary.
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo rm /usr/local/bin/droidspaces
# Or wherever you installed it
</code></pre></div>
</li>
</ol>
<div class="doc-nav-buttons"><a href="nix-nixos.html" class="doc-nav-btn doc-nav-prev">← Nix/NixOS</a></div>
<p class="doc-copyright">© 2026 Droidspaces · <a href="https://github.com/ravindu644/Droidspaces-OSS/blob/main/LICENSE" rel="noopener noreferrer">GPLv3</a> · by <a href="https://github.com/ravindu644" rel="noopener noreferrer">ravindu644</a> and <a href="https://github.com/ravindu644/Droidspaces-OSS/graphs/contributors" rel="noopener noreferrer">contributors</a>
</p>
</div>
</div>
<script>
(() => {
const themeToggle = document.getElementById('theme-toggle');
const sunIcon = themeToggle.querySelector('.sun-icon');
const moonIcon = themeToggle.querySelector('.moon-icon');
const mediaQuery = window.matchMedia('(prefers-color-scheme: light)');
function updateIcons(theme) {
sunIcon.style.display = theme === 'light' ? 'none' : 'block';
moonIcon.style.display = theme === 'light' ? 'block' : 'none';
}
function getEffectiveTheme() {
const saved = localStorage.getItem('theme');
if (saved) return saved;
return mediaQuery.matches ? 'light' : 'dark';
}
function applyTheme(theme) {
if (theme === 'system') {
document.documentElement.removeAttribute('data-theme');
updateIcons(mediaQuery.matches ? 'light' : 'dark');
} else {
document.documentElement.setAttribute('data-theme', theme);
updateIcons(theme);
}
}
applyTheme(getEffectiveTheme());
mediaQuery.addEventListener('change', (e) => {
if (!localStorage.getItem('theme')) applyTheme(e.matches ? 'light' : 'dark');
});
themeToggle.addEventListener('click', () => {
const currentTheme = getEffectiveTheme();
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
localStorage.setItem('theme', newTheme);
applyTheme(newTheme);
});
// Docs sidebar toggle
const sidebarToggle = document.getElementById('sidebar-toggle');
const sidebar = document.getElementById('sidebar');
const sidebarOverlay = document.getElementById('sidebar-overlay');
function openSidebar() {
sidebar.classList.add('open');
sidebarOverlay.classList.add('active');
document.body.style.overflow = 'hidden';
}
function closeSidebar() {
sidebar.classList.remove('open');
sidebarOverlay.classList.remove('active');
document.body.style.overflow = '';
}
if (sidebarToggle) {
sidebarToggle.addEventListener('click', (e) => {
e.stopPropagation();
if (sidebar.classList.contains('open')) closeSidebar();
else openSidebar();
});
}
if (sidebarOverlay) {
sidebarOverlay.addEventListener('click', closeSidebar);
}
const sidebarClose = document.getElementById('sidebar-close');
if (sidebarClose) {
sidebarClose.addEventListener('click', closeSidebar);
}
if (sidebar) {
sidebar.querySelectorAll('a').forEach(link => {
link.addEventListener('click', closeSidebar);
});
}
})();
function copyCode(btn) {
const code = btn.parentElement.querySelector('pre code');
const text = code.textContent;
navigator.clipboard.writeText(text).then(() => {
const orig = btn.innerHTML;
btn.innerHTML = '<i class="fas fa-check"></i> Copied!';
setTimeout(() => { btn.innerHTML = orig; }, 1500);
}).catch(() => {});
}
</script>
</body>
</html>