484 lines
16 KiB
HTML
484 lines
16 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="{{ .Site.LanguageCode }}">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>
|
|
<meta name="description" content="{{ .Site.Params.description }}">
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<script src="https://unpkg.com/lucide@latest"></script>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
/* Default: FireRed */
|
|
--theme-primary: #f83800;
|
|
--theme-bg-color: #d05050;
|
|
--theme-bg-gradient-1: #c04040;
|
|
--theme-bg-gradient-2: #e06060;
|
|
--pkmn-border-light: #f8f8f8;
|
|
--pkmn-border-dark: #505050;
|
|
--pkmn-bg: #ffffff;
|
|
--pkmn-shadow: rgba(0,0,0,0.4);
|
|
--ink: #1b1b1b;
|
|
--paper: #fff7eb;
|
|
--shadow-soft: rgba(0,0,0,0.12);
|
|
}
|
|
|
|
/* Theme: LeafGreen */
|
|
:root.theme-green,
|
|
body.theme-green {
|
|
--theme-primary: #008000;
|
|
--theme-bg-color: #70d070;
|
|
--theme-bg-gradient-1: #68c068;
|
|
--theme-bg-gradient-2: #80e080;
|
|
}
|
|
|
|
/* Theme: WaterBlue */
|
|
:root.theme-blue,
|
|
body.theme-blue {
|
|
--theme-primary: #0060e0;
|
|
--theme-bg-color: #50a0e0;
|
|
--theme-bg-gradient-1: #4090d0;
|
|
--theme-bg-gradient-2: #60b0f0;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Space Grotesk', system-ui, sans-serif;
|
|
background-color: var(--theme-bg-color);
|
|
background-image:
|
|
linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.08) 75%, rgba(255,255,255,0.08)),
|
|
linear-gradient(45deg, rgba(0,0,0,0.05) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.05) 75%, rgba(0,0,0,0.05)),
|
|
radial-gradient(1200px 800px at 10% 10%, rgba(255,255,255,0.18), transparent 55%),
|
|
radial-gradient(900px 600px at 90% 20%, rgba(0,0,0,0.15), transparent 60%);
|
|
background-size: 26px 26px, 26px 26px, auto, auto;
|
|
background-position: 0 0, 13px 13px, 0 0, 0 0;
|
|
box-shadow: inset 0 0 100px rgba(0,0,0,0.3);
|
|
transition: background-color 0.5s ease;
|
|
color: var(--ink);
|
|
position: relative;
|
|
isolation: isolate;
|
|
text-rendering: optimizeLegibility;
|
|
}
|
|
|
|
body::before,
|
|
body::after {
|
|
content: '';
|
|
position: absolute;
|
|
inset: auto;
|
|
width: 520px;
|
|
height: 520px;
|
|
border-radius: 999px;
|
|
filter: blur(40px);
|
|
opacity: 0.35;
|
|
z-index: -1;
|
|
pointer-events: none;
|
|
}
|
|
|
|
body::before {
|
|
top: -140px;
|
|
left: -120px;
|
|
background: radial-gradient(circle, rgba(255,255,255,0.8), rgba(255,255,255,0));
|
|
animation: floaty 14s ease-in-out infinite;
|
|
}
|
|
|
|
body::after {
|
|
bottom: -160px;
|
|
right: -100px;
|
|
background: radial-gradient(circle, rgba(0,0,0,0.4), rgba(0,0,0,0));
|
|
animation: floaty 18s ease-in-out infinite reverse;
|
|
}
|
|
|
|
/* Pokémon Menu Box Style */
|
|
.pkmn-box {
|
|
background-color: var(--pkmn-bg);
|
|
border: 2px solid var(--pkmn-border-dark);
|
|
border-radius: 4px;
|
|
box-shadow: 4px 4px 0 var(--pkmn-shadow), 0 16px 40px var(--shadow-soft);
|
|
position: relative;
|
|
}
|
|
|
|
.pkmn-box::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 2px;
|
|
left: 2px;
|
|
right: 2px;
|
|
bottom: 2px;
|
|
border: 2px solid #d0d0d8;
|
|
border-radius: 2px;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.pkmn-text-shadow {
|
|
text-shadow: 2px 2px 0 #d0d0d0;
|
|
}
|
|
|
|
.pixel {
|
|
font-family: 'Press Start 2P', cursive;
|
|
letter-spacing: 0.08em;
|
|
}
|
|
|
|
.card-pop {
|
|
animation: pop-in 0.5s ease both;
|
|
animation-delay: var(--delay, 0ms);
|
|
}
|
|
|
|
/* Active State */
|
|
.menu-link.active .cursor { opacity: 1; }
|
|
.menu-link.active { color: #000; }
|
|
.menu-link.active .selector { display: block; }
|
|
|
|
.menu-link {
|
|
border-left: 3px solid transparent;
|
|
transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
|
|
}
|
|
|
|
.menu-link:hover {
|
|
background-color: rgba(0,0,0,0.04);
|
|
}
|
|
|
|
.menu-link.active {
|
|
background-color: rgba(0,0,0,0.05);
|
|
border-left-color: var(--theme-primary);
|
|
}
|
|
|
|
.menu-link.active .cursor {
|
|
animation: blink 1.1s steps(2, end) infinite;
|
|
}
|
|
|
|
/* Modal Styles */
|
|
.modal {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: rgba(0, 0, 0, 0.7);
|
|
z-index: 50;
|
|
align-items: center;
|
|
justify-content: center;
|
|
backdrop-filter: blur(2px);
|
|
}
|
|
|
|
.modal.open {
|
|
display: flex;
|
|
animation: fade-in 0.2s ease-out;
|
|
}
|
|
|
|
/* Badge Styles */
|
|
.badge {
|
|
width: 24px;
|
|
height: 24px;
|
|
background: #ccc;
|
|
border: 2px solid #505050;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 8px;
|
|
color: white;
|
|
text-shadow: 1px 1px 0 #000;
|
|
box-shadow: 0 2px 0 rgba(0,0,0,0.35);
|
|
}
|
|
.badge.js { background: #f7df1e; color: #000; text-shadow: none; border-radius: 0; }
|
|
.badge.go { background: #00add8; }
|
|
.badge.py { background: #3776ab; border-radius: 4px; }
|
|
.badge.ts { background: #3178c6; border-radius: 0; }
|
|
.badge.re { background: #61dafb; color: #000; text-shadow: none; }
|
|
.badge.db { background: #336791; border-radius: 0 0 12px 12px; }
|
|
.badge.git { background: #f05032; transform: rotate(45deg); }
|
|
.badge.sh { background: #000; border: 2px solid #0f0; color: #0f0; text-shadow: none; }
|
|
|
|
.theme-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
gap: 12px;
|
|
}
|
|
|
|
.theme-swatch {
|
|
position: relative;
|
|
border: 2px solid #1b1b1b;
|
|
border-radius: 8px;
|
|
padding: 12px;
|
|
color: #111;
|
|
background: var(--swatch);
|
|
box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35), 0 3px 0 rgba(0,0,0,0.25);
|
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
}
|
|
|
|
.theme-swatch:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35), 0 6px 0 rgba(0,0,0,0.25);
|
|
}
|
|
|
|
.theme-swatch .chip {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 6px 8px;
|
|
background: rgba(255,255,255,0.8);
|
|
border: 1px solid rgba(0,0,0,0.35);
|
|
border-radius: 999px;
|
|
font-size: 10px;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.theme-swatch .dot {
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 999px;
|
|
background: rgba(0,0,0,0.65);
|
|
}
|
|
|
|
.theme-swatch.active {
|
|
outline: 2px solid #111;
|
|
outline-offset: 3px;
|
|
box-shadow:
|
|
inset 0 0 0 2px rgba(255,255,255,0.35),
|
|
0 3px 0 rgba(0,0,0,0.25),
|
|
0 0 18px color-mix(in srgb, var(--theme-primary) 70%, white 30%),
|
|
0 0 36px color-mix(in srgb, var(--theme-primary) 55%, white 45%);
|
|
}
|
|
|
|
.theme-actions {
|
|
display: flex;
|
|
justify-content: center;
|
|
gap: 10px;
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.theme-actions .menu-link {
|
|
border: 2px solid #1b1b1b;
|
|
padding: 8px 12px;
|
|
background: #fff7eb;
|
|
}
|
|
|
|
@keyframes pop-in {
|
|
from { opacity: 0; transform: translateY(18px) scale(0.98); }
|
|
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
}
|
|
|
|
@keyframes blink {
|
|
0%, 50% { opacity: 0; }
|
|
51%, 100% { opacity: 1; }
|
|
}
|
|
|
|
@keyframes fade-in {
|
|
from { opacity: 0; }
|
|
to { opacity: 1; }
|
|
}
|
|
|
|
@keyframes floaty {
|
|
0%, 100% { transform: translateY(0) translateX(0); }
|
|
50% { transform: translateY(18px) translateX(12px); }
|
|
}
|
|
</style>
|
|
<script>
|
|
// Init Theme
|
|
const savedTheme = localStorage.getItem('pkmn_theme') || 'theme-red';
|
|
document.documentElement.classList.add(savedTheme); // Apply to HTML to avoid flash
|
|
</script>
|
|
</head>
|
|
<body class="min-h-screen flex flex-col md:flex-row items-center justify-center p-6 gap-8 overflow-hidden" data-base-classes="min-h-screen flex flex-col md:flex-row items-center justify-center p-6 gap-8 overflow-hidden">
|
|
{{ block "main" . }}{{ end }}
|
|
<script>
|
|
lucide.createIcons();
|
|
|
|
// Logic for Menu Navigation & Modals
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
// --- Navigation State ---
|
|
// We now have multiple "contexts": 'main', 'pokedex', 'bag', 'options'
|
|
let context = 'main';
|
|
let activeIndex = 0;
|
|
|
|
// Selectors
|
|
const mainMenu = document.getElementById('main-menu');
|
|
const mainLinks = mainMenu.querySelectorAll('.menu-link');
|
|
|
|
const modals = {
|
|
pokedex: document.getElementById('modal-pokedex'),
|
|
bag: document.getElementById('modal-bag'),
|
|
options: document.getElementById('modal-options')
|
|
};
|
|
|
|
// --- Helper Functions ---
|
|
|
|
function getActiveLinks() {
|
|
if (context === 'main') return mainLinks;
|
|
if (modals[context]) {
|
|
return modals[context].querySelectorAll('.menu-link');
|
|
}
|
|
return [];
|
|
}
|
|
|
|
function updateCursor() {
|
|
const links = getActiveLinks();
|
|
links.forEach((link, i) => {
|
|
if (i === activeIndex) {
|
|
link.classList.add('active');
|
|
} else {
|
|
link.classList.remove('active');
|
|
}
|
|
});
|
|
}
|
|
|
|
function openModal(modalName) {
|
|
if (!modals[modalName]) return;
|
|
context = modalName;
|
|
activeIndex = 0;
|
|
modals[modalName].classList.add('open');
|
|
if (modalName === 'options') {
|
|
const currentTheme = getCurrentTheme();
|
|
updateThemeSwatches(currentTheme);
|
|
syncThemeFocus(currentTheme);
|
|
}
|
|
updateCursor();
|
|
setupMouseListeners(); // Re-bind for new modal elements
|
|
}
|
|
|
|
function closeModal() {
|
|
if (context === 'main') return;
|
|
modals[context].classList.remove('open');
|
|
context = 'main';
|
|
activeIndex = 0;
|
|
updateCursor();
|
|
}
|
|
|
|
function handleActivation(item) {
|
|
if (!item) return;
|
|
|
|
// 1. Link logic
|
|
if (item.tagName === 'A' && item.href && item.target === '_blank') {
|
|
window.open(item.href, '_blank');
|
|
return;
|
|
}
|
|
|
|
// 2. Data actions
|
|
const action = item.dataset.action;
|
|
const payload = item.dataset.payload;
|
|
|
|
if (action === 'modal') {
|
|
openModal(payload);
|
|
} else if (action === 'close') {
|
|
closeModal();
|
|
} else if (action === 'theme') {
|
|
setTheme(payload);
|
|
} else if (action === 'link') {
|
|
// Fallback for custom link items that aren't <a> tags
|
|
const url = item.getAttribute('onclick')?.match(/'([^']+)'/)?.[1];
|
|
if (url) window.open(url, '_blank');
|
|
}
|
|
}
|
|
|
|
function setupMouseListeners() {
|
|
const links = getActiveLinks();
|
|
links.forEach((link, index) => {
|
|
// Sync index on hover
|
|
link.onmouseenter = () => {
|
|
activeIndex = index;
|
|
updateCursor();
|
|
};
|
|
// Activate on click
|
|
link.onclick = (e) => {
|
|
e.preventDefault();
|
|
handleActivation(link);
|
|
};
|
|
});
|
|
}
|
|
|
|
const themes = ['theme-red', 'theme-green', 'theme-blue'];
|
|
|
|
function getCurrentTheme() {
|
|
return themes.find((theme) => document.documentElement.classList.contains(theme)) || 'theme-red';
|
|
}
|
|
|
|
function syncThemeFocus(themeName) {
|
|
if (context !== 'options') return;
|
|
const links = getActiveLinks();
|
|
let nextIndex = 0;
|
|
links.forEach((link, index) => {
|
|
if (link.getAttribute('data-payload') === themeName) {
|
|
nextIndex = index;
|
|
}
|
|
});
|
|
activeIndex = nextIndex;
|
|
updateCursor();
|
|
}
|
|
|
|
function updateThemeSwatches(themeName) {
|
|
const optionsModal = modals.options;
|
|
if (!optionsModal) return;
|
|
const swatches = optionsModal.querySelectorAll('.theme-swatch');
|
|
swatches.forEach((swatch) => {
|
|
if (swatch.getAttribute('data-payload') === themeName) {
|
|
swatch.classList.add('active');
|
|
} else {
|
|
swatch.classList.remove('active');
|
|
}
|
|
});
|
|
}
|
|
|
|
function applyTheme(themeName) {
|
|
themes.forEach((theme) => {
|
|
document.documentElement.classList.remove(theme);
|
|
document.body.classList.remove(theme);
|
|
});
|
|
document.documentElement.classList.add(themeName);
|
|
document.body.classList.add(themeName);
|
|
updateThemeSwatches(themeName);
|
|
syncThemeFocus(themeName);
|
|
}
|
|
|
|
function setTheme(themeName) {
|
|
applyTheme(themeName);
|
|
localStorage.setItem('pkmn_theme', themeName);
|
|
closeModal();
|
|
}
|
|
|
|
// --- Init ---
|
|
const savedTheme = localStorage.getItem('pkmn_theme');
|
|
applyTheme(savedTheme || 'theme-red');
|
|
|
|
updateCursor();
|
|
setupMouseListeners();
|
|
|
|
// --- Keyboard Handling ---
|
|
document.addEventListener('keydown', (e) => {
|
|
const links = getActiveLinks();
|
|
|
|
switch(e.key) {
|
|
case 'ArrowUp':
|
|
case 'w':
|
|
case 'W':
|
|
e.preventDefault();
|
|
activeIndex = (activeIndex - 1 + links.length) % links.length;
|
|
updateCursor();
|
|
break;
|
|
case 'ArrowDown':
|
|
case 's':
|
|
case 'S':
|
|
e.preventDefault();
|
|
activeIndex = (activeIndex + 1) % links.length;
|
|
updateCursor();
|
|
break;
|
|
case 'Enter':
|
|
case ' ':
|
|
case 'z':
|
|
e.preventDefault();
|
|
handleActivation(links[activeIndex]);
|
|
break;
|
|
case 'Escape':
|
|
case 'x':
|
|
e.preventDefault();
|
|
if (context !== 'main') closeModal();
|
|
break;
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|