Skip to content

Commit 4e716fb

Browse files
committed
feat: add Peras art theme and 3-way theme switch
1 parent 5a1cdd7 commit 4e716fb

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

css/screen.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,31 @@
4242
--transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
4343
}
4444

45+
/* Peras Art Theme - UI Concept Style */
46+
[data-theme="peras"] {
47+
--bg-page: #F4F0EA; /* Muted warm beige background */
48+
--bg-card: #FFFFFF; /* Pure white cards for float effect */
49+
--bg-card-rgb: 255, 255, 255;
50+
--bg-subtle: #EAE4D9; /* Warm interactive elements */
51+
--bg-code: #1A2235; /* Deep navy for code */
52+
--border-color: rgba(0, 0, 0, 0.05);
53+
--border-subtle: rgba(0, 0, 0, 0.02);
54+
55+
--text-main: #1A2235; /* Deep navy for text */
56+
--text-muted: #64748B; /* Cool slate for secondary */
57+
--text-light: #94A3B8; /* Light slate */
58+
--text-olive: #475569; /* Darker slate */
59+
60+
--brand-primary: #2563EB; /* Vibrant interactive blue */
61+
--brand-hover: #1D4ED8;
62+
--brand-light: #EFF6FF;
63+
--tag-bg: #F1F5F9; /* Slate 100 for tags */
64+
65+
--shadow-sm: 0 4px 20px rgba(26, 34, 53, 0.04);
66+
--shadow-md: 0 12px 30px rgba(26, 34, 53, 0.06);
67+
--shadow-hover: 0 16px 40px rgba(26, 34, 53, 0.08);
68+
}
69+
4570
[data-theme="dark"] {
4671
/* Dark Theme - Kami Dark Surface & Warm Charcoal */
4772
--bg-page: #141413; /* Deep dark warm background */

js/main.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ document.addEventListener('DOMContentLoaded', function() {
66

77
const sunSVG = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>`;
88
const moonSVG = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/></svg>`;
9+
const paletteSVG = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="13.5" cy="6.5" r=".5"/><circle cx="17.5" cy="10.5" r=".5"/><circle cx="8.5" cy="7.5" r=".5"/><circle cx="6.5" cy="12.5" r=".5"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"/></svg>`;
910

1011
function updateThemeUI(theme) {
1112
if (!toggleBtn) return;
1213
if (theme === 'dark') {
14+
if (themeIconContainer) themeIconContainer.innerHTML = paletteSVG;
15+
if (themeLabel) themeLabel.textContent = 'Peras';
16+
} else if (theme === 'peras') {
1317
if (themeIconContainer) themeIconContainer.innerHTML = sunSVG;
1418
if (themeLabel) themeLabel.textContent = 'Light';
1519
} else {
@@ -21,10 +25,15 @@ document.addEventListener('DOMContentLoaded', function() {
2125
const currentTheme = document.documentElement.getAttribute('data-theme') || 'light';
2226
updateThemeUI(currentTheme);
2327

28+
const themes = ['light', 'dark', 'peras'];
29+
2430
if (toggleBtn) {
2531
toggleBtn.addEventListener('click', function() {
26-
const activeTheme = document.documentElement.getAttribute('data-theme');
27-
const newTheme = activeTheme === 'dark' ? 'light' : 'dark';
32+
const activeTheme = document.documentElement.getAttribute('data-theme') || 'light';
33+
let currentIndex = themes.indexOf(activeTheme);
34+
if (currentIndex === -1) currentIndex = 0;
35+
const newTheme = themes[(currentIndex + 1) % themes.length];
36+
2837
document.documentElement.setAttribute('data-theme', newTheme);
2938
localStorage.setItem('42devops-theme', newTheme);
3039
updateThemeUI(newTheme);

0 commit comments

Comments
 (0)