Add Historias Incompletas: web+APK story game with Gemini-powered daily deck

Node/Express backend generates 5 lateral-thinking mystery stories a day via
Gemini and serves the latest batch; React/Vite frontend (Capacitor-wrapped
for Android) plays them pass-and-play style, falling back to a bundled set
of 16 original stories when the backend has nothing new or is unreachable.
Includes systemd/nginx deploy config for a Docker-less Debian LXC.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Sonnet 5 committed 2026-08-12 07:15:54 +00:00
1 parent de0dfec6af
commit 7f3e6cc839
97 files changed
+6803 -1

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
import { useState } from "react";
import type { Story } from "../types";
interface NarratorViewProps {
story: Story;
onFinish: () => void;
}
export default function NarratorView({ story, onFinish }: NarratorViewProps) {
const [revealedHints, setRevealedHints] = useState(0);
const [solutionArmed, setSolutionArmed] = useState(false);
const [solutionShown, setSolutionShown] = useState(false);
return (
<section className="screen narrator">
<div className="narrator-warning">Solo para quien narra — no muestres la pantalla al resto del grupo.</div>
<h2>{story.title}</h2>
<div className="teaser-card">
<h3>Enigma (leélo en voz alta)</h3>
<p>{story.teaser}</p>
</div>
{revealedHints > 0 && (
<div className="hints-card">
<h3>Pistas reveladas</h3>
<ol>
{story.hints.slice(0, revealedHints).map((hint, i) => (
<li key={i}>{hint}</li>
))}
</ol>
</div>
)}
{revealedHints < story.hints.length && (
<button className="ghost" onClick={() => setRevealedHints((n) => n + 1)}>
Revelar siguiente pista ({revealedHints}/{story.hints.length})
</button>
)}
<div className="solution-area">
{!solutionShown ? (
<>
{!solutionArmed ? (
<button className="danger" onClick={() => setSolutionArmed(true)}>
Mostrar solución
</button>
) : (
<div className="confirm-row">
<span>¿Seguro? Esto revela el final de la historia.</span>
<button className="danger" onClick={() => setSolutionShown(true)}>
Sí, mostrar
</button>
<button className="ghost" onClick={() => setSolutionArmed(false)}>
Cancelar
</button>
</div>
)}
</>
) : (
<div className="solution-card">
<h3>Solución completa</h3>
<p>{story.solution}</p>
</div>
)}
</div>
<button className="primary" onClick={onFinish}>
Terminar historia y volver
</button>
</section>
);
}