Skip to content

Commit 0c35cbd

Browse files
committed
Looks good enough
1 parent 0610f83 commit 0c35cbd

28 files changed

Lines changed: 215 additions & 1136 deletions

Assets/js/darkmode.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Shared dark mode handler for the site
2+
// Usage: include <script src="/Assets/js/darkmode.js"></script> near the end of the page
3+
(function () {
4+
const rootEl = document.body;
5+
6+
function applyPreference() {
7+
const saved = localStorage.getItem('darkmode');
8+
if (saved === 'true') {
9+
rootEl.classList.add('darkmode');
10+
} else if (saved === 'false') {
11+
rootEl.classList.remove('darkmode');
12+
} else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
13+
rootEl.classList.add('darkmode');
14+
}
15+
}
16+
17+
function toggleDarkMode() {
18+
if (rootEl.classList.contains('darkmode')) {
19+
rootEl.classList.remove('darkmode');
20+
localStorage.setItem('darkmode', 'false');
21+
} else {
22+
rootEl.classList.add('darkmode');
23+
localStorage.setItem('darkmode', 'true');
24+
}
25+
}
26+
27+
// Expose functions to global scope for existing onclick attributes
28+
window.applyPreference = applyPreference;
29+
window.toggleDarkMode = toggleDarkMode;
30+
31+
window.addEventListener('load', applyPreference);
32+
})();

Git/GitCommand/add.html

Lines changed: 20 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,10 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Git Add - Article Template</title>
7-
8-
<link rel="stylesheet" href="https://www.w3schools.com/w3css/5/w3.css">
9-
10-
<style>
11-
:root {
12-
--sidebar-width: 220px;
13-
--sidebar-bg: #003366;
14-
--accent: #ff3333;
15-
--text: #111;
16-
--bg: #ffffff;
17-
--card: #f7f7f7;
18-
--border: #ddd;
19-
}
20-
21-
body {
22-
margin: 0;
23-
font-family: Arial, sans-serif;
24-
background: var(--bg);
25-
color: var(--text);
26-
}
27-
28-
.sidebar {
29-
height: 100vh;
30-
overflow-y: auto;
31-
position: fixed;
32-
width: var(--sidebar-width);
337
background-color: var(--sidebar-bg);
348
color: white;
359
padding-bottom: 20px;
3610
box-shadow: 2px 0 10px rgba(0,0,0,0.15);
37-
}
38-
39-
.sidebar h2 {
40-
margin: 0;
41-
padding: 16px 12px 10px;
42-
font-size: 18px;
43-
text-align: center;
44-
color: white;
45-
border-bottom: 1px solid rgba(255,255,255,0.15);
46-
}
47-
48-
.sidebar h3 {
49-
margin: 18px 0 6px;
50-
padding: 0 12px;
51-
color: var(--accent);
52-
font-size: 14px;
53-
text-transform: uppercase;
54-
letter-spacing: 0.04em;
55-
}
56-
57-
.sidebar a {
58-
display: block;
59-
padding: 8px 12px;
60-
text-decoration: none;
61-
color: white;
62-
font-size: 14px;
6311
border-radius: 4px;
6412
margin: 2px 8px;
6513
}
@@ -207,23 +155,28 @@
207155
<!-- Sidebar / Navigation -->
208156
<div class="sidebar w3-card">
209157
<h2>Git Docs</h2>
158+
<h3>Basics of Github</h3>
159+
<a href="../GitHub/Github-Setup.html">Setting Up Github</a>
160+
<a href="../GitHub/Github-First-Repo.html">Making your First Repo</a>
161+
<a href="../GitHub/Github-Merges.html">Intro to Merges</a>
162+
<a href="../GitHub/Github-Forks.html">Intro to Forks</a>
210163

211-
<!-- GLOBAL COMMAND LIST -->
212-
<h3>Previous</h3>
213-
<a href="init.html">init</a>
214-
<a href="clone.html">clone</a>
164+
<!-- GLOBAL COMMAND LIST -->
165+
<h3>Previous</h3>
215166

216167
<h3>This Page</h3>
217-
<a href="#intro" class="nav-link">Introduction</a>
218-
<a href="#syntax" class="nav-link">Syntax</a>
219-
<a href="#basic-use" class="nav-link">Basic Use</a>
220-
<a href="#examples" class="nav-link">Examples</a>
221-
<a href="#options" class="nav-link">Options</a>
222-
<a href="#troubleshooting" class="nav-link">Troubleshooting</a>
223-
<a href="#practice" class="nav-link">Practice</a>
224-
225-
<!-- NEXT ARTICLES -->
226-
<h3>Next Articles</h3>
168+
<a href="#intro" class="nav-link">Introduction</a>
169+
<a href="#syntax" class="nav-link">Syntax</a>
170+
<a href="#basic-use" class="nav-link">Basic Use</a>
171+
<a href="#examples" class="nav-link">Examples</a>
172+
<a href="#options" class="nav-link">Options</a>
173+
<a href="#troubleshooting" class="nav-link">Troubleshooting</a>
174+
<a href="#practice" class="nav-link">Practice</a>
175+
176+
<!--NEXT ARTICLES -->
177+
<h3>Next Articles</h3>
178+
<a href="init.html">git init</a>
179+
<a href="clone.html">git clone</a>
227180
<a href="mv.html">git mv</a>
228181
<a href="restore.html">git restore</a>
229182
<a href="rm.html">git rm</a>
@@ -372,34 +325,7 @@ <h2>Practice</h2>
372325
</div>
373326
</div>
374327

375-
<script>
376-
const content = document.getElementById('mainContent');
377-
378-
function applyPreference() {
379-
const saved = localStorage.getItem('darkmode');
380-
if (saved === 'true') {
381-
content.classList.add('darkmode');
382-
} else if (saved === 'false') {
383-
content.classList.remove('darkmode');
384-
} else {
385-
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
386-
content.classList.add('darkmode');
387-
}
388-
}
389-
}
390-
391-
function toggleDarkMode() {
392-
if (content.classList.contains('darkmode')) {
393-
content.classList.remove('darkmode');
394-
localStorage.setItem('darkmode', 'false');
395-
} else {
396-
content.classList.add('darkmode');
397-
localStorage.setItem('darkmode', 'true');
398-
}
399-
}
400-
401-
window.addEventListener('load', applyPreference);
402-
</script>
328+
<script src="/Assets/js/darkmode.js"></script>
403329

404330
</body>
405331
</html>

Git/GitCommand/backfill.html

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,13 @@
168168
<body>
169169

170170
<!-- Sidebar -->
171-
<div class="sidebar w3-card">
172-
<h2>Git Docs</h2>
171+
<div class="sidebar w3-card">
172+
<h2>Git Docs</h2>
173+
<h3>Basics of Github</h3>
174+
<a href="../GitHub/Github-Setup.html">Setting Up Github</a>
175+
<a href="../GitHub/Github-First-Repo.html">Making your First Repo</a>
176+
<a href="../GitHub/Github-Merges.html">Intro to Merges</a>
177+
<a href="../GitHub/Github-Forks.html">Intro to Forks</a>
173178

174179
<h3>Previous</h3>
175180
<a href="./status.html">status</a>
@@ -262,32 +267,7 @@ <h3>Partial clone misconfiguration</h3>
262267

263268
</div>
264269

265-
<script>
266-
const content = document.getElementById('mainContent');
267-
268-
function applyPreference() {
269-
const saved = localStorage.getItem('darkmode');
270-
if (saved === 'true') {
271-
content.classList.add('darkmode');
272-
} else if (saved === 'false') {
273-
content.classList.remove('darkmode');
274-
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
275-
content.classList.add('darkmode');
276-
}
277-
}
278-
279-
function toggleDarkMode() {
280-
if (content.classList.contains('darkmode')) {
281-
content.classList.remove('darkmode');
282-
localStorage.setItem('darkmode', 'false');
283-
} else {
284-
content.classList.add('darkmode');
285-
localStorage.setItem('darkmode', 'true');
286-
}
287-
}
288-
289-
window.addEventListener('load', applyPreference);
290-
</script>
270+
<script src="/Assets/js/darkmode.js"></script>
291271

292272
</body>
293273
</html>

Git/GitCommand/bisect.html

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Git Bisect - Article Template</title>
7-
8-
<link rel="stylesheet" href="https://www.w3schools.com/w3css/5/w3.css">
9-
10-
<style>
11-
:root {
12-
--sidebar-width: 220px;
13-
--sidebar-bg: #003366;
14-
--accent: #ff3333;
15-
--text: #111;
16-
--bg: #ffffff;
17-
--card: #f7f7f7;
18-
--border: #ddd;
19-
}
20-
21-
body {
22-
margin: 0;
23-
font-family: Arial, sans-serif;
24-
background: var(--bg);
25-
color: var(--text);
26-
}
27-
28-
.sidebar {
29-
height: 100vh;
30-
overflow-y: auto;
31-
position: fixed;
32-
width: var(--sidebar-width);
7+
338
background-color: var(--sidebar-bg);
349
color: white;
3510
padding-bottom: 20px;
@@ -207,6 +182,11 @@
207182
<!-- Sidebar / Navigation -->
208183
<div class="sidebar w3-card">
209184
<h2>Git Docs</h2>
185+
<h3>Basics of Github</h3>
186+
<a href="../GitHub/Github-Setup.html">Setting Up Github</a>
187+
<a href="../GitHub/Github-First-Repo.html">Making your First Repo</a>
188+
<a href="../GitHub/Github-Merges.html">Intro to Merges</a>
189+
<a href="../GitHub/Github-Forks.html">Intro to Forks</a>
210190

211191
<!-- GLOBAL COMMAND LIST -->
212192
<h3>Previous</h3>
@@ -356,34 +336,7 @@ <h2>Practice</h2>
356336
</div>
357337
</div>
358338

359-
<script>
360-
const content = document.getElementById('mainContent');
361-
362-
function applyPreference() {
363-
const saved = localStorage.getItem('darkmode');
364-
if (saved === 'true') {
365-
content.classList.add('darkmode');
366-
} else if (saved === 'false') {
367-
content.classList.remove('darkmode');
368-
} else {
369-
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
370-
content.classList.add('darkmode');
371-
}
372-
}
373-
}
374-
375-
function toggleDarkMode() {
376-
if (content.classList.contains('darkmode')) {
377-
content.classList.remove('darkmode');
378-
localStorage.setItem('darkmode', 'false');
379-
} else {
380-
content.classList.add('darkmode');
381-
localStorage.setItem('darkmode', 'true');
382-
}
383-
}
384-
385-
window.addEventListener('load', applyPreference);
386-
</script>
339+
<script src="/Assets/js/darkmode.js"></script>
387340

388341
</body>
389342
</html>

Git/GitCommand/branch.html

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Git Branch</title>
7-
8-
<link rel="stylesheet" href="https://www.w3schools.com/w3css/5/w3.css">
9-
10-
<style>
11-
:root {
12-
--sidebar-width: 220px;
13-
--sidebar-bg: #003366;
14-
--accent: #ff3333;
15-
--text: #111;
16-
--bg: #ffffff;
17-
--card: #f7f7f7;
18-
--border: #ddd;
19-
}
20-
21-
body {
22-
margin: 0;
23-
font-family: Arial, sans-serif;
24-
background: var(--bg);
25-
color: var(--text);
26-
}
27-
28-
.sidebar {
29-
height: 100vh;
30-
overflow-y: auto;
31-
position: fixed;
7+
<script src="/Assets/js/darkmode.js"></script>
328
width: var(--sidebar-width);
339
background-color: var(--sidebar-bg);
3410
color: white;
@@ -169,6 +145,11 @@
169145
<!-- Sidebar -->
170146
<div class="sidebar w3-card">
171147
<h2>Git Docs</h2>
148+
<h3>Basics of Github</h3>
149+
<a href="../GitHub/Github-Setup.html">Setting Up Github</a>
150+
<a href="../GitHub/Github-First-Repo.html">Making your First Repo</a>
151+
<a href="../GitHub/Github-Merges.html">Intro to Merges</a>
152+
<a href="../GitHub/Github-Forks.html">Intro to Forks</a>
172153

173154
<h3>Previous</h3>
174155
<a href="./backfill.html">backfill</a>
@@ -281,32 +262,7 @@ <h3>Wrong branch renamed</h3>
281262

282263
</div>
283264

284-
<script>
285-
const content = document.getElementById('mainContent');
286-
287-
function applyPreference() {
288-
const saved = localStorage.getItem('darkmode');
289-
if (saved === 'true') {
290-
content.classList.add('darkmode');
291-
} else if (saved === 'false') {
292-
content.classList.remove('darkmode');
293-
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
294-
content.classList.add('darkmode');
295-
}
296-
}
297-
298-
function toggleDarkMode() {
299-
if (content.classList.contains('darkmode')) {
300-
content.classList.remove('darkmode');
301-
localStorage.setItem('darkmode', 'false');
302-
} else {
303-
content.classList.add('darkmode');
304-
localStorage.setItem('darkmode', 'true');
305-
}
306-
}
307-
308-
window.addEventListener('load', applyPreference);
309-
</script>
265+
<script src="/Assets/js/darkmode.js"></script>
310266

311267
</body>
312268
</html>

0 commit comments

Comments
 (0)