Initial import

This commit is contained in:
renato97
2025-11-30 03:11:18 +00:00
commit 3607376d58
134 changed files with 19618 additions and 0 deletions

1
app/.env.example Normal file
View File

@@ -0,0 +1 @@
VITE_API_BASE_URL=http://localhost:3000

24
app/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

73
app/README.md Normal file
View File

@@ -0,0 +1,73 @@
# React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
```js
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```

23
app/eslint.config.js Normal file
View File

@@ -0,0 +1,23 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
])

13
app/index.html Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>app</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

3220
app/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

30
app/package.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "app",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"react": "^19.2.0",
"react-dom": "^19.2.0"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@types/node": "^24.10.1",
"@types/react": "^19.2.5",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.1",
"eslint": "^9.39.1",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.5.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.4",
"vite": "^7.2.4"
}
}

1
app/public/vite.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

593
app/src/App.css Normal file
View File

@@ -0,0 +1,593 @@
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
}
.app-shell {
max-width: 1220px;
margin: 0 auto;
padding: 2rem 1.25rem 3rem;
}
.hero {
background: linear-gradient(135deg, #0f3c77, #1f5fd8);
color: #fff;
border-radius: 1.5rem;
padding: 2rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
box-shadow: 0 20px 60px rgba(15, 60, 119, 0.35);
}
.hero-top {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.badge {
align-self: flex-start;
background: rgba(255, 255, 255, 0.2);
border-radius: 999px;
padding: 0.35rem 1rem;
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.hero-title {
font-size: clamp(2rem, 4vw, 3.2rem);
margin: 0;
}
.hero-text {
margin: 0;
max-width: 600px;
font-size: 1.1rem;
color: rgba(255, 255, 255, 0.92);
}
.hero-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.hero-tag {
background: rgba(255, 255, 255, 0.2);
padding: 0.35rem 0.9rem;
border-radius: 999px;
font-size: 0.85rem;
}
.hero-card {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 1rem;
}
.hero-stat {
background: rgba(255, 255, 255, 0.18);
border-radius: 1rem;
padding: 1rem;
text-align: center;
}
.hero-stat span {
font-size: 2rem;
font-weight: 700;
display: block;
}
.module-panel {
margin-top: 2rem;
background: #fdfdff;
border-radius: 1.5rem;
padding: 1.5rem;
box-shadow: 0 20px 50px rgba(21, 54, 109, 0.08);
}
.global-module {
display: grid;
gap: 1.5rem;
}
.global-card {
border-radius: 1.4rem;
background: linear-gradient(135deg, #fef6d7, #ffd6e8);
padding: 1.5rem;
display: grid;
gap: 1.5rem;
}
.word-letter-row {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin: 0 0 0.5rem;
justify-content: center;
}
.original-word {
margin: 0.2rem 0 0.8rem;
font-size: 1rem;
color: rgba(15, 35, 68, 0.7);
text-transform: capitalize;
}
.global-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.global-figure {
margin: 1rem 0;
border-radius: 1.2rem;
padding: 1rem;
background: rgba(255, 255, 255, 0.8);
display: flex;
align-items: center;
gap: 1rem;
flex-wrap: wrap;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.global-emoji {
font-size: 2.5rem;
}
.global-figure-media {
width: min(260px, 100%);
border-radius: 1rem;
overflow: hidden;
position: relative;
box-shadow: 0 15px 30px rgba(15, 35, 68, 0.2);
}
.image-placeholder {
width: 100%;
height: 240px;
display: flex;
align-items: center;
justify-content: center;
background: repeating-linear-gradient(
45deg,
rgba(15, 35, 68, 0.08),
rgba(15, 35, 68, 0.08) 10px,
rgba(15, 35, 68, 0.15) 10px,
rgba(15, 35, 68, 0.15) 20px
);
color: #0f2344;
font-weight: 700;
border-radius: inherit;
}
.global-figure-media img {
width: 100%;
height: 100%;
display: block;
object-fit: cover;
}
.image-badge {
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 10px;
background: rgba(15, 35, 68, 0.85);
color: #fff;
font-size: 0.75rem;
padding: 0.25rem 0.8rem;
border-radius: 999px;
}
.global-figure p {
margin: 0;
color: #333f63;
}
.spelling-panel {
flex: 1;
min-width: 220px;
display: grid;
gap: 0.4rem;
}
.spelling-label {
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 0.08em;
font-weight: 700;
margin: 0;
color: #0f3c77;
}
.letter-row {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
justify-content: center;
}
.letter-card {
min-width: 48px;
padding: 0.6rem 0.9rem;
border-radius: 0.9rem;
background: #0f2344;
color: #fff;
font-size: 1.3rem;
font-weight: 800;
text-align: center;
box-shadow: 0 12px 20px rgba(15, 35, 68, 0.25);
transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.letter-card:hover {
background: #ffb347;
color: #09203f;
transform: translateY(-4px);
box-shadow: 0 16px 28px rgba(15, 35, 68, 0.35);
}
.letter-card.big {
min-width: 58px;
font-size: clamp(1.6rem, 4vw, 2.4rem);
padding: 0.75rem 1rem;
}
.global-choices {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 0.6rem;
}
.choice-button {
border: none;
border-radius: 1rem;
padding: 0.9rem;
font-size: 1rem;
font-weight: 700;
background: rgba(15, 35, 68, 0.08);
cursor: pointer;
transition: transform 0.15s ease, background 0.15s ease;
}
.choice-button.correct {
background: rgba(15, 145, 84, 0.15);
color: #0b6834;
}
.choice-button.incorrect {
background: rgba(201, 50, 50, 0.15);
color: #862424;
}
.choice-feedback {
font-weight: 700;
margin: 0.4rem 0;
}
.choice-feedback.ok {
color: #0b6834;
}
.choice-feedback.oops {
color: #a52b2b;
}
.chip {
padding: 0.2rem 0.85rem;
border-radius: 999px;
font-size: 0.85rem;
font-weight: 600;
background: rgba(16, 35, 68, 0.15);
color: #0f2344;
}
.global-description {
font-size: 1.1rem;
margin: 0.4rem 0 0;
color: #2c3454;
}
.global-progress {
margin-top: 0.75rem;
}
.progress-track {
width: 100%;
height: 10px;
border-radius: 999px;
background: rgba(15, 35, 68, 0.15);
overflow: hidden;
}
.progress-fill {
height: 100%;
border-radius: inherit;
background: linear-gradient(90deg, #ff7e5f, #feb47b);
transition: width 0.2s ease;
}
.controls-row {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
}
.control-button {
border: none;
border-radius: 999px;
padding: 0.65rem 1.4rem;
font-size: 0.95rem;
font-weight: 700;
cursor: pointer;
background: #fff;
color: #0f2344;
box-shadow: 0 10px 20px rgba(15, 35, 68, 0.15);
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.control-button:hover {
transform: translateY(-2px);
}
.control-button.primary {
background: linear-gradient(135deg, #ffb347, #ffcc33);
color: #09203f;
}
.control-button.active {
background: #10233f;
color: #fff;
}
.speed-buttons {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.speed-button {
border: none;
background: rgba(16, 35, 68, 0.12);
border-radius: 999px;
padding: 0.4rem 0.9rem;
font-size: 0.85rem;
cursor: pointer;
}
.speed-button.active {
background: #0f3c77;
color: #fff;
}
.global-lists {
display: grid;
gap: 1rem;
}
.panel {
background: #fff;
border-radius: 1.2rem;
padding: 1rem;
box-shadow: inset 0 0 0 1px rgba(15, 35, 68, 0.05);
}
.panel h3 {
margin: 0 0 0.6rem;
}
.history-list {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.history-chip {
padding: 0.35rem 0.75rem;
background: rgba(12, 57, 145, 0.08);
border-radius: 0.8rem;
font-weight: 600;
}
.favorites-grid {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
}
.favorite-chip {
background: rgba(255, 255, 255, 0.9);
border-radius: 0.9rem;
padding: 0.35rem 0.8rem;
box-shadow: 0 8px 16px rgba(15, 35, 68, 0.15);
}
/* Fonética */
.phonics-grid {
display: grid;
gap: 1.5rem;
}
.phoneme-scroll {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 0.75rem;
}
.phoneme-button {
border: none;
border-radius: 1rem;
padding: 0.85rem;
text-align: center;
font-weight: 700;
background: #fff;
box-shadow: 0 15px 30px rgba(85, 106, 168, 0.15);
cursor: pointer;
transition: transform 0.15s ease, background 0.15s ease;
}
.phoneme-button.active {
background: linear-gradient(135deg, #78ffd6, #a8ff78);
}
.phoneme-detail {
background: #fff;
border-radius: 1.2rem;
padding: 1.25rem;
box-shadow: inset 0 0 0 1px rgba(15, 35, 68, 0.05);
}
.syllable-lab {
background: linear-gradient(135deg, #eef2ff, #f5f9ff);
border-radius: 1.2rem;
padding: 1.25rem;
display: grid;
gap: 1rem;
}
.vowel-row {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.vowel-button {
border: none;
border-radius: 0.9rem;
padding: 0.4rem 0.9rem;
cursor: pointer;
font-weight: 700;
background: rgba(16, 35, 68, 0.08);
}
.vowel-button.active {
background: #0f3c77;
color: #fff;
}
.syllable-display {
font-size: 2.8rem;
font-weight: 800;
text-align: center;
color: #10233f;
}
.track {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.track-item {
background: #fff;
border-radius: 0.85rem;
padding: 0.45rem 0.9rem;
font-weight: 700;
box-shadow: 0 8px 20px rgba(15, 35, 68, 0.1);
}
/* Historias */
.story-grid {
display: grid;
gap: 1.5rem;
}
.story-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1rem;
}
.story-card {
background: #fff;
border-radius: 1.2rem;
padding: 1rem;
border: 2px solid transparent;
cursor: pointer;
box-shadow: 0 12px 25px rgba(13, 40, 80, 0.08);
transition: transform 0.15s ease, border 0.15s ease;
}
.story-card.active {
border-color: #ffd347;
}
.story-card h4 {
margin: 0 0 0.3rem;
}
.story-detail {
background: linear-gradient(135deg, #fff4d9, #ffe7ff);
border-radius: 1.2rem;
padding: 1.25rem;
box-shadow: 0 15px 40px rgba(45, 28, 81, 0.15);
}
.prompt-box {
background: rgba(255, 255, 255, 0.85);
border-radius: 1rem;
padding: 0.9rem;
margin-top: 0.8rem;
position: relative;
}
.prompt-actions {
margin-top: 0.6rem;
display: flex;
gap: 0.5rem;
}
.note-area {
width: 100%;
border-radius: 1rem;
border: none;
padding: 0.8rem;
font-family: inherit;
resize: none;
min-height: 90px;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.questions-list {
display: flex;
flex-direction: column;
gap: 0.35rem;
padding-left: 1rem;
}
.status-pill {
display: inline-flex;
align-items: center;
gap: 0.25rem;
padding: 0.3rem 0.7rem;
border-radius: 999px;
font-size: 0.8rem;
background: rgba(255, 255, 255, 0.6);
}
.copied {
font-size: 0.8rem;
color: #0b6834;
font-weight: 700;
}
@media (min-width: 900px) {
.hero {
flex-direction: row;
justify-content: space-between;
}
.hero-card {
max-width: 320px;
}
}

86
app/src/App.tsx Normal file
View File

@@ -0,0 +1,86 @@
import './App.css'
import { useState } from 'react'
import { ModuleTabs, type ModuleKey } from './components/ModuleTabs'
import { GlobalReading } from './modules/GlobalReading'
import { PhonicsPlay } from './modules/PhonicsPlay'
import { StoryLab } from './modules/StoryLab'
import { globalWords, highlightWords } from './data/globalWords'
import { phonemeDeck } from './data/phonemes'
import { storyPrompts } from './data/stories'
import { HelpCenter } from './components/HelpCenter'
const modules = [
{
key: 'global' as ModuleKey,
title: 'Lectura global',
emoji: '🚗',
description: 'Tarjetas rápidas estilo Doman con palabras favoritas.',
accent: '#ffcc33',
},
{
key: 'phonics' as ModuleKey,
title: 'Fonética Montessori',
emoji: '🔤',
description: 'Sílabas táctiles y retos de sonido.',
accent: '#87d1ff',
},
{
key: 'stories' as ModuleKey,
title: 'Historias Reggio',
emoji: '📚',
description: 'Cuentos personalizados e ideas de conversación.',
accent: '#ff8cc6',
},
]
function App() {
const [activeModule, setActiveModule] = useState<ModuleKey>('global')
return (
<div className="app-shell">
<header className="hero">
<div className="hero-top">
<span className="badge">Doman + Montessori + Reggio Emilia</span>
<h1 className="hero-title">Destino Lectura Milo</h1>
<p className="hero-text">
Tarjetas veloces como autos de carrera, fonética manos a la obra y cuentos con la
Bombonera mágica. Todo desde el navegador para cualquier tablet.
</p>
<div className="hero-tags">
{highlightWords.slice(0, 4).map((word) => (
<span key={word.palabra} className="hero-tag">
{word.palabra}
</span>
))}
<span className="hero-tag">Boca Juniors 💛💙</span>
</div>
</div>
<div className="hero-card">
<div className="hero-stat">
<span>{globalWords.length}</span>
palabras listas
</div>
<div className="hero-stat">
<span>{phonemeDeck.length}</span>
fonemas táctiles
</div>
<div className="hero-stat">
<span>{storyPrompts.length}</span>
historias guía
</div>
</div>
</header>
<ModuleTabs modules={modules} active={activeModule} onSelect={setActiveModule} />
<div className="module-panel">
{activeModule === 'global' && <GlobalReading />}
{activeModule === 'phonics' && <PhonicsPlay />}
{activeModule === 'stories' && <StoryLab />}
</div>
<HelpCenter />
</div>
)
}
export default App

1
app/src/assets/react.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -0,0 +1,69 @@
.help-center {
margin-top: 2.5rem;
background: #ffffff;
border-radius: 1.5rem;
padding: 1.75rem;
box-shadow: 0 25px 50px rgba(12, 31, 65, 0.12);
}
.help-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
flex-wrap: wrap;
}
.helper-emoji {
font-size: 2.8rem;
}
.help-text {
margin: 0.35rem 0 0;
max-width: 520px;
color: #435373;
}
.help-grid {
margin-top: 1.5rem;
display: grid;
gap: 1rem;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.help-card {
border-radius: 1.2rem;
border: 1px solid rgba(20, 40, 80, 0.08);
padding: 1.25rem;
background: rgba(246, 249, 255, 0.9);
}
.help-card-head {
display: flex;
align-items: center;
gap: 0.6rem;
margin-bottom: 0.5rem;
}
.help-icon {
font-size: 1.5rem;
}
.help-card h3 {
margin: 0;
}
.help-card ul {
margin: 0;
padding-left: 1.2rem;
color: #2c3759;
display: flex;
flex-direction: column;
gap: 0.4rem;
font-size: 0.95rem;
}
.badge.secondary {
background: rgba(16, 60, 119, 0.08);
color: #0f3c77;
}

View File

@@ -0,0 +1,68 @@
import './HelpCenter.css'
const helpCards = [
{
emoji: '🚗',
title: 'Lectura global',
steps: [
'Mira la imagen grande y di la palabra en voz alta.',
'Toca la palabra correcta entre las opciones para relacionar palabra-imagen.',
'Activa “Modo ráfaga” para repasar rápidamente y agrega favoritas para repetirlas más tarde.',
],
},
{
emoji: '🔤',
title: 'Fonética Montessori',
steps: [
'Elige un fonema y haz el gesto Montessori con la boca/manos.',
'Combínalo con vocales para crear sílabas y arrástralas al circuito (botón “Agregar al circuito”).',
'Usa “Reto relámpago” para mezclar sonidos sorpresa y repetirlos con autos imaginarios.',
],
},
{
emoji: '📚',
title: 'Historias Reggio',
steps: [
'Selecciona un cuento, lee el escenario y genera prompts para Gemini (texto + imagen).',
'Guarda notas de lo que dice el niño y formula preguntas Reggio (“¿Por qué...?”).',
'Marca “Listo para Milo” cuando la historia esté aprobada y usa las preguntas para conversar.',
],
},
]
export function HelpCenter() {
return (
<section className="help-center" aria-labelledby="ayuda-heading">
<div className="help-header">
<div>
<p className="badge secondary">Centro de ayuda</p>
<h2 id="ayuda-heading">¿Cómo jugamos?</h2>
<p className="help-text">
Breve guía para adultos y peques: cada módulo mezcla lectura global, fonética Montessori
y conversación Reggio para que Milo aprenda jugando.
</p>
</div>
<span className="helper-emoji" role="img" aria-label="Guía">
🧠
</span>
</div>
<div className="help-grid">
{helpCards.map((card) => (
<article key={card.title} className="help-card">
<div className="help-card-head">
<span className="help-icon" aria-hidden>
{card.emoji}
</span>
<h3>{card.title}</h3>
</div>
<ul>
{card.steps.map((step) => (
<li key={step}>{step}</li>
))}
</ul>
</article>
))}
</div>
</section>
)
}

View File

@@ -0,0 +1,55 @@
.module-tabs {
display: grid;
gap: 0.75rem;
margin: 1.5rem 0;
}
.module-tab {
display: flex;
align-items: center;
gap: 1rem;
padding: 1rem 1.25rem;
border-radius: 1rem;
border: 3px solid transparent;
background: rgba(255, 255, 255, 0.8);
box-shadow: 0 10px 30px rgba(16, 35, 68, 0.1);
cursor: pointer;
text-align: left;
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.module-tab:hover {
transform: translateY(-2px);
box-shadow: 0 12px 35px rgba(16, 35, 68, 0.18);
}
.module-tab.active {
background: #10233f;
color: #fff;
}
.module-tab.active .module-description {
color: rgba(255, 255, 255, 0.9);
}
.module-emoji {
font-size: 2rem;
}
.module-title {
font-size: 1.1rem;
font-weight: 700;
margin: 0;
}
.module-description {
font-size: 0.9rem;
margin: 0.15rem 0 0;
color: #3d506f;
}
@media (min-width: 768px) {
.module-tabs {
grid-template-columns: repeat(3, 1fr);
}
}

View File

@@ -0,0 +1,40 @@
import './ModuleTabs.css'
export type ModuleKey = 'global' | 'phonics' | 'stories'
export interface ModuleDefinition {
key: ModuleKey
title: string
emoji: string
description: string
accent: string
}
interface Props {
modules: ModuleDefinition[]
active: ModuleKey
onSelect: (key: ModuleKey) => void
}
export function ModuleTabs({ modules, active, onSelect }: Props) {
return (
<div className="module-tabs">
{modules.map((module) => (
<button
key={module.key}
className={`module-tab ${active === module.key ? 'active' : ''}`}
style={{ borderColor: module.accent }}
onClick={() => onSelect(module.key)}
>
<span className="module-emoji" aria-hidden>
{module.emoji}
</span>
<div>
<p className="module-title">{module.title}</p>
<p className="module-description">{module.description}</p>
</div>
</button>
))}
</div>
)
}

1
app/src/config.ts Normal file
View File

@@ -0,0 +1 @@
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL ?? 'http://localhost:3000'

View File

@@ -0,0 +1,19 @@
import rawWords from '@content/palabras-globales.json'
import type { GlobalWord, GlobalWordWithSlug } from '../types/content'
import { slugify } from '../utils/slug'
export const globalWords = (rawWords as GlobalWordWithSlug[]).map((word) => ({
...word,
slug: slugify(word.palabra),
}))
export const wordThemes = Array.from(
globalWords.reduce<Map<string, GlobalWord[]>>((acc, word) => {
const bucket = acc.get(word.tema) ?? []
bucket.push(word)
acc.set(word.tema, bucket)
return acc
}, new Map())
).map(([tema, palabras]) => ({ tema, palabras }))
export const highlightWords = globalWords.slice(0, 6)

6
app/src/data/phonemes.ts Normal file
View File

@@ -0,0 +1,6 @@
import rawPhonemes from '@content/fonemas-iniciales.json'
import type { PhonemeCard } from '../types/content'
export const phonemeDeck = rawPhonemes as PhonemeCard[]
export const defaultPhoneme = phonemeDeck[0]

4
app/src/data/stories.ts Normal file
View File

@@ -0,0 +1,4 @@
import rawStories from '@content/historias-tematicas.json'
import type { StoryPrompt } from '../types/content'
export const storyPrompts = rawStories as StoryPrompt[]

31
app/src/index.css Normal file
View File

@@ -0,0 +1,31 @@
:root {
font-family: 'Nunito', 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
line-height: 1.5;
font-weight: 500;
color: #10233f;
background-color: #e7f1ff;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
*, *::before, *::after {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
background: radial-gradient(circle at top, #fdf5ff, #e5f2ff 45%, #e8efff 100%);
color: inherit;
}
a {
color: inherit;
text-decoration: none;
}
button {
font-family: inherit;
}

10
app/src/main.tsx Normal file
View File

@@ -0,0 +1,10 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.tsx'
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
)

View File

@@ -0,0 +1,285 @@
import { useCallback, useEffect, useMemo, useState } from 'react'
import { globalWords } from '../data/globalWords'
import { API_BASE_URL } from '../config'
const exposuresGoal = 5
const speedOptions = [
{ label: 'Suave', ms: 2600 },
{ label: 'Normal', ms: 1800 },
{ label: 'Turbo', ms: 1100 },
]
const shuffle = <T,>(items: T[]): T[] => {
const array = [...items]
for (let i = array.length - 1; i > 0; i -= 1) {
const j = Math.floor(Math.random() * (i + 1))
;[array[i], array[j]] = [array[j], array[i]]
}
return array
}
const buildChoices = (palabra: string, total = 4) => {
const otherWords = globalWords.filter((item) => item.palabra !== palabra).map((item) => item.palabra)
const randomOthers = shuffle(otherWords).slice(0, total - 1)
return shuffle([palabra, ...randomOthers])
}
export function GlobalReading() {
const [currentIndex, setCurrentIndex] = useState(0)
const [autoPlay, setAutoPlay] = useState(false)
const [speed, setSpeed] = useState(speedOptions[1].ms)
const [history, setHistory] = useState<string[]>([])
const [favorites, setFavorites] = useState<string[]>([])
const [exposures, setExposures] = useState<Record<string, number>>({})
const [choices, setChoices] = useState<string[]>(() => buildChoices(globalWords[0].palabra))
const [selectedChoice, setSelectedChoice] = useState<string | null>(null)
const [isMatchCorrect, setIsMatchCorrect] = useState<boolean | null>(null)
const [imageCache, setImageCache] = useState<Record<string, string>>({})
const [imageStatus, setImageStatus] = useState<Record<string, 'loading' | 'ready' | 'error'>>({})
const currentWord = globalWords[currentIndex]
const exposureProgress = (exposures[currentWord.palabra] ?? 0) / exposuresGoal
const advance = useCallback(() => {
setCurrentIndex((prevIndex) => {
const shownWord = globalWords[prevIndex]
setHistory((prev) => {
const next = [shownWord.palabra, ...prev.filter((word) => word !== shownWord.palabra)]
return next.slice(0, 6)
})
setExposures((prev) => ({
...prev,
[shownWord.palabra]: Math.min(exposuresGoal, (prev[shownWord.palabra] ?? 0) + 1),
}))
return (prevIndex + 1) % globalWords.length
})
}, [])
useEffect(() => {
setChoices(buildChoices(currentWord.palabra))
setSelectedChoice(null)
setIsMatchCorrect(null)
}, [currentWord.palabra])
useEffect(() => {
const slug = currentWord.slug
setImageCache((prev) => {
if (prev[slug]) return prev
const url = `${API_BASE_URL}/global-words/${slug}/image?ts=${Date.now()}`
return { ...prev, [slug]: url }
})
setImageStatus((prev) => {
if (prev[slug]) return prev
return { ...prev, [slug]: 'loading' }
})
}, [currentWord.slug])
useEffect(() => {
if (!autoPlay) return
const id = window.setInterval(advance, speed)
return () => window.clearInterval(id)
}, [autoPlay, advance, speed])
const goBack = () => {
setCurrentIndex((prev) => (prev - 1 + globalWords.length) % globalWords.length)
}
const toggleFavorite = () => {
setFavorites((prev) =>
prev.includes(currentWord.palabra)
? prev.filter((word) => word !== currentWord.palabra)
: [...prev, currentWord.palabra]
)
}
const handleChoice = (option: string) => {
setSelectedChoice(option)
setIsMatchCorrect(option === currentWord.palabra)
}
const retryImage = () => {
const slug = currentWord.slug
const retryUrl = `${API_BASE_URL}/global-words/${slug}/image?ts=${Date.now()}`
setImageCache((prev) => ({ ...prev, [slug]: retryUrl }))
setImageStatus((prev) => ({ ...prev, [slug]: 'loading' }))
}
const handleImageLoad = () => {
const slug = currentWord.slug
setImageStatus((prev) => ({ ...prev, [slug]: 'ready' }))
}
const handleImageError = () => {
const slug = currentWord.slug
setImageStatus((prev) => ({ ...prev, [slug]: 'error' }))
}
const currentImage = imageCache[currentWord.slug]
const currentImageStatus = imageStatus[currentWord.slug]
const spelledLetters = useMemo(() => {
const normalized = currentWord.palabra
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.replace(/\s+/g, '')
return normalized.split('').map((char) => char.toUpperCase())
}, [currentWord.palabra])
const spelledWord = spelledLetters.join(' ')
const masteryCount = useMemo(
() => Object.values(exposures).filter((count) => count >= exposuresGoal).length,
[exposures]
)
return (
<section className="global-module">
<div className="global-card">
<div>
<p className="chip">Palabra #{currentIndex + 1}</p>
<div className="word-letter-row" aria-label={currentWord.palabra}>
{spelledLetters.map((letter, index) => (
<span key={`title-${letter}-${index}`} className="letter-card big">
{letter}
</span>
))}
</div>
<p className="original-word">{currentWord.palabra}</p>
<div className="global-tags">
<span className="chip">{currentWord.categoria}</span>
<span className="chip">{currentWord.tema}</span>
</div>
<div className="global-figure">
<div className="global-figure-media">
{currentImage ? (
<>
<img
src={currentImage}
alt={`Ilustración de ${currentWord.palabra}`}
onLoad={handleImageLoad}
onError={handleImageError}
/>
{currentImageStatus !== 'ready' && (
<span className="image-badge">
{currentImageStatus === 'loading'
? 'Generando ilustración...'
: 'Error al cargar'}
</span>
)}
</>
) : (
<div className="image-placeholder">Generando ilustración...</div>
)}
</div>
<div className="spelling-panel">
<p className="spelling-label">Así se escribe</p>
<div className="letter-row" aria-label={`Letras: ${spelledWord}`}>
{spelledLetters.map((letter, index) => (
<span key={`panel-${letter}-${index}`} className="letter-card">
{letter}
</span>
))}
</div>
<p className="global-description">{currentWord.descripcion}</p>
{currentImageStatus === 'error' && (
<button className="control-button" onClick={retryImage}>
Reintentar imagen
</button>
)}
</div>
</div>
<div className="global-choices">
{choices.map((option) => (
<button
key={option}
className={`choice-button ${
option === selectedChoice
? isMatchCorrect
? 'correct'
: 'incorrect'
: ''
}`}
onClick={() => handleChoice(option)}
>
{option}
</button>
))}
</div>
{selectedChoice && (
<p className={`choice-feedback ${isMatchCorrect ? 'ok' : 'oops'}`}>
{isMatchCorrect ? '¡Excelente! Encajaste la palabra con la imagen.' : 'Probemos otra vez.'}
</p>
)}
<div className="global-progress">
<small>
Exposiciones: {exposures[currentWord.palabra] ?? 0}/{exposuresGoal}
</small>
<div className="progress-track" aria-hidden>
<div className="progress-fill" style={{ width: `${exposureProgress * 100}%` }} />
</div>
</div>
</div>
<div className="controls-row">
<button className="control-button" onClick={goBack}>
Volver
</button>
<button className="control-button primary" onClick={advance}>
Siguiente
</button>
<button
className={`control-button ${autoPlay ? 'active' : ''}`}
onClick={() => setAutoPlay((prev) => !prev)}
>
{autoPlay ? 'Detener ráfaga' : 'Modo ráfaga'}
</button>
<button className="control-button" onClick={toggleFavorite}>
{favorites.includes(currentWord.palabra) ? 'Quitar favorito' : 'Favorito 🚀'}
</button>
</div>
<div>
<p style={{ margin: '0 0 0.35rem', fontWeight: 700 }}>Velocidad</p>
<div className="speed-buttons">
{speedOptions.map((option) => (
<button
key={option.label}
className={`speed-button ${speed === option.ms ? 'active' : ''}`}
onClick={() => setSpeed(option.ms)}
>
{option.label}
</button>
))}
</div>
</div>
<p style={{ margin: 0, fontWeight: 700 }}>
Palabras dominadas: {masteryCount}/{globalWords.length}
</p>
</div>
<div className="global-lists">
<div className="panel">
<h3>Últimas palabras</h3>
<div className="history-list">
{history.length === 0 && <span>No hay historial aún.</span>}
{history.map((item) => (
<span key={item} className="history-chip">
{item}
</span>
))}
</div>
</div>
<div className="panel">
<h3>Favoritas de Milo</h3>
<div className="favorites-grid">
{favorites.length === 0 && <span>Toca para guardarlas.</span>}
{favorites.map((word) => (
<span key={word} className="favorite-chip">
{word}
</span>
))}
</div>
</div>
</div>
</section>
)
}

View File

@@ -0,0 +1,106 @@
import { useMemo, useState } from 'react'
import { phonemeDeck, defaultPhoneme } from '../data/phonemes'
const vowels = ['a', 'e', 'i', 'o', 'u']
export function PhonicsPlay() {
const [selectedPhoneme, setSelectedPhoneme] = useState(defaultPhoneme)
const [activeVowel, setActiveVowel] = useState('a')
const [track, setTrack] = useState<string[]>([])
const [challenge, setChallenge] = useState<string | null>(null)
const syllable = useMemo(() => {
if (!selectedPhoneme) return ''
return `${selectedPhoneme.fonema}${activeVowel}`
}, [selectedPhoneme, activeVowel])
const addToTrack = () => {
if (!syllable) return
setTrack((prev) => [syllable, ...prev].slice(0, 8))
}
const spinChallenge = () => {
const randomPhoneme = phonemeDeck[Math.floor(Math.random() * phonemeDeck.length)]
const randomVowel = vowels[Math.floor(Math.random() * vowels.length)]
setSelectedPhoneme(randomPhoneme)
setActiveVowel(randomVowel)
setChallenge(`${randomPhoneme.fonema}${randomVowel}`)
}
if (!selectedPhoneme) return null
return (
<section className="phonics-grid">
<div className="phoneme-scroll">
{phonemeDeck.map((card) => (
<button
key={card.fonema}
className={`phoneme-button ${
card.fonema === selectedPhoneme.fonema ? 'active' : ''
}`}
onClick={() => {
setSelectedPhoneme(card)
setChallenge(null)
}}
>
<span style={{ fontSize: '1.5rem' }}>{card.fonema}</span>
<small>{card.grafemas.join(', ')}</small>
</button>
))}
</div>
<div className="phoneme-detail">
<h3>Fonema /{selectedPhoneme.fonema}/</h3>
<p>
<strong>Gesto Montessori:</strong> {selectedPhoneme.gestoMontessori}
</p>
<p>
<strong>Palabras clave:</strong> {selectedPhoneme.palabrasClave.join(', ')}
</p>
<p>{selectedPhoneme.actividad}</p>
</div>
<div className="syllable-lab">
<div>
<p>Elige una vocal para combinar</p>
<div className="vowel-row">
{vowels.map((vowel) => (
<button
key={vowel}
className={`vowel-button ${activeVowel === vowel ? 'active' : ''}`}
onClick={() => setActiveVowel(vowel)}
>
{vowel.toUpperCase()}
</button>
))}
</div>
</div>
<div className="syllable-display">{syllable}</div>
<div className="controls-row">
<button className="control-button primary" onClick={addToTrack}>
Agregar al circuito
</button>
<button className="control-button" onClick={spinChallenge}>
Reto relámpago
</button>
</div>
{challenge && (
<p>
Busca <strong>{challenge}</strong> en los cuentos o arma la ficha correcta para avanzar.
</p>
)}
<div>
<p style={{ margin: '0.5rem 0' }}>Trayecto practicado</p>
<div className="track">
{track.length === 0 && <span>Agrega sílabas para verlas aquí.</span>}
{track.map((item, index) => (
<span key={`${item}-${index}`} className="track-item">
{item}
</span>
))}
</div>
</div>
</div>
</section>
)
}

View File

@@ -0,0 +1,117 @@
import { useMemo, useState } from 'react'
import { storyPrompts } from '../data/stories'
export function StoryLab() {
const [selectedStory, setSelectedStory] = useState(storyPrompts[0])
const [notes, setNotes] = useState('')
const [copied, setCopied] = useState<string | null>(null)
const [approvedStories, setApprovedStories] = useState<Set<string>>(new Set())
const reggioQuestions = useMemo(
() => [
`¿Por qué crees que ${selectedStory.personajes[0]} se sintió así?`,
'¿Qué cambiarías tú en la escena?',
'¿Dónde escuchaste algo parecido antes?',
],
[selectedStory.personajes]
)
const copyPrompt = async (text: string, label: string) => {
if (navigator?.clipboard) {
await navigator.clipboard.writeText(text)
setCopied(label)
setTimeout(() => setCopied(null), 1600)
}
}
const toggleApproved = (title: string) => {
setApprovedStories((prev) => {
const updated = new Set(prev)
if (updated.has(title)) {
updated.delete(title)
} else {
updated.add(title)
}
return updated
})
}
return (
<section className="story-grid">
<div className="story-list">
{storyPrompts.map((story) => (
<article
key={story.titulo}
className={`story-card ${selectedStory.titulo === story.titulo ? 'active' : ''}`}
onClick={() => setSelectedStory(story)}
>
<h4>{story.titulo}</h4>
<p style={{ margin: 0, fontSize: '0.9rem' }}>{story.escenario}</p>
<p style={{ fontSize: '0.85rem', margin: '0.4rem 0 0' }}>
🎯 {story.objetivo}
</p>
<p style={{ fontSize: '0.8rem', margin: '0.4rem 0 0' }}>
👥 {story.personajes.join(', ')}
</p>
<div className="status-pill" style={{ marginTop: '0.6rem' }}>
{approvedStories.has(story.titulo) ? 'Listo para contar ✅' : 'Borrador ✏️'}
</div>
</article>
))}
</div>
<div className="story-detail">
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<h3 style={{ margin: 0 }}>{selectedStory.titulo}</h3>
<p style={{ margin: '0.4rem 0' }}>{selectedStory.escenario}</p>
</div>
<button className="control-button primary" onClick={() => toggleApproved(selectedStory.titulo)}>
{approvedStories.has(selectedStory.titulo) ? 'Marcar como borrador' : 'Listo para Milo'}
</button>
</div>
<div className="prompt-box">
<strong>Prompt de texto para Gemini</strong>
<p style={{ margin: '0.4rem 0' }}>{selectedStory.promptTexto}</p>
<div className="prompt-actions">
<button className="control-button" onClick={() => copyPrompt(selectedStory.promptTexto, 'texto')}>
Copiar texto
</button>
{copied === 'texto' && <span className="copied">¡Copiado!</span>}
</div>
</div>
<div className="prompt-box">
<strong>Prompt de ilustración</strong>
<p style={{ margin: '0.4rem 0' }}>{selectedStory.promptImagen}</p>
<div className="prompt-actions">
<button className="control-button" onClick={() => copyPrompt(selectedStory.promptImagen, 'imagen')}>
Copiar imagen
</button>
{copied === 'imagen' && <span className="copied">¡Copiado!</span>}
</div>
</div>
<div style={{ marginTop: '1rem' }}>
<h4>Preguntas Reggio</h4>
<div className="questions-list">
{reggioQuestions.map((question) => (
<span key={question}> {question}</span>
))}
</div>
</div>
<div style={{ marginTop: '1rem' }}>
<h4>Notas del adulto</h4>
<textarea
className="note-area"
placeholder="Escribe aquí ideas de Milo, palabras que quiere practicar o finales alternativos."
value={notes}
onChange={(event) => setNotes(event.target.value)}
/>
</div>
</div>
</section>
)
}

27
app/src/types/content.ts Normal file
View File

@@ -0,0 +1,27 @@
export interface GlobalWord {
palabra: string
categoria: string
tema: string
descripcion: string
}
export interface GlobalWordWithSlug extends GlobalWord {
slug: string
}
export interface PhonemeCard {
fonema: string
grafemas: string[]
gestoMontessori: string
palabrasClave: string[]
actividad: string
}
export interface StoryPrompt {
titulo: string
escenario: string
personajes: string[]
objetivo: string
promptTexto: string
promptImagen: string
}

7
app/src/utils/slug.ts Normal file
View File

@@ -0,0 +1,7 @@
export const slugify = (text: string) =>
text
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.replace(/[^a-zA-Z0-9]+/g, '-')
.replace(/^-+|-+$/g, '')
.toLowerCase()

33
app/tsconfig.app.json Normal file
View File

@@ -0,0 +1,33 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2022",
"useDefineForClassFields": true,
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "ESNext",
"types": ["vite/client"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"@content/*": ["../content/*"]
},
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src", "../content/**/*.json"]
}

7
app/tsconfig.json Normal file
View File

@@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}

30
app/tsconfig.node.json Normal file
View File

@@ -0,0 +1,30 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2023",
"lib": ["ES2023"],
"module": "ESNext",
"types": ["node"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"baseUrl": ".",
"paths": {
"@content/*": ["../content/*"]
},
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}

18
app/vite.config.ts Normal file
View File

@@ -0,0 +1,18 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
fs: {
allow: [path.resolve(__dirname, '..')],
},
},
resolve: {
alias: {
'@content': path.resolve(__dirname, '../content'),
},
},
})