Skip to content

Commit e86eb9b

Browse files
authored
Better random theme; fix JS console error (#253)
1 parent 7fd5379 commit e86eb9b

File tree

3 files changed

+49
-10
lines changed

3 files changed

+49
-10
lines changed

src/_includes/footer.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
</button>
116116
</div>
117117

118-
<p class="mt-2 text-[7px] text-slate-600 text-center uppercase tracking-tighter">Press <span class="text-slate-400">'D'</span> to toggle</p>
118+
<p class="mt-2 text-center uppercase tracking-tighter text-[9px] text-white/60 tracking-widest mb-1.5 block font-bold">Press <span class="text-red-400">'D'</span> to toggle</p>
119119
</div>
120120

121121
<div id="matrix-overlay" class="fixed inset-0 bg-black hidden z-[9999]">

src/assets/css/style.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,3 +551,35 @@ body[data-level="6"]::after {
551551
/* This makes sure the text is crisp on light/dark themes */
552552
text-shadow: 0 0 4px rgba(0,0,0,0.3);
553553
}
554+
555+
556+
557+
/* Username: Big, bold, and using the random accent */
558+
.developer-name, h1 {
559+
color: var(--accent);
560+
text-shadow: 0 0 20px hsla(var(--accent-hue), 90%, 65%, 0.3);
561+
}
562+
563+
/* Skills: Give them a 'glass' look using the random background */
564+
.skill-tag {
565+
background: var(--bg-card);
566+
border: 1px solid var(--border-color);
567+
color: var(--text-main);
568+
}
569+
570+
.skill-tag:hover {
571+
border-color: var(--accent);
572+
color: var(--accent);
573+
box-shadow: 0 0 15px var(--accent);
574+
}
575+
576+
/* Links: Make them pop! */
577+
a {
578+
color: var(--accent);
579+
transition: all 0.2s ease;
580+
}
581+
582+
a:hover {
583+
filter: brightness(1.2);
584+
text-decoration: underline;
585+
}

src/assets/js/script.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,22 @@ function applyTheme(theme) {
455455
if (heart) heart.innerText = '💜';
456456
}
457457
else if (theme === 'random') {
458-
// Generate a random Hue (0-360)
459458
const h = Math.floor(Math.random() * 360);
459+
// The "Secret Sauce": A second hue for accents (180 degrees away or +40)
460+
const accentHue = (h + 160) % 360;
460461

461-
// VIBRANT NEON LOGIC: Keep saturation high and lightness balanced
462-
html.style.setProperty('--bg-page', `hsl(${h}, 45%, 7%)`); // Very Dark
463-
html.style.setProperty('--bg-card', `hsl(${h}, 35%, 12%)`); // Slightly lighter
464-
html.style.setProperty('--bg-footer', `hsl(${h}, 40%, 5%)`); // Deepest
465-
html.style.setProperty('--text-main', `hsl(${h}, 20%, 95%)`); // Near White
466-
html.style.setProperty('--text-muted', `hsl(${h}, 15%, 70%)`); // Softened
462+
// Backgrounds (Consistent and Dark)
463+
html.style.setProperty('--bg-page', `hsl(${h}, 45%, 7%)`);
464+
html.style.setProperty('--bg-card', `hsl(${h}, 35%, 12%)`);
465+
html.style.setProperty('--bg-footer', `hsl(${h}, 40%, 5%)`);
466+
467+
// Typography
468+
html.style.setProperty('--text-main', `hsl(${h}, 10%, 98%)`); // Crisp White
469+
html.style.setProperty('--text-muted', `hsl(${h}, 20%, 70%)`); // Readable Muted
470+
471+
// The Pop Colors (The ones you were missing!)
472+
html.style.setProperty('--accent', `hsl(${accentHue}, 90%, 65%)`);
473+
html.style.setProperty('--accent-light', `hsl(${accentHue}, 90%, 40%)`);
467474
html.style.setProperty('--border-color', `hsl(${h}, 30%, 20%)`);
468475

469476
if (heart) {
@@ -949,8 +956,8 @@ function initSkillMining() {
949956

950957
skillTags.forEach(tag => {
951958
// Remove old listeners to prevent double-firing
952-
tag.removeEventListener('mouseenter', createXPPopup);
953-
tag.addEventListener('mouseenter', createXPPopup);
959+
tag.removeEventListener('mouseenter', createFloatingXP);
960+
tag.addEventListener('mouseenter', createFloatingXP);
954961
});
955962
}
956963

0 commit comments

Comments
 (0)