Skip to content

Commit b302bd9

Browse files
committed
add dracula and alucard themes
1 parent 8587df1 commit b302bd9

4 files changed

Lines changed: 59 additions & 10 deletions

File tree

packages/newtab/newtab.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
<option value="catppuccin">Catppuccin</option>
6565
<option value="nord">Nord</option>
6666
<option value="solarized">Solarized</option>
67+
<option value="dracula">Dracula</option>
6768
</select>
6869

6970
<div class="setting-row">

packages/sidebar/panel.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
<option value="catppuccin">Catppuccin</option>
6565
<option value="nord">Nord</option>
6666
<option value="solarized">Solarized</option>
67+
<option value="dracula">Dracula</option>
6768
</select>
6869

6970
<div class="setting-row">

shared/colors.js

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const colorManager = {
2222
}
2323
},
2424

25-
// Catppuccin-inspired color presets
25+
// Catppuccin
2626
catppuccin: {
2727
latte: {
2828
name: 'Catppuccin Latte',
@@ -44,7 +44,7 @@ const colorManager = {
4444
}
4545
},
4646

47-
// Nord theme - Arctic, north-bluish color palette
47+
// Nord theme
4848
nord: {
4949
light: {
5050
name: 'Nord Light',
@@ -66,7 +66,7 @@ const colorManager = {
6666
}
6767
},
6868

69-
// Solarized - Precision colors for readability
69+
// Solarized
7070
solarized: {
7171
light: {
7272
name: 'Solarized Light',
@@ -88,6 +88,28 @@ const colorManager = {
8888
}
8989
},
9090

91+
// Dracula
92+
dracula: {
93+
dark: {
94+
name: 'Dracula',
95+
bg: '#282A36',
96+
fg: '#F8F8F2',
97+
accent: '#FF79C6',
98+
border: '#44475A',
99+
subtle: '#6272A4',
100+
shadow: 'rgba(40, 42, 54, 0.5)'
101+
},
102+
light: {
103+
name: 'Alucard',
104+
bg: '#FFFBEB',
105+
fg: '#1F1F1F',
106+
accent: '#A3144D',
107+
border: '#CFCFDE',
108+
subtle: '#6C664B',
109+
shadow: 'rgba(255, 251, 235, 0.5)'
110+
}
111+
},
112+
91113
// Initialize color system
92114
init() {
93115
const savedTheme = localStorage.getItem('notekeeper-theme') || 'default';
@@ -120,6 +142,11 @@ const colorManager = {
120142
const currentVariant = localStorage.getItem('solarized-variant') || 'light';
121143
theme = this.solarized[currentVariant];
122144
isDarkMode = currentVariant === 'dark';
145+
} else if (themeName === 'dracula') {
146+
// Use Dracula behavior
147+
const currentVariant = localStorage.getItem('dracula-variant') || 'dark';
148+
theme = this.dracula[currentVariant];
149+
isDarkMode = currentVariant === 'dark';
123150
} else {
124151
// Direct theme selection
125152
if (themeName.startsWith('catppuccin-')) {
@@ -130,11 +157,15 @@ const colorManager = {
130157
const nordVariant = themeName.replace('nord-', '');
131158
theme = this.nord[nordVariant];
132159
isDarkMode = nordVariant === 'dark';
133-
} else if (themeName.startsWith('solarized-')) {
134-
const solarizedVariant = themeName.replace('solarized-', '');
135-
theme = this.solarized[solarizedVariant];
136-
isDarkMode = solarizedVariant === 'dark';
137-
} else {
160+
} else if (themeName.startsWith('solarized-')) {
161+
const solarizedVariant = themeName.replace('solarized-', '');
162+
theme = this.solarized[solarizedVariant];
163+
isDarkMode = solarizedVariant === 'dark';
164+
} else if (themeName.startsWith('dracula-')) {
165+
const draculaVariant = themeName.replace('dracula-', '');
166+
theme = this.dracula[draculaVariant];
167+
isDarkMode = draculaVariant === 'dark';
168+
} else {
138169
theme = this.defaults[themeName];
139170
isDarkMode = themeName === 'dark';
140171
}
@@ -191,6 +222,12 @@ const colorManager = {
191222
const nextVariant = currentVariant === 'light' ? 'dark' : 'light';
192223
localStorage.setItem('solarized-variant', nextVariant);
193224
this.applyTheme('solarized');
225+
} else if (currentTheme === 'dracula') {
226+
// Toggle light/dark in dracula mode
227+
const currentVariant = localStorage.getItem('dracula-variant') || 'dark';
228+
const nextVariant = currentVariant === 'light' ? 'dark' : 'light';
229+
localStorage.setItem('dracula-variant', nextVariant);
230+
this.applyTheme('dracula');
194231
} else {
195232
// Direct theme selection - toggle between default themes
196233
const nextTheme = currentTheme === 'light' ? 'dark' : 'light';
@@ -214,6 +251,9 @@ const colorManager = {
214251
} else if (currentTheme === 'solarized') {
215252
const currentVariant = localStorage.getItem('solarized-variant') || 'light';
216253
return currentVariant === 'light' ? 'dark' : 'light';
254+
} else if (currentTheme === 'dracula') {
255+
const currentVariant = localStorage.getItem('dracula-variant') || 'dark';
256+
return currentVariant === 'light' ? 'dark' : 'light';
217257
}
218258
return currentTheme === 'light' ? 'dark' : 'light';
219259
},
@@ -224,7 +264,7 @@ const colorManager = {
224264
}
225265
};
226266

227-
// Initialize theme selector dropdown value
267+
// Initialize theme selector dropdown value
228268
const initThemeSelector = () => {
229269
const currentTheme = colorManager.getCurrentTheme();
230270
const themeSelector = document.getElementById('theme-selector');
@@ -242,6 +282,9 @@ document.addEventListener('DOMContentLoaded', () => {
242282
if (!localStorage.getItem('solarized-variant')) {
243283
localStorage.setItem('solarized-variant', 'light');
244284
}
285+
if (!localStorage.getItem('dracula-variant')) {
286+
localStorage.setItem('dracula-variant', 'dark');
287+
}
245288

246289
colorManager.init();
247290
initThemeSelector();

shared/preload.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ if (savedTheme === 'default') {
1717
const nordVariant = localStorage.getItem("nord-variant") || "light";
1818
actualTheme = nordVariant === "dark" ? "dark" : "light";
1919
} else if (savedTheme === 'solarized') {
20-
// For solarized theme, check the variant storage
20+
// For solarized theme, check variant storage
2121
const solarizedVariant = localStorage.getItem("solarized-variant") || "light";
2222
actualTheme = solarizedVariant === "dark" ? "dark" : "light";
23+
} else if (savedTheme === 'dracula') {
24+
// For dracula theme, check variant storage
25+
const draculaVariant = localStorage.getItem("dracula-variant") || "dark";
26+
actualTheme = draculaVariant === "dark" ? "dark" : "light";
2327
}
2428

2529
document.documentElement.setAttribute("data-theme", actualTheme || (sysTheme ? "dark" : "light"));

0 commit comments

Comments
 (0)