Skip to content

Commit 46436e3

Browse files
committed
Cleaned up settings.ts + Formatted
1 parent bf6839a commit 46436e3

3 files changed

Lines changed: 291 additions & 326 deletions

File tree

src/global.css

Lines changed: 129 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@tailwind utilities;
55

66
@layer base {
7-
:root {
7+
:root {
88
--background: #222;
99
--background-secondary: #282828;
1010
--background-settings: #171717;
@@ -17,158 +17,151 @@
1717
--text: #fff;
1818
--text-secondary: #ddd;
1919
--text-placeholder: #666;
20-
}
21-
22-
[data-theme="ocean"] {
23-
--background: #0f172a;
24-
--background-secondary: #1e293b;
25-
--background-settings: #080e18;
26-
--interactive: #334155;
27-
--interactive-secondary: #64748b;
28-
--dropdown: #1e293b;
29-
--border: #475569;
30-
--accent: #3b82f6;
31-
--accent-secondary: #93c5fd;
32-
--text: #f8fafc;
33-
--text-secondary: #cbd5e1;
34-
--text-placeholder: #94a3b8;
35-
36-
}
37-
38-
[data-theme="forest"] {
39-
--background: #141c14;
40-
--background-secondary: #222d22;
41-
--background-settings: #0c120c;
42-
--interactive: #2d3c2d;
43-
--interactive-secondary: #4b644b;
44-
--dropdown: #222d22;
45-
--border: #3c503c;
46-
--accent: #22c55e;
47-
--accent-secondary: #4ade80;
48-
--text: #f0fdf4;
49-
--text-secondary: #bbf7d0;
50-
--text-placeholder: #86efac;
51-
52-
}
53-
54-
[data-theme="sunset"] {
55-
--background: #2d0f0f;
56-
--background-secondary: #3c1e1e;
57-
--background-settings: #1e0808;
58-
--interactive: #502d2d;
59-
--interactive-secondary: #784b4b;
60-
--dropdown: #3c1e1e;
61-
--border: #643c3c;
62-
--accent: #fb923c;
63-
--accent-secondary: #fed7aa;
64-
--text: #fef2f2;
65-
--text-secondary: #fca5a5;
66-
--text-placeholder: #f87171;
67-
68-
}
69-
70-
[data-theme="purple"] {
71-
--background: #1f0f2d;
72-
--background-secondary: #2e1e3c;
73-
--background-settings: #14081e;
74-
--interactive: #412d50;
75-
--interactive-secondary: #644b78;
76-
--dropdown: #2e1e3c;
77-
--border: #503c64;
78-
--accent: #a855f7;
79-
--accent-secondary: #c4b5fd;
80-
--text: #faf5ff;
81-
--text-secondary: #ddd6fe;
82-
--text-placeholder: #a78bfa;
83-
84-
}
85-
86-
[data-theme="midnight"] {
87-
--background: #0a0a14;
88-
--background-secondary: #14141e;
89-
--background-settings: #05050f;
90-
--interactive: #1e1e28;
91-
--interactive-secondary: #3c3c50;
92-
--dropdown: #14141e;
93-
--border: #28283c;
94-
--accent: #6366f1;
95-
--accent-secondary: #a5b4fc;
96-
--text: #f5f5ff;
97-
--text-secondary: #cbd5e8;
98-
--text-placeholder: #818cf8;
99-
100-
}
101-
102-
[data-theme="light"] {
103-
--background: #ffffff;
104-
--background-secondary: #f8fafc;
105-
--background-settings: #f1f5f9;
106-
--interactive: #e2e8f0;
107-
--interactive-secondary: #94a3b8;
108-
--dropdown: #ffffff;
109-
--border: #cbd5e1;
110-
--accent: #3b82f6;
111-
--accent-secondary: #1e40af;
112-
--text: #0f172a;
113-
--text-secondary: #334155;
114-
--text-placeholder: #64748b;
115-
116-
}
117-
118-
/* Black Theme */
119-
[data-theme="black"] {
120-
--background: #000000;
121-
--background-secondary: #0a0a0a;
122-
--background-settings: #050505;
123-
--interactive: #141414;
124-
--interactive-secondary: #3c3c3c;
125-
--dropdown: #0f0f0f;
126-
--border: #282828;
127-
--accent: #ffffff;
128-
--accent-secondary: #c8c8c8;
129-
--text: #ffffff;
130-
--text-secondary: #c8c8c8;
131-
--text-placeholder: #787878;
132-
133-
}
20+
}
21+
22+
[data-theme="ocean"] {
23+
--background: #0f172a;
24+
--background-secondary: #1e293b;
25+
--background-settings: #080e18;
26+
--interactive: #334155;
27+
--interactive-secondary: #64748b;
28+
--dropdown: #1e293b;
29+
--border: #475569;
30+
--accent: #3b82f6;
31+
--accent-secondary: #93c5fd;
32+
--text: #f8fafc;
33+
--text-secondary: #cbd5e1;
34+
--text-placeholder: #94a3b8;
35+
}
36+
37+
[data-theme="forest"] {
38+
--background: #141c14;
39+
--background-secondary: #222d22;
40+
--background-settings: #0c120c;
41+
--interactive: #2d3c2d;
42+
--interactive-secondary: #4b644b;
43+
--dropdown: #222d22;
44+
--border: #3c503c;
45+
--accent: #22c55e;
46+
--accent-secondary: #4ade80;
47+
--text: #f0fdf4;
48+
--text-secondary: #bbf7d0;
49+
--text-placeholder: #86efac;
50+
}
51+
52+
[data-theme="sunset"] {
53+
--background: #2d0f0f;
54+
--background-secondary: #3c1e1e;
55+
--background-settings: #1e0808;
56+
--interactive: #502d2d;
57+
--interactive-secondary: #784b4b;
58+
--dropdown: #3c1e1e;
59+
--border: #643c3c;
60+
--accent: #fb923c;
61+
--accent-secondary: #fed7aa;
62+
--text: #fef2f2;
63+
--text-secondary: #fca5a5;
64+
--text-placeholder: #f87171;
65+
}
66+
67+
[data-theme="purple"] {
68+
--background: #1f0f2d;
69+
--background-secondary: #2e1e3c;
70+
--background-settings: #14081e;
71+
--interactive: #412d50;
72+
--interactive-secondary: #644b78;
73+
--dropdown: #2e1e3c;
74+
--border: #503c64;
75+
--accent: #a855f7;
76+
--accent-secondary: #c4b5fd;
77+
--text: #faf5ff;
78+
--text-secondary: #ddd6fe;
79+
--text-placeholder: #a78bfa;
80+
}
81+
82+
[data-theme="midnight"] {
83+
--background: #0a0a14;
84+
--background-secondary: #14141e;
85+
--background-settings: #05050f;
86+
--interactive: #1e1e28;
87+
--interactive-secondary: #3c3c50;
88+
--dropdown: #14141e;
89+
--border: #28283c;
90+
--accent: #6366f1;
91+
--accent-secondary: #a5b4fc;
92+
--text: #f5f5ff;
93+
--text-secondary: #cbd5e8;
94+
--text-placeholder: #818cf8;
95+
}
96+
97+
[data-theme="light"] {
98+
--background: #ffffff;
99+
--background-secondary: #f8fafc;
100+
--background-settings: #f1f5f9;
101+
--interactive: #e2e8f0;
102+
--interactive-secondary: #94a3b8;
103+
--dropdown: #ffffff;
104+
--border: #cbd5e1;
105+
--accent: #3b82f6;
106+
--accent-secondary: #1e40af;
107+
--text: #0f172a;
108+
--text-secondary: #334155;
109+
--text-placeholder: #64748b;
110+
}
111+
112+
/* Black Theme */
113+
[data-theme="black"] {
114+
--background: #000000;
115+
--background-secondary: #0a0a0a;
116+
--background-settings: #050505;
117+
--interactive: #141414;
118+
--interactive-secondary: #3c3c3c;
119+
--dropdown: #0f0f0f;
120+
--border: #282828;
121+
--accent: #ffffff;
122+
--accent-secondary: #c8c8c8;
123+
--text: #ffffff;
124+
--text-secondary: #c8c8c8;
125+
--text-placeholder: #787878;
126+
}
134127
}
135128

136129
@layer base {
137-
body {
138-
@apply h-full font-sans bg-background text-text;
139-
}
130+
body {
131+
@apply h-full font-sans bg-background text-text;
132+
}
140133

141-
* {
142-
@apply border-border;
143-
}
134+
* {
135+
@apply border-border;
136+
}
144137
}
145138

146139
::-webkit-scrollbar {
147-
width: 6px;
148-
background-color: var(--background-secondary);
140+
width: 6px;
141+
background-color: var(--background-secondary);
149142
}
150143

151144
::-webkit-scrollbar-track {
152-
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
153-
border-radius: 10px;
154-
background-color: var(--background);
145+
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
146+
border-radius: 10px;
147+
background-color: var(--background);
155148
}
156149

157150
::-webkit-scrollbar-thumb {
158-
border-radius: 10px;
159-
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
160-
background-color: var(--text);
151+
border-radius: 10px;
152+
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
153+
background-color: var(--text);
161154
}
162155

163156
::-webkit-scrollbar-thumb:hover {
164-
background-color: var(--text-secondary);
157+
background-color: var(--text-secondary);
165158
}
166159

167160
[type="search"]::-webkit-search-cancel-button {
168-
-webkit-appearance: none;
169-
background-color: var(--text);
170-
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>");
171-
background-size: 20px 20px;
172-
height: 20px;
173-
width: 20px;
161+
-webkit-appearance: none;
162+
background-color: var(--text);
163+
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>");
164+
background-size: 20px 20px;
165+
height: 20px;
166+
width: 20px;
174167
}

src/lib/global.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ document.addEventListener("astro:page-load", () => {
44
const savedTheme = localStorage.getItem("theme");
55
if (savedTheme) {
66
const themeMap: Record<string, string> = {
7-
'Default': 'default',
8-
'Ocean': 'ocean',
9-
'Forest': 'forest',
10-
'Sunset': 'sunset',
11-
'Purple': 'purple',
12-
'Midnight': 'midnight',
13-
'White': 'light',
14-
'Black': 'black'
7+
Default: "default",
8+
Ocean: "ocean",
9+
Forest: "forest",
10+
Sunset: "sunset",
11+
Purple: "purple",
12+
Midnight: "midnight",
13+
White: "light",
14+
Black: "black",
1515
};
16-
16+
1717
const dataTheme = themeMap[savedTheme];
18-
if (dataTheme && dataTheme !== 'default') {
19-
document.documentElement.setAttribute('data-theme', dataTheme);
18+
if (dataTheme && dataTheme !== "default") {
19+
document.documentElement.setAttribute("data-theme", dataTheme);
2020
}
2121
}
2222

@@ -88,7 +88,6 @@ document.addEventListener("astro:page-load", () => {
8888
}
8989
}
9090

91-
9291
const Key = localStorage.getItem("key") || "";
9392
const PanicKeys = Key.split(",").map((key) => key.trim());
9493
let PanicLink = localStorage.getItem("link") || "";

0 commit comments

Comments
 (0)