Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import DownloadCenter from './DownloadCenter'
import { DOWNLOAD_CENTER_PATH, downloadGames } from './downloadCatalog'
import { useEffect, useMemo, useRef, useState } from 'react'
import type { Session } from '@supabase/supabase-js'
import { supabase } from './lib/supabase'
Expand Down Expand Up @@ -209,8 +211,6 @@ function SectionHeader({
)
}

const BETA_DOWNLOAD_URL = 'https://github.com/SpidoCode/spido-code/releases/download/v1.0.0-beta/SPIDOCODE-Windows-x64-v1.0.0-beta.zip'
const BETA_RELEASE_URL = 'https://github.com/SpidoCode/spido-code/releases/tag/v1.0.0-beta'

function GameDownloads() {
return (
Expand All @@ -222,10 +222,9 @@ function GameDownloads() {
<p className="spido-eyebrow">BETA DISPONIBLE</p>
<h3 id="main-game-title">SPIDOCODE</h3>
<p>El juego principal. Programa junto a Spid y explora su mundo espacial.</p>
<p className="spido-download-meta">v1.0.0-beta · Windows x64 · Aproximadamente 100 MB</p>
<p className="spido-download-meta">{downloadGames[0].releases[0]?.version} · Windows x64</p>
<div className="spido-actions">
<a href={BETA_DOWNLOAD_URL} className="spido-button" aria-label="Descargar Beta de SPIDOCODE para Windows x64, archivo ZIP">Descargar Beta <span aria-hidden="true">↓</span></a>
<a href={BETA_RELEASE_URL} target="_blank" rel="noopener noreferrer" className="spido-button spido-button-secondary" aria-label="Ver Release en GitHub, se abre en una pestaña nueva">Ver Release <span aria-hidden="true">↗</span></a>
<a href={DOWNLOAD_CENTER_PATH} className="spido-button" aria-label="Ver descargas de SPIDOCODE para Windows x64">Ver descargas <span aria-hidden="true">↓</span></a>
</div>
<ol className="spido-download-steps">
<li>Descarga el archivo ZIP.</li>
Expand Down Expand Up @@ -255,10 +254,10 @@ function Hero() {
<h1>Aprende programación.<br /><span>Explora un nuevo mundo.</span></h1>
<p>Programa junto a Spid. Explora un entorno espacial, resuelve misiones y aprende con cada intento.</p>
<div className="spido-actions">
<a href={BETA_DOWNLOAD_URL} className="spido-button" aria-label="Descargar Beta de SPIDOCODE para Windows x64, archivo ZIP">Descargar Beta <span aria-hidden="true">↓</span></a>
<a href="#descargas" className="spido-button spido-button-secondary">Ver los juegos <span aria-hidden="true">↓</span></a>
<a href={DOWNLOAD_CENTER_PATH} className="spido-button" aria-label="Ver descargas de SPIDOCODE para Windows x64">Ver descargas <span aria-hidden="true">↓</span></a>
<a href={DOWNLOAD_CENTER_PATH} className="spido-button spido-button-secondary">Ver los juegos <span aria-hidden="true">↓</span></a>
</div>
<p className="spido-game-availability" role="note">Beta v1.0.0-beta disponible para Windows x64 · Aproximadamente 100 MB. Descarga, extrae el ZIP y ejecuta SpidoCode.exe.</p>
<p className="spido-game-availability" role="note">Consulta las betas disponibles y las instrucciones de instalación en el centro de descargas.</p>
<div className="spido-hero-companion"><span>SPID / TU COMPAÑERO</span><p>Un pequeño robot con aspecto de computador y patas. Una gran aventura por descubrir.</p></div>
</div>
<figure className="spido-capture">
Expand Down Expand Up @@ -1375,6 +1374,7 @@ function LandingPage() {

export default function App() {
const pathname = window.location.pathname.replace(/\/+$/, '') || '/'
if (pathname === DOWNLOAD_CENTER_PATH) return <DownloadCenter />
if (pathname === '/recuperar-contrasena') return <RequestPasswordRecovery />
if (pathname === '/confirmar-recuperacion') return <ResetPasswordPage />
if (pathname === '/reset-password') return <ResetPasswordPage legacy />
Expand Down
28 changes: 28 additions & 0 deletions src/DownloadCenter.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.download-center { color: #2b3040; background: linear-gradient(#eef1f6, #eef1f6 55%, #dce5de); }
.download-center-header { border-bottom: 1px solid #cbd2dc; }
.download-center-header > div { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 14px; }
.download-center-main { padding-block: clamp(32px, 6vw, 74px); }
.download-center-intro { margin-bottom: 28px; }
.download-center-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3vw, 32px); }
.download-center-card, .download-center-install { background: #fff; border: 1px solid #cbd2dc; border-radius: 24px; box-shadow: 0 12px 30px #2b304014; }
.download-center-card { scroll-margin-top: 16px; min-width: 0; }
.download-center-card > img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 23px 23px 0 0; }
.download-center-content, .download-center-install { padding: clamp(18px, 3vw, 30px); display: grid; gap: 12px; }
.download-center :is(h2) { font: 700 clamp(1.55rem, 4vw, 2.35rem)/1.15 'Spido Pixel', 'Pixelify Sans', monospace; }
.download-center-status { justify-self: start; padding: 5px 10px; border-radius: 30px; background: #d6eedc; color: #285837; font-size: .8rem; font-weight: 700; }
.download-center-meta { font-weight: 600; }
.download-center-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.download-center details { border-top: 1px solid #dce1e7; padding-top: 12px; }
.download-center summary { cursor: pointer; font-weight: 600; }
.download-center details :is(ul,p) { margin-top: 8px; }
.download-center details a { color: #285837; text-decoration: underline; }
.download-center-install { margin-top: 26px; }
.download-center-install ol { list-style: decimal; padding-inline-start: 1.45em; line-height: 1.8; }
.download-center :is(a, summary):focus-visible { outline: 3px solid #285837; outline-offset: 3px; }
@media (max-width: 720px) { .download-center-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: no-preference) {
.download-center-card { animation: download-center-arrive 360ms ease-out both; transition: border-color 160ms ease, box-shadow 160ms ease; }
.download-center-card:nth-child(2) { animation-delay: 70ms; }
.download-center-card:focus-within, .download-center-card:hover { border-color: #659372; box-shadow: 0 14px 32px #2b304021; }
}
@keyframes download-center-arrive { from { transform: translateY(6px); } }
67 changes: 67 additions & 0 deletions src/DownloadCenter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { Footer } from './SimpleLanding'
import { downloadGames, releaseLinks } from './downloadCatalog'
import './DownloadCenter.css'

const formatMB = (bytes: number) => new Intl.NumberFormat('es', { maximumFractionDigits: 1 }).format(bytes / 1_000_000)

export default function DownloadCenter() {
return (
<div className="simple-site download-center">
<header className="download-center-header">
<div className="simple-container">
<a className="simple-brand" href="/" aria-label="SPIDOCODE, inicio">SPIDO<span>CODE</span></a>
<a className="simple-btn-ghost" href="/">← Volver al inicio</a>
</div>
</header>
<main className="simple-container download-center-main">
<div className="download-center-intro">
<h1 className="sec-section-title">Descarga los juegos</h1>
<p className="sec-section-desc">Elige tu siguiente misión. Aquí encontrarás las versiones oficiales para Windows.</p>
</div>
<div className="download-center-grid">
{downloadGames.map((game) => {
const latest = game.releases[0]
return (
<article id={game.id} className="download-center-card" key={game.id} aria-labelledby={game.id + '-title'}>
<img src={game.cover} alt="" width="1024" height="576" />
<div className="download-center-content">
<p className="download-center-status">{latest ? 'Beta disponible' : 'Beta próximamente'}</p>
<h2 id={game.id + '-title'}>{game.name}</h2>
<p>{game.description}</p>
<p className="download-center-meta">
Windows x64{latest && ` · ${latest.version} · ZIP de ${formatMB(latest.bytes)} MB`}
</p>
{latest ? (
<div className="download-center-actions">
<a className="btn-download-hero" href={releaseLinks(game, latest).download} aria-label={`Descargar ${game.name} para Windows x64`}>Descargar Beta ↓</a>
<a className="btn-download-release" href={releaseLinks(game, latest).notes}>Ver Release</a>
</div>
) : <p>La primera descarga estará disponible cuando se publique su Release oficial.</p>}
<details>
<summary>Historial de versiones</summary>
{game.releases.length ? (
<ul>{game.releases.map((release) => (
<li key={release.version}>
<strong>{release.version}</strong> · <a href={releaseLinks(game, release).download}>Descargar ZIP</a> · <a href={releaseLinks(game, release).notes}>Ver notas</a>
</li>
))}</ul>
) : <p>Todavía no hay versiones publicadas.</p>}
</details>
</div>
</article>
)
})}
</div>
<section className="download-center-install" aria-labelledby="install-title">
<h2 id="install-title">Cómo instalar</h2>
<ol>
<li>Descarga el ZIP del juego para Windows x64.</li>
<li>Extrae la carpeta completa en tu equipo.</li>
<li>Abre la carpeta y ejecuta <code>{downloadGames[0].executable}</code> o <code>{downloadGames[1].executable}</code>, según el juego. Conserva el PCK junto al ejecutable.</li>
</ol>
</section>
</main>
<Footer />
</div>
)
}
11 changes: 7 additions & 4 deletions src/SimpleLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import type { Session } from '@supabase/supabase-js'
import { supabase } from './lib/supabase'
import './SimpleLanding.css'

export const BETA_DOWNLOAD_URL =
'https://github.com/SpidoCode/spido-code/releases/download/v1.0.0-beta/SPIDOCODE-Windows-x64-v1.0.0-beta.zip'
export const BETA_RELEASE_URL = 'https://github.com/SpidoCode/spido-code/releases/tag/v1.0.0-beta'
import { DOWNLOAD_CENTER_PATH, downloadGames } from './downloadCatalog'

// El texto real siempre permanece en el árbol accesible; solo cambia su copia decorativa.
function EncryptedLabel({ text, duration = 405, immediate = false, title = false }: {
Expand Down Expand Up @@ -163,6 +161,7 @@ export function Nav() {
<nav className="simple-nav-links" aria-label="Navegación principal">
<a href="/#inicio">Inicio</a>
<a href="/#juegos">Juegos</a>
<a href={DOWNLOAD_CENTER_PATH}>Descargas</a>
<a href="/#ada">A.D.A</a>
</nav>

Expand Down Expand Up @@ -316,6 +315,7 @@ export default function SimpleLanding() {
<a href="#juegos" className="simple-btn-primary" style={{ padding: '14px 26px' }}>
Ver Juegos
</a>
<a href={DOWNLOAD_CENTER_PATH} className="simple-btn-ghost">Descargas</a>
</div>
</div>

Expand Down Expand Up @@ -599,7 +599,7 @@ export function Footer() {
</p>
<div className="sec-footer-status">
<span className="sec-footer-status-dot" />
Versión Beta v1.0.0 activa
Beta {downloadGames[0].releases[0]?.version} disponible
</div>
</div>

Expand All @@ -612,6 +612,9 @@ export function Footer() {
<li>
<a href="/#juegos">Juegos</a>
</li>
<li>
<a href={DOWNLOAD_CENTER_PATH}>Descargas</a>
</li>
<li>
<a href="/#ada">Sistema A.D.A</a>
</li>
Expand Down
17 changes: 5 additions & 12 deletions src/SpidoCodeGamePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Nav, Footer, NeonSpeckles, BETA_DOWNLOAD_URL, BETA_RELEASE_URL } from './SimpleLanding'
import { DOWNLOAD_CENTER_PATH } from './downloadCatalog'
import { Nav, Footer, NeonSpeckles } from './SimpleLanding'
import './SimpleLanding.css'

export default function SpidoCodeGamePage() {
Expand Down Expand Up @@ -42,19 +43,11 @@ export default function SpidoCodeGamePage() {
{/* Links de descarga y acciones */}
<div className="game-central-actions">
<a
href={BETA_DOWNLOAD_URL}
href={DOWNLOAD_CENTER_PATH + "#spidocode"}
className="btn-download-hero"
aria-label="Descargar Beta de SpidoCode para Windows x64"
>
Descargar Beta para Windows x64
</a>
<a
href={BETA_RELEASE_URL}
target="_blank"
rel="noopener noreferrer"
className="btn-download-release"

>
Ver Release en GitHub
Ver descargas para Windows x64
</a>
</div>
</div>
Expand Down
17 changes: 5 additions & 12 deletions src/SpidoCodeZeroPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Nav, Footer, NeonSpeckles, BETA_DOWNLOAD_URL, BETA_RELEASE_URL } from './SimpleLanding'
import { DOWNLOAD_CENTER_PATH } from './downloadCatalog'
import { Nav, Footer, NeonSpeckles } from './SimpleLanding'
import './SimpleLanding.css'

export default function SpidoCodeZeroPage() {
Expand Down Expand Up @@ -42,19 +43,11 @@ export default function SpidoCodeZeroPage() {
{/* Links de descarga y acciones */}
<div className="game-central-actions">
<a
href={BETA_DOWNLOAD_URL}
href={DOWNLOAD_CENTER_PATH + "#spidocode-0"}
className="btn-download-hero"
aria-label="Descargar Beta de SpidoCode 0 para Windows x64"
>
Descargar Beta para Windows x64
</a>
<a
href={BETA_RELEASE_URL}
target="_blank"
rel="noopener noreferrer"
className="btn-download-release"

>
Ver Release en GitHub
Ver descargas para Windows x64
</a>
</div>
</div>
Expand Down
50 changes: 50 additions & 0 deletions src/downloadCatalog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
export const DOWNLOAD_CENTER_PATH = '/descargas'

type PublishedRelease = {
version: string
file: string
bytes: number
}

type DownloadGame = {
id: string
name: string
repository: string
cover: string
description: string
executable: string
releases: readonly PublishedRelease[]
}

export const downloadGames: readonly DownloadGame[] = [
{
id: 'spidocode',
name: 'SPIDOCODE',
repository: 'SpidoCode/spido-code',
cover: '/images/spidocode/spidocode-cover.jpg',
description: 'Programa a Spid con código escrito y automatiza misiones de exploración espacial.',
executable: 'SpidoCode.exe',
releases: [
{ version: 'v1.0.1-beta', file: 'SPIDOCODE-Windows-x64-v1.0.1-beta.zip', bytes: 104384484 },
{ version: 'v1.0.0-beta', file: 'SPIDOCODE-Windows-x64-v1.0.0-beta.zip', bytes: 104355151 },
],
},
{
id: 'spidocode-0',
name: 'SPIDOCODE 0',
repository: 'SpidoCode/spido-code-0',
cover: '/images/spidocode/spidocode-0-cover.jpg',
description: 'Descubre la lógica de programación con bloques visuales y acertijos junto a Spid.',
executable: 'SpidoCode0.exe',
releases: [{ version: 'v0.1.0-beta', file: 'SPIDOCODE-0-Windows-x64-v0.1.0-beta.zip', bytes: 41261681 }],
},
]

export function releaseLinks(game: DownloadGame, release: PublishedRelease) {
const root = `https://github.com/${game.repository}/releases`
const version = encodeURIComponent(release.version)
return {
notes: `${root}/tag/${version}`,
download: `${root}/download/${version}/${encodeURIComponent(release.file)}`,
}
}
1 change: 1 addition & 0 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
}
],
"rewrites": [
{ "source": "/descargas", "destination": "/index.html" },
{
"source": "/confirmar-recuperacion",
"destination": "/index.html"
Expand Down
Loading