diff --git a/src/PlayerHub.css b/src/PlayerHub.css index 36ad7e8..df5a001 100644 --- a/src/PlayerHub.css +++ b/src/PlayerHub.css @@ -1 +1,15 @@ -.spido-hub{min-height:100vh;background:radial-gradient(ellipse at 75% 3%,#183150,transparent 42%),#070e1c;color:#f1f8f9;font-family:Inter,sans-serif}.spido-hub-container{width:min(1100px,calc(100% - 42px));margin:auto}.spido-hub :is(a,button,input):focus-visible{outline:2px solid #b1f878;outline-offset:4px}.spido-hub-skip{position:absolute;top:-90px;left:12px;background:#b1f878;color:#07111f;padding:12px}.spido-hub-skip:focus{top:10px;z-index:99}.spido-hub-header{border-bottom:1px solid #2e3b4f;background:#081224}.spido-hub-nav{min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:22px}.spido-hub-nav nav{display:flex;gap:20px}.spido-hub-nav nav a{color:#c7d7df;font-size:13px;text-decoration:none}.spido-hub-logo{font:700 27px 'Spido Pixel',monospace;color:#ecffe2;text-shadow:2px 2px #59418b;text-decoration:none}.spido-hub-logo span{color:#b1f878}.spido-hub-main{padding:70px 0 100px}.spido-hub-kicker,.spido-hub-panel small{font:11px 'JetBrains Mono',monospace;color:#b1f878;letter-spacing:.12em}.spido-hub h1{font:700 clamp(2.3rem,5vw,4rem) 'Space Grotesk',sans-serif;line-height:1.15;margin:16px 0}.spido-hub h1 span{color:#b1f878}.spido-hub-lead{max-width:690px;color:#b9c8d8;line-height:1.8;margin-bottom:38px}.spido-hub-panel{background:#0d1c30;border:1px solid #2d4d58;border-radius:11px;padding:27px;margin:22px 0}.spido-hub-panel h2{font:650 24px 'Space Grotesk',sans-serif;margin-top:0}.spido-hub-panel p{color:#bdcad8;line-height:1.7}.spido-hub-auth{max-width:500px}.spido-hub-auth form{display:grid;gap:16px}.spido-hub-auth label{display:grid;gap:8px;font-size:13px;color:#cbd6e4}.spido-hub-auth input{background:#071322;color:#fff;border:1px solid #4b6170;border-radius:5px;padding:13px}.spido-hub button{cursor:pointer;border:1px solid #9ed76d;border-radius:5px;padding:11px 17px;background:#b1f878;color:#07111f;font-weight:700}.spido-hub button:disabled{opacity:.65;cursor:wait}.spido-hub-account{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;background:#102337;border:1px solid #2e4b51;padding:19px;border-radius:10px}.spido-hub-account div{display:grid;gap:6px}.spido-hub-account small,.spido-hub-stats small{font:11px 'JetBrains Mono',monospace;color:#84dece}.spido-hub-account strong{overflow-wrap:anywhere}.spido-hub-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:20px}.spido-hub-stats article{background:#102034;border:1px solid #344d56;border-radius:9px;padding:21px;display:grid;gap:12px}.spido-hub-stats strong{font-size:23px;color:#b1f878;overflow-wrap:anywhere;text-transform:capitalize}.spido-hub-knowledge{display:flex;flex-wrap:wrap;gap:10px}.spido-hub-knowledge a{display:inline-block;padding:10px 14px;background:#143134;border:1px solid #42786f;border-radius:5px;color:#c9fff2;font-size:13px;text-decoration:none}.spido-hub-note{font-size:12px;color:#aabccb;line-height:1.7}.spido-hub-notice{padding:14px;color:#ffcfa2}.spido-hub-footer{border-top:1px solid #2d3a52;padding:28px 0;font:11px 'JetBrains Mono',monospace;color:#b8c7d6}.spido-hub-footer>div{display:flex;justify-content:space-between;gap:14px}.spido-hub-footer a{color:#b1f878}@media(max-width:760px){.spido-hub-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:460px){.spido-hub-nav{flex-wrap:wrap;padding:12px 0}.spido-hub-nav nav{gap:12px}.spido-hub-main{padding:45px 0 60px}.spido-hub-stats{grid-template-columns:1fr}} \ No newline at end of file +.spido-hub{min-height:100vh;background:radial-gradient(ellipse at 75% 3%,#183150,transparent 42%),#070e1c;color:#f1f8f9;font-family:Inter,sans-serif}.spido-hub-container{width:min(1100px,calc(100% - 42px));margin:auto}.spido-hub :is(a,button,input):focus-visible{outline:2px solid #b1f878;outline-offset:4px}.spido-hub-skip{position:absolute;top:-90px;left:12px;background:#b1f878;color:#07111f;padding:12px}.spido-hub-skip:focus{top:10px;z-index:99}.spido-hub-header{border-bottom:1px solid #2e3b4f;background:#081224}.spido-hub-nav{min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:22px}.spido-hub-nav nav{display:flex;gap:20px}.spido-hub-nav nav a{color:#c7d7df;font-size:13px;text-decoration:none}.spido-hub-logo{font:700 27px 'Spido Pixel',monospace;color:#ecffe2;text-shadow:2px 2px #59418b;text-decoration:none}.spido-hub-logo span{color:#b1f878}.spido-hub-main{padding:70px 0 100px}.spido-hub-kicker,.spido-hub-panel small{font:11px 'JetBrains Mono',monospace;color:#b1f878;letter-spacing:.12em}.spido-hub h1{font:700 clamp(2.3rem,5vw,4rem) 'Space Grotesk',sans-serif;line-height:1.15;margin:16px 0}.spido-hub h1 span{color:#b1f878}.spido-hub-lead{max-width:690px;color:#b9c8d8;line-height:1.8;margin-bottom:38px}.spido-hub-panel{background:#0d1c30;border:1px solid #2d4d58;border-radius:11px;padding:27px;margin:22px 0}.spido-hub-panel h2{font:650 24px 'Space Grotesk',sans-serif;margin-top:0}.spido-hub-panel p{color:#bdcad8;line-height:1.7}.spido-hub-auth{max-width:500px}.spido-hub-auth form{display:grid;gap:16px}.spido-hub-auth label{display:grid;gap:8px;font-size:13px;color:#cbd6e4}.spido-hub-auth input{background:#071322;color:#fff;border:1px solid #4b6170;border-radius:5px;padding:13px}.spido-hub button{cursor:pointer;border:1px solid #9ed76d;border-radius:5px;padding:11px 17px;background:#b1f878;color:#07111f;font-weight:700}.spido-hub button:disabled{opacity:.65;cursor:wait}.spido-hub-account{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;background:#102337;border:1px solid #2e4b51;padding:19px;border-radius:10px}.spido-hub-account div{display:grid;gap:6px}.spido-hub-account small,.spido-hub-stats small{font:11px 'JetBrains Mono',monospace;color:#84dece}.spido-hub-account strong{overflow-wrap:anywhere}.spido-hub-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:20px}.spido-hub-stats article{background:#102034;border:1px solid #344d56;border-radius:9px;padding:21px;display:grid;gap:12px}.spido-hub-stats strong{font-size:23px;color:#b1f878;overflow-wrap:anywhere;text-transform:capitalize}.spido-hub-knowledge{display:flex;flex-wrap:wrap;gap:10px}.spido-hub-knowledge a{display:inline-block;padding:10px 14px;background:#143134;border:1px solid #42786f;border-radius:5px;color:#c9fff2;font-size:13px;text-decoration:none}.spido-hub-note{font-size:12px;color:#aabccb;line-height:1.7}.spido-hub-notice{padding:14px;color:#ffcfa2}.spido-hub-footer{border-top:1px solid #2d3a52;padding:28px 0;font:11px 'JetBrains Mono',monospace;color:#b8c7d6}.spido-hub-footer>div{display:flex;justify-content:space-between;gap:14px}.spido-hub-footer a{color:#b1f878}@media(max-width:760px){.spido-hub-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:460px){.spido-hub-nav{flex-wrap:wrap;padding:12px 0}.spido-hub-nav nav{gap:12px}.spido-hub-main{padding:45px 0 60px}.spido-hub-stats{grid-template-columns:1fr}} +/* Códice conectado; lo bloqueado no revela contenido de progreso no alcanzado. */ +.spido-hub-codex-heading{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:14px} +.spido-hub-codex-heading h2{margin:8px 0 10px} +.spido-hub-codex-total{font:12px 'JetBrains Mono',monospace;color:#b1f878} +.spido-hub-codex-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin-top:23px} +.spido-hub-codex-card{display:flex;flex-direction:column;align-items:flex-start;gap:11px;padding:20px;border:1px solid #38665c;border-radius:8px;background:#0b2430} +.spido-hub-codex-card>span{color:#91e4d5;font:11px 'JetBrains Mono',monospace} +.spido-hub-codex-card h3{font:650 20px 'Space Grotesk',sans-serif;margin:0} +.spido-hub-codex-card p{font-size:13px;color:#c4d1de;line-height:1.6;margin:0 0 9px} +.spido-hub-codex-card a{margin-top:auto;color:#b1f878;font-weight:600;font-size:13px} +.spido-hub-codex-card.is-locked{border-color:#344154;background:#0b1728} +.spido-hub-codex-card.is-locked>span{color:#abb7c8} +.spido-hub-codex-card.is-locked h3{color:#c5d0dc} +@media(max-width:620px){.spido-hub-codex-grid{grid-template-columns:1fr}} diff --git a/src/PlayerHub.tsx b/src/PlayerHub.tsx index c573594..bf77a09 100644 --- a/src/PlayerHub.tsx +++ b/src/PlayerHub.tsx @@ -1,6 +1,7 @@ import { useEffect, useState, type FormEvent } from 'react' import type { User } from '@supabase/supabase-js' import { supabase } from './lib/supabase' +import { learningGuides } from './docs/learningGuides' import './PlayerHub.css' type Progress = { @@ -118,9 +119,25 @@ export default function PlayerHub() {
NIVEL DEL MAPA{progress.map_tier ?? 'Sin datos'}
CONOCIMIENTOS{safeList(progress.unlocked_knowledge).length}
-
-

Conocimientos desbloqueados

-
{safeList(progress.unlocked_knowledge).length ? safeList(progress.unlocked_knowledge).map((id) => {readable(id)} ↗) :

Sin conocimientos registrados.

}
+
+
+

ARCHIVO A.D.A. // SINCRONIZADO

Tu Códice de programación

+ {learningGuides.filter((guide) => safeList(progress.unlocked_knowledge).includes(guide.id)).length} / {learningGuides.length} guías disponibles +
+

Los conocimientos desbloqueados se leen de tu partida. Puedes estudiar sus guías sin modificar el progreso del juego.

+
+ {learningGuides.map((guide) => { + const unlocked = safeList(progress.unlocked_knowledge).includes(guide.id) + return
+ {guide.group} · {unlocked ? 'Desbloqueado' : 'Pendiente en el juego'} +

{guide.title}

+

{unlocked ? guide.summary : 'Continúa avanzando en SpidoCode para desbloquear este conocimiento.'}

+ {unlocked && Estudiar con A.D.A. ↗} +
+ })} +
+ {safeList(progress.unlocked_knowledge).some((id) => !learningGuides.some((guide) => guide.id === id)) && +

Otros conocimientos registrados: {safeList(progress.unlocked_knowledge).filter((id) => !learningGuides.some((guide) => guide.id === id)).map(readable).join(', ')}. Todavía no tienen guía web publicada.

}

Última sincronización registrada: {progress.updated_at ? new Date(progress.updated_at).toLocaleString('es-CL') : 'Sin datos'}. Solo lectura.

}