Skip to content

Commit 6b92133

Browse files
Bikram GoleBikram Gole
authored andcommitted
Remove Material 3 palette selector and related logic
1 parent 25392ab commit 6b92133

5 files changed

Lines changed: 0 additions & 122 deletions

File tree

about.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@
6363
<option value="paper">Paper Link</option>
6464
<option value="blackflag">Black Flag Uprising</option>
6565
</select>
66-
<label for="m3-palette-select" class="theme-top-label m3-palette-label">M3</label>
67-
<select id="m3-palette-select" class="theme-top-select m3-palette-select" aria-label="Material 3 palette">
68-
<option value="lavender">Lavender</option>
69-
<option value="emerald">Emerald</option>
70-
<option value="sunset">Sunset</option>
71-
</select>
7266
</div>
7367
</header>
7468

contact.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@
6363
<option value="paper">Paper Link</option>
6464
<option value="blackflag">Black Flag Uprising</option>
6565
</select>
66-
<label for="m3-palette-select" class="theme-top-label m3-palette-label">M3</label>
67-
<select id="m3-palette-select" class="theme-top-select m3-palette-select" aria-label="Material 3 palette">
68-
<option value="lavender">Lavender</option>
69-
<option value="emerald">Emerald</option>
70-
<option value="sunset">Sunset</option>
71-
</select>
7266
</div>
7367
</header>
7468

index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@
6363
<option value="paper">Paper Link</option>
6464
<option value="blackflag">Black Flag Uprising</option>
6565
</select>
66-
<label for="m3-palette-select" class="theme-top-label m3-palette-label">M3</label>
67-
<select id="m3-palette-select" class="theme-top-select m3-palette-select" aria-label="Material 3 palette">
68-
<option value="lavender">Lavender</option>
69-
<option value="emerald">Emerald</option>
70-
<option value="sunset">Sunset</option>
71-
</select>
7266
<button id="theme-cycle-btn" class="theme-cycle-btn" type="button" aria-label="Cycle theme"></button>
7367
</div>
7468
</header>

script.js

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ const quizStartBtn = document.getElementById("quiz-start");
131131
const quizResetBtn = document.getElementById("quiz-reset");
132132
const quizScore = document.getElementById("quiz-score");
133133
const headerThemeSelect = document.getElementById("header-theme-select");
134-
const material3PaletteSelect = document.getElementById("m3-palette-select");
135134
const themeCycleBtn = document.getElementById("theme-cycle-btn");
136135
const heroName = document.getElementById("hero-name");
137136
const heroStatus = document.getElementById("hero-status");
@@ -145,7 +144,6 @@ const miniTerminalTheme = document.getElementById("mini-terminal-theme");
145144
const NEPAL_TIMEZONE = "Asia/Kathmandu";
146145
const BS_CONVERTER_URL = "https://cdn.jsdelivr.net/npm/nepali-date-library@1.1.9/+esm";
147146
const THEME_STORAGE_KEY = "neoThemeVariant.v1";
148-
const M3_PALETTE_STORAGE_KEY = "neoMaterial3Palette.v1";
149147
const ACTION_STORAGE_KEY = "neoAutoAction.v1";
150148
const HERO_TYPED_KEY = "neoHeroTyped.v1";
151149
const MINI_PROMPT = "╰─❯";
@@ -170,7 +168,6 @@ const THEME_OPTIONS = [
170168
"paper",
171169
"blackflag",
172170
];
173-
const MATERIAL3_PALETTES = ["lavender", "emerald", "sunset"];
174171
const MAX_TERMINAL_LINES = 220;
175172
const TERMINAL_COMMANDS = [
176173
"help", "whoami", "mission", "status", "clear",
@@ -184,7 +181,6 @@ let launches = 0;
184181
let adToBsConverter = null;
185182
let startPersonaQuiz = null;
186183
let currentTheme = "neo";
187-
let currentMaterial3Palette = "lavender";
188184
let terminalHistory = [];
189185
let terminalHistoryIndex = 0;
190186
let terminalDraft = "";
@@ -731,11 +727,6 @@ function applyTheme(theme, notify = false) {
731727
miniTerminalTheme.textContent = `theme: ${selected}`;
732728
}
733729

734-
document.body.classList.toggle("m3-palette-active", selected === "material3");
735-
if (selected === "material3") {
736-
applyMaterial3Palette(currentMaterial3Palette, false);
737-
}
738-
739730
try {
740731
window.localStorage.setItem(THEME_STORAGE_KEY, selected);
741732
} catch (error) {
@@ -748,73 +739,33 @@ function applyTheme(theme, notify = false) {
748739
if (notify) showToast(`Theme changed: ${selected}`);
749740
}
750741

751-
function applyMaterial3Palette(palette, notify = false) {
752-
const selected = MATERIAL3_PALETTES.includes(palette) ? palette : "lavender";
753-
currentMaterial3Palette = selected;
754-
document.documentElement.dataset.m3Palette = selected;
755-
document.body.dataset.m3Palette = selected;
756-
if (material3PaletteSelect) {
757-
material3PaletteSelect.value = selected;
758-
}
759-
760-
try {
761-
window.localStorage.setItem(M3_PALETTE_STORAGE_KEY, selected);
762-
} catch (error) {
763-
// Ignore storage errors.
764-
}
765-
766-
if (notify && currentTheme === "material3") {
767-
showToast(`M3 palette: ${selected}`);
768-
}
769-
}
770-
771742
function initThemeSwitcher() {
772743
let savedTheme = "neo";
773744
let urlTheme = null;
774-
let savedPalette = "lavender";
775745
try {
776746
urlTheme = getThemeFromUrl();
777747
const storedTheme = window.localStorage.getItem(THEME_STORAGE_KEY);
778-
const storedPalette = window.localStorage.getItem(M3_PALETTE_STORAGE_KEY);
779748
savedTheme = storedTheme || urlTheme || "neo";
780-
savedPalette = MATERIAL3_PALETTES.includes(storedPalette) ? storedPalette : "lavender";
781749
if (!storedTheme && urlTheme) {
782750
window.localStorage.setItem(THEME_STORAGE_KEY, urlTheme);
783751
}
784752
} catch (error) {
785753
savedTheme = "neo";
786-
savedPalette = "lavender";
787754
}
788755

789-
applyMaterial3Palette(savedPalette, false);
790756
applyTheme(savedTheme, false);
791757
window.addEventListener("pageshow", () => {
792758
let latestTheme = "neo";
793-
let latestPalette = "lavender";
794759
try {
795760
latestTheme = window.localStorage.getItem(THEME_STORAGE_KEY) || getThemeFromUrl() || "neo";
796-
const storedPalette = window.localStorage.getItem(M3_PALETTE_STORAGE_KEY);
797-
latestPalette = MATERIAL3_PALETTES.includes(storedPalette) ? storedPalette : "lavender";
798761
} catch (error) {
799762
latestTheme = "neo";
800-
latestPalette = "lavender";
801-
}
802-
if (latestPalette !== currentMaterial3Palette) {
803-
applyMaterial3Palette(latestPalette, false);
804763
}
805764
if (latestTheme !== currentTheme) {
806765
applyTheme(latestTheme, false);
807766
}
808767
});
809768
window.addEventListener("storage", (event) => {
810-
if (event.key === M3_PALETTE_STORAGE_KEY && event.newValue) {
811-
if (!MATERIAL3_PALETTES.includes(event.newValue)) return;
812-
if (event.newValue !== currentMaterial3Palette) {
813-
applyMaterial3Palette(event.newValue, false);
814-
}
815-
return;
816-
}
817-
818769
if (event.key !== THEME_STORAGE_KEY || !event.newValue) return;
819770
if (!THEME_OPTIONS.includes(event.newValue)) return;
820771
if (event.newValue !== currentTheme) {
@@ -825,10 +776,6 @@ function initThemeSwitcher() {
825776
applyTheme(event.target.value, true);
826777
});
827778

828-
material3PaletteSelect?.addEventListener("change", (event) => {
829-
applyMaterial3Palette(event.target.value, true);
830-
});
831-
832779
themeCycleBtn?.addEventListener("click", () => {
833780
const idx = THEME_OPTIONS.indexOf(currentTheme);
834781
const next = THEME_OPTIONS[(idx + 1 + THEME_OPTIONS.length) % THEME_OPTIONS.length];
@@ -1489,9 +1436,6 @@ function initCommandPalette() {
14891436
{ label: "Theme: Sunset Warp", keywords: "theme sunset orange", run: () => applyTheme("sunset", true) },
14901437
{ label: "Theme: Liquid Glass", keywords: "theme liquid glass apple", run: () => applyTheme("liquidglass", true) },
14911438
{ label: "Theme: Material 3", keywords: "theme material3 google", run: () => applyTheme("material3", true) },
1492-
{ label: "M3 Palette: Lavender", keywords: "material3 palette lavender", run: () => applyMaterial3Palette("lavender", true) },
1493-
{ label: "M3 Palette: Emerald", keywords: "material3 palette emerald", run: () => applyMaterial3Palette("emerald", true) },
1494-
{ label: "M3 Palette: Sunset", keywords: "material3 palette sunset", run: () => applyMaterial3Palette("sunset", true) },
14951439
{ label: "Theme: Paper Link", keywords: "theme paper", run: () => applyTheme("paper", true) },
14961440
{ label: "Theme: Black Flag Uprising", keywords: "theme blackflag anarchy", run: () => applyTheme("blackflag", true) },
14971441
{ label: "Mode: Toggle Matrix Rain", keywords: "matrix rain mode", run: () => toggleMatrixMode() },

styles.css

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -768,11 +768,6 @@ nav a.active {
768768
text-transform: uppercase;
769769
}
770770

771-
.m3-palette-label,
772-
.m3-palette-select {
773-
display: none;
774-
}
775-
776771
.theme-top-select {
777772
border: 1px solid rgba(107, 155, 227, 0.44);
778773
border-radius: 7px;
@@ -3148,12 +3143,6 @@ body[data-theme="material3"] .site-footer {
31483143
padding: 0.48rem 0.84rem;
31493144
}
31503145

3151-
/* Material 3 extras: segmented tabs + palette presets. */
3152-
body[data-theme="material3"] .m3-palette-label,
3153-
body[data-theme="material3"] .m3-palette-select {
3154-
display: inline-flex;
3155-
}
3156-
31573146
body[data-theme="material3"] nav {
31583147
background: rgba(63, 64, 83, 0.62);
31593148
border: 1px solid rgba(189, 182, 220, 0.28);
@@ -3167,40 +3156,3 @@ body[data-theme="material3"] nav a {
31673156
min-width: 5.2rem;
31683157
justify-content: center;
31693158
}
3170-
3171-
body[data-theme="material3"][data-m3-palette="lavender"] {
3172-
--blue: #d0bcff;
3173-
--blue-2: #ebe1ff;
3174-
--orange: #7ee6c0;
3175-
--orange-2: #bdf4df;
3176-
}
3177-
3178-
body[data-theme="material3"][data-m3-palette="emerald"] {
3179-
--blue: #84f7c2;
3180-
--blue-2: #cfffe9;
3181-
--orange: #7cdfff;
3182-
--orange-2: #b8efff;
3183-
}
3184-
3185-
body[data-theme="material3"][data-m3-palette="sunset"] {
3186-
--blue: #ffbf8c;
3187-
--blue-2: #ffe2c7;
3188-
--orange: #ff8ea9;
3189-
--orange-2: #ffc8d6;
3190-
}
3191-
3192-
body[data-theme="material3"][data-m3-palette="emerald"] {
3193-
background:
3194-
radial-gradient(860px 320px at 10% -12%, rgba(116, 241, 191, 0.3), transparent 64%),
3195-
radial-gradient(760px 300px at 92% -8%, rgba(132, 224, 255, 0.22), transparent 66%),
3196-
radial-gradient(680px 260px at 46% 108%, rgba(145, 255, 211, 0.18), transparent 68%),
3197-
linear-gradient(156deg, #111a17 0%, #172623 44%, #1d2f2b 100%);
3198-
}
3199-
3200-
body[data-theme="material3"][data-m3-palette="sunset"] {
3201-
background:
3202-
radial-gradient(860px 320px at 10% -12%, rgba(255, 189, 130, 0.32), transparent 64%),
3203-
radial-gradient(760px 300px at 92% -8%, rgba(255, 141, 172, 0.23), transparent 66%),
3204-
radial-gradient(680px 260px at 46% 108%, rgba(255, 214, 165, 0.19), transparent 68%),
3205-
linear-gradient(156deg, #211517 0%, #2b1c22 44%, #33242a 100%);
3206-
}

0 commit comments

Comments
 (0)