Skip to content

Commit a5c70b1

Browse files
authored
update stylesheet (#26)
okie dokie
1 parent 6cf5c35 commit a5c70b1

27 files changed

+2176
-1360
lines changed

components/chead.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
1919
<link rel="stylesheet" href="/assets/styles/home.css" />
2020
<link rel="stylesheet" href="/assets/styles/master.css" />
21+
<link rel="stylesheet" href="/assets/styles/theme-1.css" />
22+
<link rel="stylesheet" href="/assets/styles/theme-2.css" />
23+
<link rel="stylesheet" href="/assets/styles/theme-3.css" />
2124
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
2225
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
2326
crossorigin="anonymous" referrerpolicy="no-referrer" />

components/lightDarkToggle.html

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
<div class = "cc lightDarkToggle">
2-
<input type="checkbox" class="cc checkbox" id="checkbox">
3-
<label for="checkbox" class="cc checkbox-label">
4-
<i class="cc fas fa-moon"></i>
5-
<i class="cc fas fa-sun"></i>
6-
<span class="cc ball"></span>
7-
</label>
1+
<div class="theme-switcher">
2+
<select id="theme-select">
3+
<option value="classic">Classic</option>
4+
<option value="future">Future</option>
5+
<option value="vintage">Vintage</option>
6+
<option value="ocean">Ocean</option>
7+
</select>
88
</div>
99

10-
<script src = "/assets/scripts/lightDarkToggle.js"></script>
11-
<!--
12-
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
13-
<script>
14-
kofiWidgetOverlay.draw('ccported', {
15-
'type': 'floating-chat',
16-
'floating-chat.donateButton.text': 'Support me',
17-
'floating-chat.donateButton.background-color': '#323842',
18-
'floating-chat.donateButton.text-color': '#fff'
19-
});
20-
</script> -->
10+
<script src="/assets/scripts/lightDarkToggle.js"></script>

static/assets/scripts/helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ async function enforceDonationLockout() {
631631
const currentDomain = window.location.hostname;
632632

633633
// If current host is not in allowedHosts, show complete lockout and disable access
634-
// if (!allowedHosts.includes(currentDomain)) {
634+
if (!allowedHosts.includes(currentDomain)) {
635635
document.body.innerHTML = `
636636
<div style="display:flex;align-items:center;justify-content:center;height:100vh;background:#111;color:#fff;font-family:sans-serif;text-align:center;">
637637
<div>
@@ -646,7 +646,7 @@ async function enforceDonationLockout() {
646646
document.body.style.userSelect = "none";
647647
window.locked = true;
648648
return;
649-
// }
649+
}
650650
} catch (err) {
651651
console.error('Failed to check donation status:', err);
652652
}
Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
const theme = localStorage.getItem("[ns_ccported]_theme") || "light";
2-
const lightDarkToggle = document.querySelector(".cc.lightDarkToggle .cc.checkbox");
3-
if(theme == "dark"){
4-
document.body.classList.add("dark");
5-
lightDarkToggle.checked = true;
6-
}
7-
checkbox.addEventListener("change", (e) => {
8-
document.body.classList.toggle("dark");
9-
localStorage.setItem("[ns_ccported]_theme", document.body.classList.contains("dark") ? "dark" : "light");
10-
})
1+
2+
document.addEventListener('DOMContentLoaded', () => {
3+
const themeSelect = document.getElementById('theme-select');
4+
const body = document.body;
5+
const setTheme = (theme) => {
6+
body.classList.remove('classic', 'future', 'vintage', 'ocean');
7+
body.classList.add(theme);
8+
localStorage.setItem('theme', theme);
9+
themeSelect.value = theme;
10+
};
11+
12+
themeSelect.addEventListener('change', () => {
13+
setTheme(themeSelect.value);
14+
});
15+
16+
const savedTheme = localStorage.getItem('theme') || 'vintage';
17+
setTheme(savedTheme);
18+
});

0 commit comments

Comments
 (0)