Initial commit: NovelasVM platform with multi-engine support and Umineko Web integration
This commit is contained in:
220
templates/portal/app.js
Normal file
220
templates/portal/app.js
Normal file
@@ -0,0 +1,220 @@
|
||||
/**
|
||||
* NovelasVM Portal
|
||||
* Carga el catalogo de juegos y gestiona temas.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const THEME_KEY = 'novelasvm-theme';
|
||||
const THEMES = ['dark', 'light', 'immersive'];
|
||||
|
||||
const engineConfig = {
|
||||
renpy: {
|
||||
label: 'Ren\'Py',
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2L2 7l10 5 10-5-10-5z"></path><path d="M2 17l10 5 10-5"></path><path d="M2 12l10 5 10-5"></path></svg>'
|
||||
},
|
||||
unity: {
|
||||
label: 'Unity',
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect><line x1="8" y1="21" x2="16" y2="21"></line><line x1="12" y1="17" x2="12" y2="21"></line></svg>'
|
||||
},
|
||||
web: {
|
||||
label: 'Web',
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>'
|
||||
}
|
||||
};
|
||||
|
||||
// --- Theme handling ------------------------------------------------------
|
||||
|
||||
function getSavedTheme() {
|
||||
const saved = localStorage.getItem(THEME_KEY);
|
||||
if (saved && THEMES.includes(saved)) return saved;
|
||||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
|
||||
return 'light';
|
||||
}
|
||||
return 'dark';
|
||||
}
|
||||
|
||||
function setTheme(theme) {
|
||||
if (!THEMES.includes(theme)) return;
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
localStorage.setItem(THEME_KEY, theme);
|
||||
updateThemeButtons(theme);
|
||||
}
|
||||
|
||||
function updateThemeButtons(activeTheme) {
|
||||
document.querySelectorAll('.theme-btn').forEach(btn => {
|
||||
const btnTheme = btn.getAttribute('data-theme-value');
|
||||
btn.classList.toggle('active', btnTheme === activeTheme);
|
||||
btn.setAttribute('aria-pressed', btnTheme === activeTheme ? 'true' : 'false');
|
||||
});
|
||||
}
|
||||
|
||||
function initThemeSwitcher() {
|
||||
setTheme(getSavedTheme());
|
||||
document.querySelectorAll('.theme-btn').forEach(btn => {
|
||||
btn.addEventListener('click', () => setTheme(btn.getAttribute('data-theme-value')));
|
||||
});
|
||||
}
|
||||
|
||||
// --- Catalog rendering ---------------------------------------------------
|
||||
|
||||
function formatDate(isoString) {
|
||||
if (!isoString) return '';
|
||||
try {
|
||||
const date = new Date(isoString);
|
||||
return date.toLocaleDateString('es-ES', {
|
||||
year: 'numeric', month: 'short', day: 'numeric'
|
||||
});
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function getEngineBadge(engine) {
|
||||
const cfg = engineConfig[engine] || engineConfig.web;
|
||||
return `<span class="engine-badge ${engine}">${cfg.icon}<span>${cfg.label}</span></span>`;
|
||||
}
|
||||
|
||||
function getCoverImage(game) {
|
||||
if (game.cover) {
|
||||
return `<img src="${escapeHtml(game.cover)}" alt="Portada de ${escapeHtml(game.title)}">`;
|
||||
}
|
||||
return `
|
||||
<div class="game-cover-placeholder">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
||||
<circle cx="8.5" cy="8.5" r="1.5"></circle>
|
||||
<polyline points="21 15 16 10 5 21"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
function escapeHtml(text) {
|
||||
if (text === null || text === undefined) return '';
|
||||
return String(text)
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function renderCard(game, index) {
|
||||
const engine = game.engine || 'web';
|
||||
const metaParts = [];
|
||||
if (game.version) metaParts.push(`v${escapeHtml(game.version)}`);
|
||||
if (game.author) metaParts.push(escapeHtml(game.author));
|
||||
const date = formatDate(game.createdAt);
|
||||
if (date) metaParts.push(date);
|
||||
|
||||
return `
|
||||
<article class="game-card" style="animation-delay: ${index * 80}ms">
|
||||
<div class="game-cover">
|
||||
${getCoverImage(game)}
|
||||
${getEngineBadge(engine)}
|
||||
</div>
|
||||
<div class="game-info">
|
||||
<h2 class="game-title">${escapeHtml(game.title || game.slug)}</h2>
|
||||
${game.subtitle ? `<p class="game-subtitle">${escapeHtml(game.subtitle)}</p>` : ''}
|
||||
${game.description ? `<p class="game-description">${escapeHtml(game.description)}</p>` : ''}
|
||||
<div class="game-meta">${metaParts.join(' · ')}</div>
|
||||
<div class="game-actions">
|
||||
<a class="btn btn-primary" href="${escapeHtml(game.entryPoint || `/games/${game.slug}/`)}" target="_self">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<polygon points="5 3 19 12 5 21 5 3"></polygon>
|
||||
</svg>
|
||||
Jugar
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
`;
|
||||
}
|
||||
|
||||
function renderLegend() {
|
||||
const legend = document.getElementById('engineLegend');
|
||||
if (!legend) return;
|
||||
legend.innerHTML = Object.entries(engineConfig).map(([key, cfg]) => `
|
||||
<span class="legend-item">
|
||||
<span class="legend-dot" style="background: var(--engine-${key})"></span>
|
||||
${cfg.label}
|
||||
</span>
|
||||
`).join('');
|
||||
}
|
||||
|
||||
function showSkeletons(grid) {
|
||||
grid.innerHTML = Array.from({ length: 6 }).map(() => `
|
||||
<div class="game-card">
|
||||
<div class="game-cover skeleton" style="aspect-ratio: 16/9"></div>
|
||||
<div class="game-info">
|
||||
<div class="skeleton" style="height: 1.1rem; width: 70%; margin-bottom: 0.5rem"></div>
|
||||
<div class="skeleton" style="height: 0.875rem; width: 100%"></div>
|
||||
<div class="skeleton" style="height: 0.875rem; width: 80%; margin-top: 0.4rem"></div>
|
||||
<div class="skeleton" style="height: 2.25rem; width: 100%; margin-top: 1rem; border-radius: var(--radius-md)"></div>
|
||||
</div>
|
||||
</div>
|
||||
`).join('');
|
||||
}
|
||||
|
||||
async function loadCatalog() {
|
||||
const grid = document.getElementById('gamesGrid');
|
||||
const stats = document.getElementById('stats');
|
||||
const empty = document.getElementById('emptyState');
|
||||
|
||||
if (!grid || !stats || !empty) return;
|
||||
|
||||
showSkeletons(grid);
|
||||
grid.setAttribute('aria-busy', 'true');
|
||||
|
||||
try {
|
||||
const response = await fetch('/games.json', { cache: 'no-store' });
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
const data = await response.json();
|
||||
const games = Array.isArray(data.games) ? data.games : [];
|
||||
|
||||
// Ordenar: primero por motor (renpy, unity, web) luego por titulo
|
||||
games.sort((a, b) => {
|
||||
const engineOrder = { renpy: 0, unity: 1, web: 2 };
|
||||
const ea = engineOrder[a.engine] ?? 99;
|
||||
const eb = engineOrder[b.engine] ?? 99;
|
||||
if (ea !== eb) return ea - eb;
|
||||
return (a.title || a.slug).localeCompare(b.title || b.slug);
|
||||
});
|
||||
|
||||
if (games.length === 0) {
|
||||
grid.innerHTML = '';
|
||||
grid.classList.add('hidden');
|
||||
empty.classList.remove('hidden');
|
||||
stats.textContent = 'No hay novelas publicadas';
|
||||
} else {
|
||||
empty.classList.add('hidden');
|
||||
grid.classList.remove('hidden');
|
||||
grid.innerHTML = games.map((game, i) => renderCard(game, i)).join('');
|
||||
const countText = games.length === 1 ? '1 novela disponible' : `${games.length} novelas disponibles`;
|
||||
stats.textContent = countText;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error cargando catalogo:', err);
|
||||
grid.innerHTML = '';
|
||||
grid.classList.add('hidden');
|
||||
empty.classList.remove('hidden');
|
||||
empty.querySelector('h2').textContent = 'No se pudo cargar el catalogo';
|
||||
empty.querySelector('p').textContent = 'Revisa que /games.json exista o intenta recargar la pagina.';
|
||||
stats.textContent = 'Error de carga';
|
||||
} finally {
|
||||
grid.setAttribute('aria-busy', 'false');
|
||||
}
|
||||
}
|
||||
|
||||
// --- Init ----------------------------------------------------------------
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
initThemeSwitcher();
|
||||
renderLegend();
|
||||
loadCatalog();
|
||||
});
|
||||
})();
|
||||
98
templates/portal/index.html
Normal file
98
templates/portal/index.html
Normal file
@@ -0,0 +1,98 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>NovelasVM - Plataforma de Novelas Visuales</title>
|
||||
<meta name="description" content="Descubre y juega novelas visuales directamente en tu navegador.">
|
||||
<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=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/assets/styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar">
|
||||
<div class="container navbar-inner">
|
||||
<a class="brand" href="/" aria-label="NovelasVM Inicio">
|
||||
<svg class="brand-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M12 2L2 7l10 5 10-5-10-5z"></path>
|
||||
<path d="M2 17l10 5 10-5"></path>
|
||||
<path d="M2 12l10 5 10-5"></path>
|
||||
</svg>
|
||||
<span class="brand-text">NovelasVM</span>
|
||||
</a>
|
||||
|
||||
<div class="theme-switcher" role="group" aria-label="Selector de tema">
|
||||
<button class="theme-btn" data-theme-value="dark" aria-label="Tema oscuro" title="Oscuro">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
|
||||
</svg>
|
||||
<span>Oscuro</span>
|
||||
</button>
|
||||
<button class="theme-btn" data-theme-value="light" aria-label="Tema claro" title="Claro">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="5"></circle>
|
||||
<line x1="12" y1="1" x2="12" y2="3"></line>
|
||||
<line x1="12" y1="21" x2="12" y2="23"></line>
|
||||
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
|
||||
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
|
||||
<line x1="1" y1="12" x2="3" y2="12"></line>
|
||||
<line x1="21" y1="12" x2="23" y2="12"></line>
|
||||
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
|
||||
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
|
||||
</svg>
|
||||
<span>Claro</span>
|
||||
</button>
|
||||
<button class="theme-btn" data-theme-value="immersive" aria-label="Tema inmersivo" title="Inmersivo">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M12 3a9 9 0 0 0-9 9v7a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7a9 9 0 0 0-9-9z"></path>
|
||||
<path d="M8 14v.01"></path>
|
||||
<path d="M16 14v.01"></path>
|
||||
<path d="M12 18a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4z"></path>
|
||||
</svg>
|
||||
<span>Inmersivo</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<header class="hero">
|
||||
<div class="container">
|
||||
<h1 class="hero-title">Tu biblioteca de novelas visuales</h1>
|
||||
<p class="hero-subtitle">Juega, prueba y comparte novelas visuales desde el navegador. Soporta Ren'Py, Unity WebGL y proyectos web personalizados.</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container main-content">
|
||||
<div class="toolbar">
|
||||
<div class="stats" id="stats" aria-live="polite">Cargando novelas...</div>
|
||||
<div class="engine-legend" id="engineLegend"></div>
|
||||
</div>
|
||||
|
||||
<div class="games-grid" id="gamesGrid" aria-busy="true">
|
||||
<!-- Las tarjetas se renderizan desde JS -->
|
||||
</div>
|
||||
|
||||
<div class="empty-state hidden" id="emptyState">
|
||||
<div class="empty-icon">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2"></rect>
|
||||
<path d="M9 3v18"></path>
|
||||
<path d="M14 9l2 2-2 2"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<h2>No hay novelas publicadas</h2>
|
||||
<p>Usa el script <code>/opt/novelas/bin/build-novela.sh</code> para agregar tu primera novela.</p>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container footer-inner">
|
||||
<span>NovelasVM · Plataforma aliada de Afterlife</span>
|
||||
<span class="footer-meta">Multi-motor · Multi-tema</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="/assets/app.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
574
templates/portal/styles.css
Normal file
574
templates/portal/styles.css
Normal file
@@ -0,0 +1,574 @@
|
||||
:root {
|
||||
--font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
--font-mono: 'JetBrains Mono', monospace;
|
||||
|
||||
--radius-sm: 6px;
|
||||
--radius-md: 10px;
|
||||
--radius-lg: 14px;
|
||||
--radius-xl: 20px;
|
||||
--radius-pill: 9999px;
|
||||
|
||||
--transition-fast: 150ms ease;
|
||||
--transition-base: 250ms ease;
|
||||
--transition-theme: 300ms ease;
|
||||
|
||||
--max-width: 1280px;
|
||||
--navbar-height: 64px;
|
||||
}
|
||||
|
||||
/* Tema oscuro (default) */
|
||||
[data-theme="dark"] {
|
||||
--bg-primary: #0a0a0a;
|
||||
--bg-surface: #141414;
|
||||
--bg-elevated: #1f1f1f;
|
||||
--bg-hover: #262626;
|
||||
--text-primary: #f5f5f5;
|
||||
--text-secondary: #a0a0a0;
|
||||
--text-muted: #666666;
|
||||
--accent: #4e85bf;
|
||||
--accent-hover: #3a6da3;
|
||||
--border: #2a2a2a;
|
||||
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
|
||||
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
|
||||
--shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
|
||||
--engine-renpy: #8b5cf6;
|
||||
--engine-unity: #1f1f1f;
|
||||
--engine-web: #3b82f6;
|
||||
--code-bg: #1a1a1a;
|
||||
}
|
||||
|
||||
/* Tema claro */
|
||||
[data-theme="light"] {
|
||||
--bg-primary: #fafafa;
|
||||
--bg-surface: #ffffff;
|
||||
--bg-elevated: #f3f4f6;
|
||||
--bg-hover: #e5e7eb;
|
||||
--text-primary: #111827;
|
||||
--text-secondary: #4b5563;
|
||||
--text-muted: #9ca3af;
|
||||
--accent: #2563eb;
|
||||
--accent-hover: #1d4ed8;
|
||||
--border: #e5e7eb;
|
||||
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
|
||||
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||||
--shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
|
||||
--engine-renpy: #7c3aed;
|
||||
--engine-unity: #111827;
|
||||
--engine-web: #2563eb;
|
||||
--code-bg: #f3f4f6;
|
||||
}
|
||||
|
||||
/* Tema inmersivo */
|
||||
[data-theme="immersive"] {
|
||||
--bg-primary: #050510;
|
||||
--bg-surface: rgba(20, 20, 45, 0.62);
|
||||
--bg-elevated: rgba(32, 32, 66, 0.72);
|
||||
--bg-hover: rgba(45, 45, 90, 0.8);
|
||||
--text-primary: #ffffff;
|
||||
--text-secondary: rgba(255, 255, 255, 0.78);
|
||||
--text-muted: rgba(255, 255, 255, 0.5);
|
||||
--accent: #8b5cf6;
|
||||
--accent-hover: #7c3aed;
|
||||
--border: rgba(255, 255, 255, 0.12);
|
||||
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
|
||||
--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
|
||||
--shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
|
||||
--engine-renpy: #a78bfa;
|
||||
--engine-unity: #0f172a;
|
||||
--engine-web: #60a5fa;
|
||||
--code-bg: rgba(15, 15, 35, 0.7);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: var(--font-sans);
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
min-height: 100vh;
|
||||
line-height: 1.6;
|
||||
transition: background-color var(--transition-theme), color var(--transition-theme);
|
||||
}
|
||||
|
||||
[data-theme="immersive"] body {
|
||||
background:
|
||||
radial-gradient(circle at 15% 25%, rgba(76, 29, 149, 0.25) 0%, transparent 35%),
|
||||
radial-gradient(circle at 85% 70%, rgba(59, 130, 246, 0.18) 0%, transparent 30%),
|
||||
linear-gradient(180deg, #050510 0%, #0f172a 100%);
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
max-width: var(--max-width);
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
/* Navbar */
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: var(--navbar-height);
|
||||
background: var(--bg-surface);
|
||||
border-bottom: 1px solid var(--border);
|
||||
z-index: 100;
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
transition: background-color var(--transition-theme), border-color var(--transition-theme);
|
||||
}
|
||||
|
||||
.navbar-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
color: var(--text-primary);
|
||||
text-decoration: none;
|
||||
font-weight: 700;
|
||||
font-size: 1.25rem;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.brand-icon {
|
||||
width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.theme-switcher {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
background: var(--bg-elevated);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-pill);
|
||||
padding: 0.25rem;
|
||||
gap: 0.15rem;
|
||||
transition: background-color var(--transition-theme), border-color var(--transition-theme);
|
||||
}
|
||||
|
||||
.theme-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
padding: 0.4rem 0.65rem;
|
||||
border: none;
|
||||
border-radius: var(--radius-pill);
|
||||
background: transparent;
|
||||
color: var(--text-secondary);
|
||||
font-family: inherit;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
|
||||
}
|
||||
|
||||
.theme-btn svg {
|
||||
width: 0.95rem;
|
||||
height: 0.95rem;
|
||||
}
|
||||
|
||||
.theme-btn:hover {
|
||||
color: var(--text-primary);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.theme-btn.active {
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.theme-btn span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.theme-btn span {
|
||||
display: inline;
|
||||
}
|
||||
.theme-btn {
|
||||
padding: 0.45rem 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hero */
|
||||
.hero {
|
||||
padding-top: calc(var(--navbar-height) + 3rem);
|
||||
padding-bottom: 2.5rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hero-title {
|
||||
font-size: clamp(2rem, 5vw, 3.25rem);
|
||||
font-weight: 700;
|
||||
line-height: 1.15;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -0.03em;
|
||||
}
|
||||
|
||||
.hero-subtitle {
|
||||
font-size: clamp(1rem, 2vw, 1.25rem);
|
||||
color: var(--text-secondary);
|
||||
max-width: 680px;
|
||||
margin: 0 auto;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* Main content */
|
||||
.main-content {
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1.75rem;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.toolbar {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.stats {
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.engine-legend {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.legend-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
padding: 0.25rem 0.6rem;
|
||||
border-radius: var(--radius-pill);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-surface);
|
||||
}
|
||||
|
||||
.legend-dot {
|
||||
width: 0.5rem;
|
||||
height: 0.5rem;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/* Games grid */
|
||||
.games-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.games-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.games-grid {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.games-grid {
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Game card */
|
||||
.game-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-theme), border-color var(--transition-theme);
|
||||
animation: cardEnter 0.5s ease-out both;
|
||||
}
|
||||
|
||||
@keyframes cardEnter {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(16px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.game-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
.game-cover {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
aspect-ratio: 16 / 9;
|
||||
background: var(--bg-elevated);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.game-cover img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform var(--transition-base);
|
||||
}
|
||||
|
||||
.game-card:hover .game-cover img {
|
||||
transform: scale(1.04);
|
||||
}
|
||||
|
||||
.game-cover-placeholder {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.game-cover-placeholder svg {
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.engine-badge {
|
||||
position: absolute;
|
||||
top: 0.75rem;
|
||||
right: 0.75rem;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
padding: 0.3rem 0.6rem;
|
||||
border-radius: var(--radius-pill);
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.03em;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.65);
|
||||
backdrop-filter: blur(8px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.engine-badge.renpy { background: var(--engine-renpy); }
|
||||
.engine-badge.unity { background: var(--engine-unity); }
|
||||
.engine-badge.web { background: var(--engine-web); }
|
||||
|
||||
.engine-badge svg {
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
}
|
||||
|
||||
.game-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.game-title {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
margin: 0;
|
||||
line-height: 1.3;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.game-subtitle {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-secondary);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.game-description {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-secondary);
|
||||
margin: 0.25rem 0 0;
|
||||
line-height: 1.5;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.game-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
margin-top: 0.75rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
.game-actions {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.4rem;
|
||||
padding: 0.6rem 1.1rem;
|
||||
border-radius: var(--radius-md);
|
||||
font-family: inherit;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
border: 1px solid transparent;
|
||||
transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: var(--accent-hover);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.btn-primary svg {
|
||||
width: 0.9rem;
|
||||
height: 0.9rem;
|
||||
}
|
||||
|
||||
/* Empty state */
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 4rem 1rem;
|
||||
background: var(--bg-surface);
|
||||
border: 1px dashed var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
transition: background-color var(--transition-theme), border-color var(--transition-theme);
|
||||
}
|
||||
|
||||
.empty-state.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
border-radius: 50%;
|
||||
background: var(--bg-elevated);
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.empty-icon svg {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.empty-state h2 {
|
||||
margin: 0 0 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.empty-state p {
|
||||
margin: 0;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.empty-state code {
|
||||
display: inline-block;
|
||||
background: var(--code-bg);
|
||||
padding: 0.15rem 0.4rem;
|
||||
border-radius: var(--radius-sm);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
/* Skeleton loading */
|
||||
.skeleton {
|
||||
background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: shimmer 1.4s infinite;
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
0% { background-position: 200% 0; }
|
||||
100% { background-position: -200% 0; }
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
.footer {
|
||||
margin-top: auto;
|
||||
padding: 1.75rem 0;
|
||||
border-top: 1px solid var(--border);
|
||||
background: var(--bg-surface);
|
||||
transition: background-color var(--transition-theme), border-color var(--transition-theme);
|
||||
}
|
||||
|
||||
.footer-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.footer-inner {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
/* Utility */
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
Reference in New Issue
Block a user