From 1105b7789f6378e83d06bc52f806a010baa616d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Arnulfo=20R=2E=20H=2E?= Date: Tue, 3 Nov 2026 12:26:23 -0500 Subject: [PATCH 1/2] =?UTF-8?q?Agrega=20las=20encuestas=20de=20satisfacci?= =?UTF-8?q?=C3=B3n=20de=20PyCon=20Panam=C3=A1=202026?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tres encuestas anónimas (asistentes, voluntariado y equipo) que se comparten solo por enlace directo: no se enlazan desde el sitio, quedan fuera del sitemap y Netlify las marca con noindex y no-referrer. El envío pasa por la función submit_pycon_2026_encuesta de Supabase. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/site-validation.yml | 1 + 2026/css/encuestas.css | 813 ++++++++++++++++++ 2026/encuestas/asistentes-csgiiz/index.html | 384 +++++++++ 2026/encuestas/equipo-ml38re/index.html | 377 ++++++++ 2026/encuestas/voluntariado-qpntig/index.html | 344 ++++++++ 2026/js/encuestas.js | 144 ++++ netlify.toml | 9 + tests/encuestas-page.cjs | 59 ++ 8 files changed, 2131 insertions(+) create mode 100644 2026/css/encuestas.css create mode 100644 2026/encuestas/asistentes-csgiiz/index.html create mode 100644 2026/encuestas/equipo-ml38re/index.html create mode 100644 2026/encuestas/voluntariado-qpntig/index.html create mode 100644 2026/js/encuestas.js create mode 100644 tests/encuestas-page.cjs diff --git a/.github/workflows/site-validation.yml b/.github/workflows/site-validation.yml index 17c512b..3654c47 100644 --- a/.github/workflows/site-validation.yml +++ b/.github/workflows/site-validation.yml @@ -38,6 +38,7 @@ jobs: node --check 2026/js/convence-a-tu-jefe.js node --check 2026/js/supabase-config.js node --check 2026/js/voluntariado.js + node --check 2026/js/encuestas.js node --check tests/consent-coc.cjs - name: Check consent persistence and Code of Conduct version run: | diff --git a/2026/css/encuestas.css b/2026/css/encuestas.css new file mode 100644 index 0000000..565db4e --- /dev/null +++ b/2026/css/encuestas.css @@ -0,0 +1,813 @@ +/* ========================================================================== + Encuestas de satisfacción · PyCon Panamá 2026 + Una hoja para las tres encuestas. Cada página fija su tema con una clase en + (tema-asistentes, tema-voluntariado, tema-equipo) que redefine las + variables --s-*; el resto de las reglas solo usa esas variables. + Los acentos cumplen contraste AA con texto blanco. + ========================================================================== */ + +/* --- Temas --------------------------------------------------------------- */ + +/* Asistentes: festivo, ámbar y confeti. */ +.tema-asistentes { + --s-accent: #b45309; + --s-accent-hover: #92400e; + --s-soft: #fff1d6; + --s-tint: #fffaf1; + --s-ring: rgba(180, 83, 9, 0.22); + --s-deco-1: var(--highlight); + --s-deco-2: var(--color-orange); + --s-deco-3: var(--color-sky); + --s-hero: linear-gradient(135deg, #fff6d9 0%, #ffe6bf 55%, #e8f3ff 100%); + --s-hero-text: var(--text); + --s-eyebrow-bg: var(--s-accent); + --s-eyebrow-fg: #ffffff; +} + +/* Voluntariado: gratitud, verdes y círculos suaves. */ +.tema-voluntariado { + --s-accent: #0f7a52; + --s-accent-hover: #0b5e3f; + --s-soft: #def5e8; + --s-tint: #f5fcf8; + --s-ring: rgba(15, 122, 82, 0.22); + --s-deco-1: var(--color-lime); + --s-deco-2: var(--color-green); + --s-deco-3: var(--color-cyan-light); + --s-hero: linear-gradient(135deg, #e8faef 0%, #f2ffe1 55%, #e6f6ff 100%); + --s-hero-text: var(--text); + --s-eyebrow-bg: var(--s-accent); + --s-eyebrow-fg: #ffffff; +} + +/* Equipo organizador: retrospectiva, pizarra azul marino y notas adhesivas. */ +.tema-equipo { + --s-accent: #0a3d68; + --s-accent-hover: #072c4b; + --s-soft: #e3edf7; + --s-tint: #f4f8fc; + --s-ring: rgba(10, 61, 104, 0.22); + --s-deco-1: var(--color-sky); + --s-deco-2: var(--highlight); + --s-deco-3: var(--color-lime); + --s-hero: linear-gradient(135deg, #0a3d68 0%, #0d5486 60%, #0e7fb0 100%); + --s-hero-text: #ffffff; + --s-eyebrow-bg: var(--highlight); + --s-eyebrow-fg: var(--color-navy); +} + +/* --- Portada ------------------------------------------------------------- */ + +.survey-hero { + position: relative; + overflow: hidden; + padding-block: clamp(2.5rem, 6vw, 4.5rem); + background: var(--s-hero); + color: var(--s-hero-text); + border-bottom: 1px solid var(--border-soft); +} + +.survey-hero::before { + content: ""; + position: absolute; + inset: 0; + pointer-events: none; +} + +.survey-hero-inner { + position: relative; + z-index: 1; + display: grid; + grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); + align-items: center; + gap: 2rem; +} + +.survey-eyebrow { + display: inline-block; + margin: 0 0 0.9rem; + padding: 0.35rem 0.85rem; + border-radius: var(--radius-pill); + background: var(--s-eyebrow-bg); + color: var(--s-eyebrow-fg); + font-size: var(--fs-xs); + font-weight: 700; + letter-spacing: 0.05em; + text-transform: uppercase; +} + +.survey-hero h1 { + margin: 0 0 0.75rem; + color: inherit; + font-size: clamp(2rem, 3.5vw + 1rem, 3.25rem); + font-weight: 800; +} + +.survey-lead { + max-width: 38rem; + margin: 0 0 1.4rem; + color: inherit; + font-size: var(--fs-md); + opacity: 0.92; +} + +.survey-meta { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + margin: 0; + padding: 0; + list-style: none; +} + +.survey-meta li { + display: inline-flex; + align-items: center; + gap: 0.45rem; + padding: 0.4rem 0.85rem; + border: 1px solid var(--border-soft); + border-radius: var(--radius-pill); + background: rgba(255, 255, 255, 0.8); + color: var(--text); + font-size: var(--fs-sm); + font-weight: 600; +} + +.survey-meta i { color: var(--s-accent); } + +.survey-hero-art { + position: relative; + display: grid; + place-items: center; + min-height: 240px; +} + +.survey-hero-art::before, +.survey-hero-art::after { + content: ""; + position: absolute; +} + +.hero-badge { + position: relative; + z-index: 1; + display: grid; + place-items: center; + width: clamp(7rem, 13vw, 9.5rem); + aspect-ratio: 1; + border-radius: 32%; + background: var(--s-accent); + color: #ffffff; + font-size: clamp(3rem, 5.5vw, 4.25rem); + box-shadow: var(--shadow-lg); +} + +/* Asistentes: confeti, boleto inclinado y órbita punteada. */ +.tema-asistentes .survey-hero::before { + background-image: + radial-gradient(circle, var(--s-deco-1) 0 5px, transparent 6px), + radial-gradient(circle, var(--s-deco-2) 0 4px, transparent 5px), + radial-gradient(circle, var(--s-deco-3) 0 3px, transparent 4px); + background-size: 150px 120px, 190px 170px, 110px 140px; + background-position: 10px 20px, 70px 90px, 35px 45px; + opacity: 0.5; + mask-image: linear-gradient(90deg, transparent 0%, #000 60%); +} + +.tema-asistentes .hero-badge { transform: rotate(-10deg); } + +.tema-asistentes .survey-hero-art::before { + width: 14.5rem; + aspect-ratio: 1; + border: 3px dashed var(--s-deco-2); + border-radius: 50%; + opacity: 0.7; +} + +.tema-asistentes .survey-hero-art::after { + top: 12%; + right: 16%; + width: 1.6rem; + aspect-ratio: 1; + border-radius: 50%; + background: var(--s-deco-1); + box-shadow: -11rem 8rem 0 -0.3rem var(--s-deco-3); +} + +/* Voluntariado: anillos concéntricos y manchas de luz. */ +.tema-voluntariado .survey-hero::before { + background: + radial-gradient(circle at 88% 15%, rgba(130, 217, 63, 0.35), transparent 38%), + radial-gradient(circle at 8% 95%, rgba(150, 230, 246, 0.5), transparent 32%); +} + +.tema-voluntariado .hero-badge { border-radius: 50%; } + +.tema-voluntariado .survey-hero-art::before { + width: 16rem; + aspect-ratio: 1; + border-radius: 50%; + background: radial-gradient(circle, + transparent 0 44%, + rgba(130, 217, 63, 0.3) 44% 56%, + transparent 56% 68%, + rgba(23, 166, 115, 0.16) 68% 80%, + transparent 80%); +} + +.tema-voluntariado .survey-hero-art::after { + top: 14%; + right: 20%; + width: 2.2rem; + aspect-ratio: 1; + border-radius: 50%; + background: var(--s-deco-1); + box-shadow: -10rem 9rem 0 -0.5rem var(--s-deco-2); +} + +/* Equipo: cuadrícula de pizarra y notas adhesivas. */ +.tema-equipo .survey-hero { border-bottom: 0; } + +.tema-equipo .survey-hero::before { + background-image: + linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px), + linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px); + background-size: 28px 28px; +} + +.tema-equipo .survey-meta li { + border-color: rgba(255, 255, 255, 0.28); + background: rgba(255, 255, 255, 0.12); + color: #ffffff; +} + +.tema-equipo .survey-meta i { color: var(--highlight); } + +.tema-equipo .hero-badge { + border-radius: var(--radius-md); + background: #ffffff; + color: var(--color-navy); + transform: rotate(3deg); +} + +.tema-equipo .survey-hero-art::before, +.tema-equipo .survey-hero-art::after { + width: 5.5rem; + aspect-ratio: 1; + border-radius: 4px; + box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); +} + +.tema-equipo .survey-hero-art::before { + top: 6%; + left: 12%; + background: var(--s-deco-2); + transform: rotate(-12deg); +} + +.tema-equipo .survey-hero-art::after { + right: 10%; + bottom: 4%; + background: var(--s-deco-3); + transform: rotate(9deg); +} + +/* --- Panel y avance ------------------------------------------------------ */ + +.survey-body { + padding-block: clamp(2rem, 5vw, 3.5rem); + background: var(--s-tint); +} + +.survey-panel { + max-width: 880px; + margin: 0 auto; + padding: clamp(1.25rem, 3.5vw, 2.5rem); + border: 1px solid var(--border-soft); + border-top: 6px solid var(--s-accent); + border-radius: var(--radius-lg); + background: var(--surface); + box-shadow: var(--shadow-md); +} + +.survey-intro, +.survey-sent-note { + display: flex; + align-items: flex-start; + gap: 0.75rem; + margin: 0 0 1rem; + padding: 0.9rem 1rem; + border-radius: var(--radius-md); + background: var(--s-soft); + color: var(--text); + font-size: var(--fs-sm); +} + +.survey-intro i, +.survey-sent-note i { margin-top: 0.2rem; color: var(--s-accent); } + +.survey-sent-note { background: var(--color-cream); } + +.survey-progress { + position: sticky; + top: calc(var(--header-h) + 0.5rem); + z-index: 5; + display: flex; + align-items: center; + gap: 1rem; + margin: 0 0 2rem; + padding: 0.7rem 1.1rem; + border: 1px solid var(--border-soft); + border-radius: var(--radius-pill); + background: rgba(255, 255, 255, 0.94); + backdrop-filter: blur(8px); + box-shadow: var(--shadow-sm); +} + +.survey-progress-text { + min-width: 10.5rem; + color: var(--s-accent); + font-size: var(--fs-sm); + font-weight: 700; + white-space: nowrap; +} + +.survey-progress progress { + flex: 1; + height: 0.6rem; + border: 0; + border-radius: var(--radius-pill); + background: var(--s-soft); + overflow: hidden; + appearance: none; +} + +.survey-progress progress::-webkit-progress-bar { background: var(--s-soft); border-radius: var(--radius-pill); } +.survey-progress progress::-webkit-progress-value { background: var(--s-accent); border-radius: var(--radius-pill); transition: width 0.3s ease; } +.survey-progress progress::-moz-progress-bar { background: var(--s-accent); border-radius: var(--radius-pill); } + +/* --- Secciones ----------------------------------------------------------- */ + +.survey-form { display: grid; gap: 3rem; } + +.survey-block { display: grid; gap: 2rem; } + +.block-head { + display: flex; + align-items: center; + gap: 1rem; + padding-bottom: 1rem; + border-bottom: 2px solid var(--s-soft); +} + +.block-num { + display: grid; + flex: none; + place-items: center; + width: 3rem; + height: 3rem; + border-radius: 50%; + background: var(--s-accent); + color: #ffffff; + font-size: var(--fs-lg); + font-weight: 800; +} + +.tema-asistentes .block-num { border-radius: 30%; transform: rotate(-8deg); } +.tema-equipo .block-num { border-radius: var(--radius-sm); } + +.block-step { + margin: 0; + color: var(--s-accent); + font-size: var(--fs-xs); + font-weight: 700; + letter-spacing: 0.06em; + text-transform: uppercase; +} + +.block-head h2 { + margin: 0; + color: var(--text); + font-size: clamp(1.35rem, 1vw + 1.1rem, 1.6rem); +} + +.block-sub { margin: 0.15rem 0 0; color: var(--text-secondary); font-size: var(--fs-sm); } + +/* --- Preguntas ----------------------------------------------------------- */ + +.survey-question { + display: grid; + gap: 0.75rem; + min-width: 0; + margin: 0; + padding: 0; + border: 0; +} + +/* Una leyenda flotante deja de dibujarse sobre el borde del fieldset y pasa a + ser un elemento más de la cuadrícula. */ +.survey-question > legend { + float: left; + width: 100%; + padding: 0; +} + +.survey-question > legend, +.survey-question.field > label, +.grid-title { + margin: 0; + color: var(--text); + font-size: var(--fs-base); + font-weight: 700; +} + +.legend-hint { + display: block; + margin-top: 0.2rem; + color: var(--text-secondary); + font-size: var(--fs-xs); + font-weight: 500; +} + +.req { + margin-left: 0.15rem; + color: var(--s-accent); + font-weight: 800; + text-decoration: none; + cursor: help; +} + +.survey-question--featured { + padding: clamp(1rem, 2.5vw, 1.5rem); + border: 1px solid var(--s-soft); + border-radius: var(--radius-md); + background: var(--s-tint); +} + +/* Opciones como tarjetas: zona táctil amplia y estado marcado evidente. */ +.choices { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); + gap: 0.6rem; +} + +.choice { + display: flex; + align-items: center; + gap: 0.7rem; + padding: 0.75rem 1rem; + border: 1.5px solid var(--border); + border-radius: var(--radius-md); + background: var(--surface); + color: var(--text); + cursor: pointer; + transition: border-color var(--transition), background-color var(--transition); +} + +.choice:hover { border-color: var(--s-accent); } + +.choice input { + flex: none; + width: 1.15rem; + height: 1.15rem; + margin: 0; + accent-color: var(--s-accent); +} + +.choice:has(input:checked) { + border-color: var(--s-accent); + background: var(--s-soft); + box-shadow: inset 0 0 0 1px var(--s-accent); + font-weight: 700; +} + +.choice:has(input:focus-visible) { outline: 3px solid var(--s-ring); outline-offset: 2px; } + +.survey-callout { + display: flex; + align-items: flex-start; + gap: 0.6rem; + margin: 0; + padding: 0.75rem 1rem; + border-left: 4px solid var(--s-accent); + border-radius: 0 var(--radius-sm) var(--radius-sm) 0; + background: var(--s-tint); + color: var(--text-secondary); + font-size: var(--fs-sm); +} + +.survey-callout i { margin-top: 0.2rem; color: var(--s-accent); } + +/* Satisfacción general: escala de caras con texto visible en cada opción. */ +.faces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem; } + +.face { position: relative; display: grid; } + +.face input { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + margin: 0; + opacity: 0; + cursor: pointer; +} + +.face-card { + display: grid; + justify-items: center; + gap: 0.45rem; + padding: 0.95rem 0.35rem; + border: 1.5px solid var(--border); + border-radius: var(--radius-md); + background: var(--surface); + color: var(--text-secondary); + font-size: var(--fs-xs); + font-weight: 600; + text-align: center; + transition: border-color var(--transition), background-color var(--transition); +} + +.face-card i { + color: #b8c2d1; + font-size: clamp(1.75rem, 4vw, 2.4rem); + transition: color var(--transition), transform var(--transition); +} + +.face:hover .face-card { border-color: var(--s-accent); } + +.face input:checked + .face-card { + border-color: var(--s-accent); + background: var(--s-soft); + box-shadow: inset 0 0 0 1px var(--s-accent); + color: var(--text); +} + +.face input:checked + .face-card i { color: var(--s-accent); transform: scale(1.12); } +.face input:focus-visible + .face-card { outline: 3px solid var(--s-ring); outline-offset: 2px; } + +/* Escalas numéricas (0–10 y cuadrícula 1–5). El 0–10 usa un solo color a + propósito: pintar rojo/verde sesgaría la respuesta. */ +.scale-options { display: flex; flex-wrap: wrap; gap: 0.4rem; } + +.scale-option { position: relative; display: inline-flex; } + +.scale-option input { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + margin: 0; + opacity: 0; + cursor: pointer; +} + +.scale-option > span { + display: inline-flex; + flex: 1; + align-items: center; + justify-content: center; + min-width: 2.75rem; + min-height: 2.75rem; + padding: 0 0.6rem; + border: 1.5px solid var(--border); + border-radius: var(--radius-sm); + background: var(--surface); + color: var(--text); + font-weight: 700; + transition: background-color var(--transition), border-color var(--transition); +} + +.scale-option:hover > span { border-color: var(--s-accent); background: var(--s-tint); } + +.scale-option input:checked + span { + border-color: var(--s-accent); + background: var(--s-accent); + color: #ffffff; +} + +.scale-option input:focus-visible + span { outline: 3px solid var(--s-ring); outline-offset: 2px; } + +.scale-option--na > span { font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; } + +.nps { display: grid; gap: 0.4rem; } + +.scale-options--nps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); } + +.scale-options--nps .scale-option > span { min-width: 0; padding: 0; } + +.scale-ends { + display: flex; + justify-content: space-between; + gap: 1rem; + margin: 0; + color: var(--text-secondary); + font-size: var(--fs-xs); +} + +/* Cuadrícula de aspectos: etiqueta a la izquierda y escala a la derecha. */ +.survey-grid { + gap: 0; + padding: clamp(1rem, 2.5vw, 1.5rem); + border: 1px solid var(--border-soft); + border-radius: var(--radius-md); +} + +.survey-grid > .legend-hint { margin: 0.2rem 0 0.6rem; } + +.survey-row { + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + align-items: center; + gap: 0.75rem; + min-width: 0; + margin: 0; + padding: 0.65rem 0; + border: 0; + border-top: 1px dashed var(--border); +} + +.survey-row legend { + float: left; + padding: 0; + color: var(--text); + font-size: var(--fs-sm); + font-weight: 600; +} + +/* Ancho fijo: los números quedan alineados en todas las filas, tengan o no + «No aplica» al final. */ +.scale-options--compact { flex-wrap: nowrap; width: 20.5rem; } +.scale-options--compact .scale-option > span { min-width: 2.5rem; min-height: 2.5rem; } + +/* Campos abiertos */ +.field textarea { + width: 100%; + min-height: 7rem; + padding: 0.85rem 1rem; + border: 1.5px solid var(--border); + border-radius: var(--radius-md); + background: #ffffff; + color: var(--text); + font: inherit; + resize: vertical; +} + +.field textarea::placeholder { color: #8a94a6; } + +.field textarea:focus { + border-color: var(--s-accent); + outline: 3px solid var(--s-ring); + outline-offset: 0; +} + +/* Retrospectiva del equipo: tres notas Empezar / Dejar / Seguir. */ +.retro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } + +.retro-card { + align-content: start; + padding: 1rem; + border: 1px solid var(--border-soft); + border-top: 6px solid var(--retro-color); + border-radius: var(--radius-md); + background: var(--retro-bg); + box-shadow: var(--shadow-sm); +} + +.retro-card--empezar { --retro-color: #0f7a52; --retro-bg: #f0fbf5; } +.retro-card--dejar { --retro-color: #b42318; --retro-bg: #fff4f1; } +.retro-card--seguir { --retro-color: #1e49e2; --retro-bg: #eff4ff; } + +.retro-tag { + display: inline-flex; + align-items: center; + gap: 0.4rem; + padding: 0.25rem 0.7rem; + border-radius: var(--radius-pill); + background: var(--retro-color); + color: #ffffff; + font-size: var(--fs-xs); + font-weight: 800; + letter-spacing: 0.05em; + text-transform: uppercase; +} + +.retro-q { display: block; margin-top: 0.55rem; } + +.retro-card textarea { min-height: 8.5rem; background: rgba(255, 255, 255, 0.85); } + +/* --- Envío y agradecimiento --------------------------------------------- */ + +.survey-submit { + display: grid; + justify-items: center; + gap: 0.75rem; + padding-top: 2rem; + border-top: 2px solid var(--s-soft); +} + +.btn-survey { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.6rem; + padding: 0.95rem 2.1rem; + border: 0; + border-radius: var(--radius-pill); + background: var(--s-accent); + color: #ffffff; + font: inherit; + font-size: var(--fs-md); + font-weight: 700; + text-decoration: none; + cursor: pointer; + box-shadow: 0 10px 24px var(--s-ring); + transition: background-color var(--transition), transform var(--transition); +} + +.btn-survey:hover { background: var(--s-accent-hover); color: #ffffff; transform: translateY(-1px); } +.btn-survey:focus-visible { outline: 3px solid var(--s-ring); outline-offset: 3px; } +.btn-survey:disabled { cursor: progress; opacity: 0.7; transform: none; } + +.btn-survey--ghost { background: transparent; color: var(--s-accent); box-shadow: inset 0 0 0 2px var(--s-accent); } +.btn-survey--ghost:hover { background: var(--s-soft); color: var(--s-accent); } + +.status-message { min-height: 1.5rem; margin: 0; color: var(--s-accent); font-weight: 600; text-align: center; } +.status-message.error { color: #b42318; } + +.survey-thanks { + display: grid; + justify-items: center; + gap: 0.6rem; + padding: 2rem 0 1rem; + text-align: center; +} + +.survey-thanks:focus { outline: none; } + +.thanks-icon { + display: grid; + place-items: center; + width: 6rem; + height: 6rem; + border-radius: 50%; + background: var(--s-soft); + color: var(--s-accent); + font-size: 2.75rem; + animation: encuesta-pop 0.5s ease-out; +} + +.survey-thanks h2 { margin: 0.5rem 0 0; color: var(--text); font-size: clamp(1.5rem, 2vw + 1rem, 2rem); } +.survey-thanks p { max-width: 34rem; margin: 0; color: var(--text-secondary); } +.thanks-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1rem; } + +@keyframes encuesta-pop { + from { opacity: 0; transform: scale(0.6); } + to { opacity: 1; transform: scale(1); } +} + +@media (prefers-reduced-motion: reduce) { + .thanks-icon { animation: none; } + .btn-survey:hover, + .face input:checked + .face-card i { transform: none; } +} + +/* --- Pantallas medianas y pequeñas -------------------------------------- */ + +@media (max-width: 860px) { + .survey-hero-inner { grid-template-columns: 1fr; gap: 1.25rem; } + .survey-hero-art { order: -1; min-height: 0; justify-items: start; } + .survey-hero-art::before, + .survey-hero-art::after { display: none; } + .hero-badge { width: 4.5rem; font-size: 2rem; } + .retro-grid { grid-template-columns: 1fr; } +} + +@media (max-width: 720px) { + .survey-row { grid-template-columns: 1fr; gap: 0.5rem; } + .survey-row legend { float: none; } + .scale-options--compact { flex-wrap: wrap; width: auto; } +} + +@media (max-width: 560px) { + .eyebrow-event { display: none; } + .survey-panel { padding: 1rem; } + .survey-question--featured, + .survey-grid { padding: 0.9rem; } + .scale-options--nps { grid-template-columns: repeat(6, minmax(0, 1fr)); } + /* Cinco caras no caben con su texto: pasan a una lista vertical, de la peor + (arriba) a la mejor (abajo). */ + .faces { grid-template-columns: 1fr; gap: 0.45rem; } + .face-card { + grid-auto-flow: column; + justify-content: start; + align-items: center; + gap: 0.85rem; + padding: 0.6rem 1rem; + font-size: var(--fs-sm); + text-align: left; + } + .face-card i { font-size: 1.6rem; } + .survey-progress { border-radius: var(--radius-md); gap: 0.75rem; } + .survey-progress-text { min-width: 0; font-size: var(--fs-xs); } +} diff --git a/2026/encuestas/asistentes-csgiiz/index.html b/2026/encuestas/asistentes-csgiiz/index.html new file mode 100644 index 0000000..fd036ed --- /dev/null +++ b/2026/encuestas/asistentes-csgiiz/index.html @@ -0,0 +1,384 @@ + + + + + + + Encuesta de asistentes - PyCon Panamá 2026 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Encuesta de asistentes · PyCon Panamá 2026

+

¿Cómo te fue en PyCon Panamá 2026?

+

Gracias por acompañarnos el 22 y 23 de octubre. Con tus respuestas preparamos una mejor edición.

+
    +
  • 4 minutos
  • +
  • Hasta el 30 de noviembre
  • +
  • Anónima
  • +
  • 3 obligatorias
  • +
+
+ +
+
+ +
+
+
+

No pedimos tu nombre ni tu correo; por favor no escribas datos personales en las respuestas abiertas. Solo las preguntas con * son obligatorias.

+ + + +
+ Empieza cuando quieras + +
+ +
+
+
+ +
+

Parte 1 de 3

+

Tu participación

+

Para saber quién nos responde.

+
+
+
+ ¿Cómo participaste? * Puedes marcar varias. +
+ + + +
+
+
+ ¿Qué describe mejor tu perfil? +
+ + + + + + +
+
+
+ ¿Cuánta experiencia tienes con Python? +
+ + + + +
+
+
+ ¿Fue tu primera PyCon? +
+ + +
+
+
+ ¿Cómo te enteraste del evento? Puedes marcar varias. +
+ + + + + + +
+
+
+
+
+ +
+

Parte 2 de 3

+

Tu experiencia

+

Lo que funcionó y lo que no.

+
+
+ +
+

Califica cada aspecto

+

1 = muy deficiente · 5 = excelente. Deja en blanco lo que no quieras calificar.

+
+ Calidad de las charlas +
+ + + + + +
+
+
+ Variedad de temas +
+ + + + + +
+
+
+ Organización y puntualidad +
+ + + + + +
+
+
+ Registro y entrada con QR +
+ + + + + + +
+
+
+ Sede: comodidad y acceso +
+ + + + + + +
+
+
+ Accesibilidad +
+ + + + + + +
+
+
+ Transmisión en línea del jueves +
+ + + + + + +
+
+
+ Información antes del evento (correos, redes y sitio web) +
+ + + + + +
+
+
+ Ambiente y oportunidades para conocer gente +
+ + + + + +
+
+
+
+ El nivel técnico de las charlas te pareció… +
+ + + + +
+
+
+ ¿Sentiste un ambiente acogedor, respetuoso y seguro? +
+ + + + +
+

Si viviste o presenciaste algo contrario al Código de Conducta, escríbenos a pyconpanama@gmail.com. Esta encuesta es anónima, así que por aquí no podemos responderte.

+
+
+
+
+ +
+

Parte 3 de 3

+

Lo que viene

+

Ideas para la próxima edición.

+
+
+ +
+ + +
+
+ + +
+
+ + +
+
+ ¿Qué formato prefieres para la próxima edición? +
+ + + + +
+
+
+ ¿Cómo te gustaría participar la próxima vez? Puedes marcar varias. +
+ + + + + +
+
+
+ + +
+
+ +
+ +

+
+
+ + +
+
+
+
+ + + + + + + + + + diff --git a/2026/encuestas/equipo-ml38re/index.html b/2026/encuestas/equipo-ml38re/index.html new file mode 100644 index 0000000..b8f0eb2 --- /dev/null +++ b/2026/encuestas/equipo-ml38re/index.html @@ -0,0 +1,377 @@ + + + + + + + Encuesta del equipo organizador - PyCon Panamá 2026 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Retrospectiva del equipo · PyCon Panamá 2026

+

¿Cómo trabajamos en PyCon Panamá 2026?

+

Organizamos PyCon Panamá 2026 entre todo el equipo. Esta retrospectiva es para revisar cómo trabajamos y decidir qué cambiar en la próxima edición.

+
    +
  • 6 minutos
  • +
  • Hasta el 30 de noviembre
  • +
  • Anónima
  • +
  • 2 obligatorias
  • +
+
+ +
+
+ +
+
+
+

No pedimos tu nombre ni tu correo; por favor no escribas datos personales en las respuestas abiertas. Como somos un equipo pequeño, toda la sección «Tu rol» es opcional: omítela si crees que podría identificarte. Solo las preguntas con * son obligatorias.

+ + + +
+ Empieza cuando quieras + +
+ +
+
+
+ +
+

Parte 1 de 3

+

Tu rol

+

Todo es opcional en esta sección.

+
+
+
+ ¿En qué área trabajaste principalmente? +
+ + + + + + + + +
+
+
+ ¿Era tu primera vez organizando una PyCon? +
+ + +
+
+
+ En las semanas previas al evento, ¿cuántas horas semanales dedicaste en promedio? +
+ + + + +
+
+
+
+
+ +
+

Parte 2 de 3

+

Cómo trabajamos

+

Procesos, herramientas y carga de trabajo.

+
+
+ +
+

Califica cada aspecto

+

1 = muy deficiente · 5 = excelente. Deja en blanco lo que no quieras calificar.

+
+ Claridad de roles y responsabilidades +
+ + + + + +
+
+
+ Comunicación interna +
+ + + + + +
+
+
+ Utilidad de las reuniones de los jueves +
+ + + + + +
+
+
+ Herramientas de trabajo (Slack, Todoist, Drive) +
+ + + + + +
+
+
+ Planificación y plazos +
+ + + + + +
+
+
+ Decisiones claras y a tiempo +
+ + + + + +
+
+
+ Reparto equitativo del trabajo +
+ + + + + +
+
+
+ Apoyo y colaboración en el equipo +
+ + + + + +
+
+
+ Reconocimiento a tu trabajo +
+ + + + + +
+
+
+ Balance con tu vida personal y laboral +
+ + + + + +
+
+
+
+ Tu carga de trabajo te pareció… +
+ + + + +
+
+
+ ¿Cómo terminaste después del evento? +
+ + + +
+
+
+ ¿Sentiste un ambiente respetuoso, seguro y en el que podías opinar con libertad? +
+ + + + +
+

Si viviste o presenciaste algo contrario al Código de Conducta, escríbenos a pyconpanama@gmail.com. Esta encuesta es anónima, así que por aquí no podemos responderte.

+
+
+
+
+ +
+

Parte 3 de 3

+

Retrospectiva

+

Empezar, dejar y seguir: tres preguntas para la próxima edición.

+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+ +
+ ¿Te gustaría seguir en el equipo para la próxima edición? +
+ + + + + +
+
+
+ + +
+
+ +
+ +

+
+
+ + +
+
+
+
+ + + + + + + + + + diff --git a/2026/encuestas/voluntariado-qpntig/index.html b/2026/encuestas/voluntariado-qpntig/index.html new file mode 100644 index 0000000..0e414e3 --- /dev/null +++ b/2026/encuestas/voluntariado-qpntig/index.html @@ -0,0 +1,344 @@ + + + + + + + Encuesta de voluntariado - PyCon Panamá 2026 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Encuesta de voluntariado · PyCon Panamá 2026

+

¿Cómo viviste el voluntariado?

+

PyCon Panamá 2026 fue posible gracias a tu tiempo y tu energía. Cuéntanos cómo lo viviste para cuidar mejor al próximo equipo.

+
    +
  • 4 minutos
  • +
  • Hasta el 30 de noviembre
  • +
  • Anónima
  • +
  • 3 obligatorias
  • +
+
+ +
+
+ +
+
+
+

No pedimos tu nombre ni tu correo; por favor no escribas datos personales en las respuestas abiertas. Solo las preguntas con * son obligatorias.

+ + + +
+ Empieza cuando quieras + +
+ +
+
+
+ +
+

Parte 1 de 3

+

Tu participación

+

Cuándo y en qué apoyaste.

+
+
+
+ ¿Cuándo colaboraste? * Puedes marcar varias. +
+ + + +
+
+
+ ¿En qué áreas apoyaste? Puedes marcar varias. +
+ + + + +
+
+
+ ¿Era tu primera experiencia de voluntariado en un evento? +
+ + +
+
+
+
+
+ +
+

Parte 2 de 3

+

Tu experiencia

+

Cómo te sentiste antes y durante el evento.

+
+
+ +
+

Califica cada aspecto

+

1 = muy deficiente · 5 = excelente. Deja en blanco lo que no quieras calificar.

+
+ Postulación y entrevista +
+ + + + + +
+
+
+ Inducción y preparación antes del evento +
+ + + + + +
+
+
+ Claridad de tus funciones y horarios +
+ + + + + +
+
+
+ Apoyo de la coordinación durante el evento +
+ + + + + +
+
+
+ Materiales y recursos para tu labor +
+ + + + + +
+
+
+ Alimentación, hidratación y descansos +
+ + + + + +
+
+
+ Trato y ambiente con el equipo +
+ + + + + +
+
+
+ Reconocimiento a tu aporte +
+ + + + + +
+
+
+
+ La carga de trabajo te pareció… +
+ + + + +
+
+
+ ¿Sentiste que tenías lo necesario para hacer bien tu labor? +
+ + + +
+
+
+ ¿Sentiste un ambiente acogedor, respetuoso y seguro? +
+ + + + +
+

Si viviste o presenciaste algo contrario al Código de Conducta, escríbenos a pyconpanama@gmail.com. Esta encuesta es anónima, así que por aquí no podemos responderte.

+
+
+
+
+ +
+

Parte 3 de 3

+

Lo que viene

+

Para cuidar mejor al próximo equipo.

+
+
+ +
+ ¿Volverías a sumarte al voluntariado en la próxima edición? +
+ + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +

+
+
+ + +
+
+
+
+ + + + + + + + + + diff --git a/2026/js/encuestas.js b/2026/js/encuestas.js new file mode 100644 index 0000000..36b77b5 --- /dev/null +++ b/2026/js/encuestas.js @@ -0,0 +1,144 @@ +/** + * Encuestas de satisfacción de PyCon Panamá 2026 (asistentes, voluntariado y + * equipo organizador). Un solo script para las tres páginas: cada formulario + * declara su audiencia en data-audiencia. + * + * Las encuestas son anónimas. Las respuestas se envían a la función + * submit_pycon_2026_encuesta de Supabase; la tabla no es accesible desde el + * navegador. Las calificaciones de los aspectos usan el prefijo cal_. + */ +(function () { + 'use strict'; + + const form = document.getElementById('surveyForm'); + if (!form) return; + + const audiencia = form.dataset.audiencia; + const version = form.dataset.version; + const statusMessage = document.getElementById('statusMessage'); + const btnSubmit = document.getElementById('btnSubmit'); + const thanks = document.getElementById('surveyThanks'); + const sentNote = document.getElementById('yaEnviada'); + const storageKey = 'pycon2026-encuesta-' + audiencia; + const btnLabel = btnSubmit.querySelector('span') || btnSubmit; + const submitLabel = btnLabel.textContent; + const progress = document.getElementById('progreso'); + const progressText = document.getElementById('progresoTexto'); + const progressBox = document.getElementById('surveyProgress'); + + // Pasada la fecha de cierre se oculta el formulario. La base rechaza los + // envíos por su cuenta; esto solo evita que alguien responda en vano. + const cierre = Date.parse(form.dataset.cierre || ''); + if (!Number.isNaN(cierre) && Date.now() >= cierre) { + form.hidden = true; + if (progressBox) progressBox.hidden = true; + document.querySelector('.survey-intro').hidden = true; + document.getElementById('encuestaCerrada').hidden = false; + return; + } + + // Avance: cada pregunta, fila de la cuadrícula o campo abierto cuenta como + // una respuesta posible; la cuadrícula completa no cuenta por sí sola. + const questions = Array.from(form.querySelectorAll('.survey-question:not(.survey-grid), .survey-row')); + const isAnswered = q => Boolean(q.querySelector('input:checked')) || + Array.from(q.querySelectorAll('textarea')).some(t => t.value.trim() !== ''); + + function updateProgress() { + if (!progress) return; + const total = questions.length; + const answered = questions.filter(isAnswered).length; + progress.max = total; + progress.value = answered; + progressText.textContent = answered === 0 + ? 'Empieza cuando quieras' + : answered === total ? '¡Todo respondido!' : `${answered} de ${total} respondidas`; + } + + form.addEventListener('change', updateProgress); + form.addEventListener('input', updateProgress); + updateProgress(); + + // Solo es un recordatorio por dispositivo: el almacenamiento puede no existir. + try { + if (localStorage.getItem(storageKey) === '1') sentNote.hidden = false; + } catch (_) { /* sin almacenamiento disponible */ } + + function collect() { + const respuestas = {}; + for (const el of form.elements) { + if (!el.name || el.disabled) continue; + if (el.type === 'radio') { + if (el.checked) respuestas[el.name] = el.value; + } else if (el.type === 'checkbox') { + if (el.checked) (respuestas[el.name] = respuestas[el.name] || []).push(el.value); + } else if (el.value.trim()) { + respuestas[el.name] = el.value.trim(); + } + } + return respuestas; + } + + function showError(message, focusTarget) { + statusMessage.className = 'status-message error'; + statusMessage.textContent = message; + if (focusTarget) { + focusTarget.scrollIntoView({ behavior: 'smooth', block: 'center' }); + const first = focusTarget.querySelector('input'); + if (first) first.focus({ preventScroll: true }); + } + } + + function firstMissing() { + for (const group of form.querySelectorAll('fieldset[data-required-group]')) { + if (!group.querySelector('input:checked')) return group; + } + const invalid = form.querySelector(':invalid'); + return invalid ? invalid.closest('fieldset') || invalid : null; + } + + form.addEventListener('submit', async event => { + event.preventDefault(); + if (btnSubmit.disabled) return; + + const missing = firstMissing(); + if (missing) { + const legend = missing.querySelector(':scope > legend'); + const question = legend ? legend.textContent.replace(/\*.*$/, '').trim() : ''; + showError(question ? 'Falta responder: ' + question : 'Revisa las preguntas obligatorias (*).', missing); + return; + } + + const respuestas = collect(); + const satisfaccion = Number(respuestas.satisfaccion); + const recomendacion = Number(respuestas.recomendacion); + delete respuestas.satisfaccion; + delete respuestas.recomendacion; + + btnSubmit.disabled = true; + btnLabel.textContent = 'Enviando…'; + statusMessage.className = 'status-message'; + statusMessage.textContent = 'Enviando tus respuestas…'; + + try { + await window.PyConSupabase.postToSupabaseRest('rpc/submit_pycon_2026_encuesta', { + p_envio: { audiencia, version, satisfaccion, recomendacion, respuestas } + }); + try { localStorage.setItem(storageKey, '1'); } catch (_) { /* opcional */ } + form.hidden = true; + sentNote.hidden = true; + document.querySelector('.survey-intro').hidden = true; + if (progressBox) progressBox.hidden = true; + thanks.hidden = false; + thanks.focus(); + } catch (error) { + console.error('Error al enviar la encuesta:', error); + // Con código, el servidor la rechazó y no se guardó nada. Sin código no + // sabemos si llegó; como es anónima, un duplicado ocasional es aceptable. + showError(error && error.code + ? 'No pudimos guardar tus respuestas. Revisa el formulario e inténtalo de nuevo.' + : 'No pudimos enviar tus respuestas. Revisa tu conexión e inténtalo de nuevo en unos minutos.'); + btnSubmit.disabled = false; + btnLabel.textContent = submitLabel; + } + }); +})(); diff --git a/netlify.toml b/netlify.toml index 5619a91..470d92e 100644 --- a/netlify.toml +++ b/netlify.toml @@ -87,6 +87,15 @@ for = "/2026/*" [headers.values] Content-Security-Policy = "default-src 'self'; base-uri 'self'; object-src 'none'; script-src 'self' https://cdn.jsdelivr.net; style-src 'self' https://fonts.googleapis.com https://cdnjs.cloudflare.com; font-src 'self' https://fonts.gstatic.com https://cdnjs.cloudflare.com; img-src 'self' data:; connect-src 'self' https://*.supabase.co; frame-src https://www.google.com https://maps.google.com; frame-ancestors 'self'; form-action 'self'" +# Encuestas de satisfacción: solo se comparten por enlace directo. Nada las +# enlaza ni aparecen en el sitemap; esto evita además que se indexen si alguien +# publica el enlace. No se listan en robots.txt para no revelar las rutas. +[[headers]] +for = "/2026/encuestas/*" + [headers.values] + X-Robots-Tag = "noindex, nofollow" + Referrer-Policy = "no-referrer" + # CSS: caché de una semana. [[headers]] for = "/*.css" diff --git a/tests/encuestas-page.cjs b/tests/encuestas-page.cjs new file mode 100644 index 0000000..9b652ad --- /dev/null +++ b/tests/encuestas-page.cjs @@ -0,0 +1,59 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); + +const ENCUESTAS = { + 'asistentes-csgiiz': 'asistentes', + 'voluntariado-qpntig': 'voluntariado', + 'equipo-ml38re': 'equipo' +}; + +function htmlFiles(directory) { + return fs.readdirSync(directory, { withFileTypes: true }).flatMap(entry => { + const file = path.join(directory, entry.name); + return entry.isDirectory() ? htmlFiles(file) : file.endsWith('.html') ? [file] : []; + }); +} + +for (const [slug, audiencia] of Object.entries(ENCUESTAS)) { + const file = `2026/encuestas/${slug}/index.html`; + const page = fs.readFileSync(file, 'utf8'); + + test(`${slug}: no se indexa y usa su URL canónica`, () => { + assert.match(page, //); + assert.match(page, new RegExp(`rel="canonical" href="https://pycon\\.pa/2026/encuestas/${slug}/"`)); + }); + + test(`${slug}: es anónima y envía la audiencia correcta`, () => { + assert.match(page, new RegExp(`id="surveyForm"[^>]+data-audiencia="${audiencia}"`)); + assert.doesNotMatch(page, /name="(?:nombre|email|telefono|correo)"/); + assert.doesNotMatch(page, /type="email"|autocomplete="(?:name|email|tel)"/); + assert.match(page, /input type="radio" name="satisfaccion" value="1" required/); + assert.match(page, /input type="radio" name="recomendacion" value="0" required/); + assert.equal((page.match(/name="recomendacion"/g) || []).length, 11); + assert.match(page, /data-cierre="2026-12-01T00:00:00-05:00"/); + assert.match(page, /id="encuestaCerrada"[^>]*hidden/); + assert.match(page, new RegExp(``)); + assert.match(page, /src="\.\.\/\.\.\/js\/encuestas\.js\?v=\d+"/); + }); + + test(`${slug}: los nombres de campo cumplen la validación del servidor`, () => { + const names = new Set([...page.matchAll(/<(?:input|textarea|select)[^>]*\sname="([^"]+)"/g)].map(m => m[1])); + for (const name of names) assert.match(name, /^[a-z_]{1,40}$/, name); + assert.ok(names.size <= 62); + }); +} + +test('ninguna página pública enlaza las encuestas ni las anuncia', () => { + for (const file of htmlFiles('2026').filter(f => !f.includes(`${path.sep}encuestas${path.sep}`))) { + assert.doesNotMatch(fs.readFileSync(file, 'utf8'), /encuestas\//, file); + } + assert.doesNotMatch(fs.readFileSync('sitemap.xml', 'utf8'), /encuestas/); + assert.doesNotMatch(fs.readFileSync('robots.txt', 'utf8'), /encuestas/); +}); + +test('Netlify marca las encuestas como no indexables', () => { + const config = fs.readFileSync('netlify.toml', 'utf8'); + assert.match(config, /for = "\/2026\/encuestas\/\*"\s*\[headers\.values\]\s*X-Robots-Tag = "noindex, nofollow"/); +}); From 53428d26519bcdf530aa32f2c2de95c3baac55c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Arnulfo=20R=2E=20H=2E?= Date: Tue, 3 Nov 2026 12:57:24 -0500 Subject: [PATCH 2/2] Agrega la encuesta de no asistentes y muestra las encuestas por partes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Nueva encuesta corta para personas registradas que no pudieron asistir, sin satisfacción ni NPS (no vivieron el evento). - Las cuatro encuestas muestran una sección a la vez, con un índice de partes arriba y botones Anterior/Siguiente; no deja avanzar si falta una pregunta obligatoria de la parte actual. Co-Authored-By: Claude Opus 5.5 --- 2026/css/encuestas.css | 111 +++++++++- .../encuestas/no-asistentes-msphsx/index.html | 209 ++++++++++++++++++ 2026/js/encuestas.js | 142 +++++++++++- tests/encuestas-page.cjs | 13 +- 4 files changed, 459 insertions(+), 16 deletions(-) create mode 100644 2026/encuestas/no-asistentes-msphsx/index.html diff --git a/2026/css/encuestas.css b/2026/css/encuestas.css index 565db4e..36ef4dc 100644 --- a/2026/css/encuestas.css +++ b/2026/css/encuestas.css @@ -1,7 +1,7 @@ /* ========================================================================== Encuestas de satisfacción · PyCon Panamá 2026 - Una hoja para las tres encuestas. Cada página fija su tema con una clase en - (tema-asistentes, tema-voluntariado, tema-equipo) que redefine las + Una hoja para las cuatro encuestas. Cada página fija su tema con una clase en + (tema-asistentes, tema-no_asistentes, tema-voluntariado, tema-equipo) que redefine las variables --s-*; el resto de las reglas solo usa esas variables. Los acentos cumplen contraste AA con texto blanco. ========================================================================== */ @@ -24,6 +24,22 @@ --s-eyebrow-fg: #ffffff; } +/* Personas registradas que no asistieron: calma, azul cielo y un camino punteado. */ +.tema-no_asistentes { + --s-accent: #0e6f9c; + --s-accent-hover: #0a5679; + --s-soft: #dcf1fb; + --s-tint: #f4fafd; + --s-ring: rgba(14, 111, 156, 0.22); + --s-deco-1: var(--color-sky); + --s-deco-2: var(--color-cyan-light); + --s-deco-3: var(--highlight); + --s-hero: linear-gradient(135deg, #e6f6ff 0%, #eefbff 55%, #fff8e6 100%); + --s-hero-text: var(--text); + --s-eyebrow-bg: var(--s-accent); + --s-eyebrow-fg: #ffffff; +} + /* Voluntariado: gratitud, verdes y círculos suaves. */ .tema-voluntariado { --s-accent: #0f7a52; @@ -194,6 +210,31 @@ box-shadow: -11rem 8rem 0 -0.3rem var(--s-deco-3); } +/* No asistentes: un camino punteado que llega a la insignia. */ +.tema-no_asistentes .survey-hero::before { + background: radial-gradient(circle at 90% 20%, rgba(150, 230, 246, 0.45), transparent 40%); +} + +.tema-no_asistentes .hero-badge { border-radius: var(--radius-md); transform: rotate(-4deg); } + +.tema-no_asistentes .survey-hero-art::before { + width: 15rem; + aspect-ratio: 1; + border: 3px dotted var(--s-deco-1); + border-radius: 50%; + opacity: 0.6; +} + +.tema-no_asistentes .survey-hero-art::after { + top: 14%; + right: 18%; + width: 1.4rem; + aspect-ratio: 1; + border-radius: 50%; + background: var(--s-deco-3); + box-shadow: -10.5rem 8.5rem 0 -0.25rem var(--s-deco-2); +} + /* Voluntariado: anillos concéntricos y manchas de luz. */ .tema-voluntariado .survey-hero::before { background: @@ -732,6 +773,67 @@ .btn-survey--ghost { background: transparent; color: var(--s-accent); box-shadow: inset 0 0 0 2px var(--s-accent); } .btn-survey--ghost:hover { background: var(--s-soft); color: var(--s-accent); } +/* --- Una parte a la vez ------------------------------------------------- */ +/* encuestas.js agrega el índice de partes y los botones Anterior/Siguiente. */ + +.survey-steps { + display: flex; + gap: 0.5rem; + margin: 0; + padding: 0; + list-style: none; + scroll-margin-top: calc(var(--header-h) + 5.5rem); +} + +.survey-steps li { flex: 1 1 0; min-width: 0; } + +.survey-step { + display: flex; + align-items: center; + gap: 0.6rem; + width: 100%; + padding: 0.6rem 0.8rem; + border: 2px solid var(--s-soft); + border-radius: var(--radius-md); + background: #ffffff; + color: var(--text-secondary); + font: inherit; + font-size: var(--fs-sm); + font-weight: 600; + text-align: left; + cursor: pointer; + transition: border-color var(--transition), background-color var(--transition); +} + +.survey-step:not(:disabled):hover { border-color: var(--s-accent); } +.survey-step:focus-visible { outline: 3px solid var(--s-ring); outline-offset: 2px; } +.survey-step:disabled { cursor: default; opacity: 0.55; } + +.survey-step-num { + display: inline-grid; + flex: none; + place-items: center; + width: 1.8rem; + aspect-ratio: 1; + border-radius: 50%; + background: var(--s-soft); + color: var(--s-accent); + font-weight: 800; +} + +.survey-step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + +.is-current .survey-step { border-color: var(--s-accent); background: var(--s-tint); color: var(--text); } +.is-current .survey-step-num, +.is-visited .survey-step-num { background: var(--s-accent); color: #ffffff; } + +.survey-nav { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 0.75rem; +} + .status-message { min-height: 1.5rem; margin: 0; color: var(--s-accent); font-weight: 600; text-align: center; } .status-message.error { color: #b42318; } @@ -790,6 +892,11 @@ } @media (max-width: 560px) { + /* En el celular solo la parte actual muestra su título; las demás, el número. */ + .survey-steps li { flex: 0 0 auto; } + .survey-steps li.is-current { flex: 1 1 auto; } + .survey-steps li:not(.is-current) .survey-step-label { display: none; } + .survey-nav { flex-direction: column-reverse; align-items: stretch; } .eyebrow-event { display: none; } .survey-panel { padding: 1rem; } .survey-question--featured, diff --git a/2026/encuestas/no-asistentes-msphsx/index.html b/2026/encuestas/no-asistentes-msphsx/index.html new file mode 100644 index 0000000..c4eaf30 --- /dev/null +++ b/2026/encuestas/no-asistentes-msphsx/index.html @@ -0,0 +1,209 @@ + + + + + + + Encuesta de personas registradas - PyCon Panamá 2026 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Te extrañamos · PyCon Panamá 2026

+

¿Qué te impidió llegar a PyCon Panamá 2026?

+

Te registraste para el 22 y 23 de octubre y no pudiste acompañarnos. Saber por qué nos ayuda a preparar una edición a la que sí puedas llegar.

+
    +
  • 2 minutos
  • +
  • Hasta el 30 de noviembre
  • +
  • Anónima
  • +
  • 1 obligatorias
  • +
+
+ +
+
+ +
+
+
+

No pedimos tu nombre ni tu correo; por favor no escribas datos personales en las respuestas abiertas. Solo las preguntas con * son obligatorias.

+ + + +
+ Empieza cuando quieras + +
+ +
+
+
+ +
+

Parte 1 de 2

+

Lo que pasó

+

Sin juicios: nos pasa a todos.

+
+
+
+ ¿Qué te impidió asistir? * Puedes marcar varias. +
+ + + + + + + + +
+
+
+ ¿Cuándo supiste que no podrías ir? +
+ + + +
+
+
+ ¿Pudiste seguir algo del evento? +
+ + + +
+
+
+
+
+ +
+

Parte 2 de 2

+

La próxima vez

+

Para que sí puedas llegar.

+
+
+
+ ¿Qué te habría ayudado a ir? Puedes marcar varias. +
+ + + + + + + +
+
+
+ ¿Qué formato prefieres para la próxima edición? +
+ + + + +
+
+
+ ¿Te gustaría asistir a la próxima PyCon Panamá? +
+ + + +
+
+
+ + +
+
+ +
+ +

+
+
+ + +
+
+
+
+ + + + + + + + + + diff --git a/2026/js/encuestas.js b/2026/js/encuestas.js index 36b77b5..bacf533 100644 --- a/2026/js/encuestas.js +++ b/2026/js/encuestas.js @@ -1,6 +1,7 @@ /** - * Encuestas de satisfacción de PyCon Panamá 2026 (asistentes, voluntariado y - * equipo organizador). Un solo script para las tres páginas: cada formulario + * Encuestas de satisfacción de PyCon Panamá 2026 (asistentes, personas + * registradas que no asistieron, voluntariado y equipo organizador). Un solo + * script para las cuatro páginas: cada formulario * declara su audiencia en data-audiencia. * * Las encuestas son anónimas. Las respuestas se envían a la función @@ -88,29 +89,148 @@ } } - function firstMissing() { - for (const group of form.querySelectorAll('fieldset[data-required-group]')) { + // Primera pregunta obligatoria sin responder dentro de scope (el formulario + // completo o una sola parte). + function firstMissing(scope) { + for (const group of scope.querySelectorAll('fieldset[data-required-group]')) { if (!group.querySelector('input:checked')) return group; } - const invalid = form.querySelector(':invalid'); + const invalid = scope.querySelector(':invalid'); return invalid ? invalid.closest('fieldset') || invalid : null; } + function missingMessage(missing) { + const legend = missing.querySelector(':scope > legend'); + const question = legend ? legend.textContent.replace(/\*.*$/, '').trim() : ''; + return question ? 'Falta responder: ' + question : 'Revisa las preguntas obligatorias (*).'; + } + + // --- Una parte a la vez --------------------------------------------------- + // Cada
es un paso. Sin JavaScript se ven + // todas juntas (y tampoco se podría enviar), así que esto solo ordena la + // lectura: arriba un índice de partes y abajo «Anterior» / «Siguiente». + const blocks = Array.from(form.querySelectorAll('.survey-block')); + const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; + const steps = blocks.length > 1 ? buildSteps() : null; + + function makeButton(className, icon, label, iconFirst) { + const btn = document.createElement('button'); + btn.type = 'button'; + btn.className = className; + const i = document.createElement('i'); + i.className = 'fa-solid ' + icon; + i.setAttribute('aria-hidden', 'true'); + const span = document.createElement('span'); + span.textContent = label; + if (iconFirst) btn.append(i, ' ', span); else btn.append(span, ' ', i); + return btn; + } + + function buildSteps() { + const list = document.createElement('ol'); + list.className = 'survey-steps'; + list.setAttribute('aria-label', 'Partes de la encuesta'); + const items = blocks.map((block, n) => { + const title = block.querySelector('h2'); + title.tabIndex = -1; + const li = document.createElement('li'); + const btn = document.createElement('button'); + btn.type = 'button'; + btn.className = 'survey-step'; + const num = document.createElement('span'); + num.className = 'survey-step-num'; + num.setAttribute('aria-hidden', 'true'); + num.textContent = String(n + 1); + const label = document.createElement('span'); + label.className = 'survey-step-label'; + label.textContent = title.textContent; + btn.append(num, label); + btn.setAttribute('aria-label', `Parte ${n + 1} de ${blocks.length}: ${title.textContent}`); + btn.addEventListener('click', () => { + // Hacia atrás siempre; hacia adelante solo si esta parte está completa. + if (n > state.current) { + const missing = firstMissing(blocks[state.current]); + if (missing) { showError(missingMessage(missing), missing); return; } + } + showStep(n, true); + }); + li.append(btn); + list.append(li); + return { li, btn }; + }); + form.insertBefore(list, blocks[0]); + + const nav = document.createElement('div'); + nav.className = 'survey-nav'; + const prev = makeButton('btn-survey btn-survey--ghost', 'fa-arrow-left', 'Anterior', true); + const next = makeButton('btn-survey', 'fa-arrow-right', 'Siguiente', false); + prev.addEventListener('click', () => showStep(state.current - 1, true)); + next.addEventListener('click', goNext); + btnSubmit.before(nav); + nav.append(prev, next, btnSubmit); + + const state = { list, items, prev, next, current: 0, reached: 0 }; + return state; + } + + function showStep(index, moveFocus) { + steps.current = index; + steps.reached = Math.max(steps.reached, index); + const last = index === blocks.length - 1; + blocks.forEach((block, n) => { block.hidden = n !== index; }); + steps.items.forEach(({ li, btn }, n) => { + li.classList.toggle('is-current', n === index); + li.classList.toggle('is-visited', n !== index && n <= steps.reached); + // Se puede saltar a cualquier parte ya vista y a la siguiente (que valida antes). + btn.disabled = n > Math.max(steps.reached, index + 1); + if (n === index) btn.setAttribute('aria-current', 'step'); else btn.removeAttribute('aria-current'); + }); + steps.prev.hidden = index === 0; + steps.next.hidden = last; + btnSubmit.hidden = !last; + statusMessage.className = 'status-message'; + statusMessage.textContent = ''; + if (moveFocus) { + steps.list.scrollIntoView({ behavior: reduceMotion ? 'auto' : 'smooth', block: 'start' }); + blocks[index].querySelector('h2').focus({ preventScroll: true }); + } + } + + function goNext() { + const missing = firstMissing(blocks[steps.current]); + if (missing) { + showError(missingMessage(missing), missing); + return; + } + showStep(steps.current + 1, true); + } + + if (steps) showStep(0, false); + form.addEventListener('submit', async event => { event.preventDefault(); if (btnSubmit.disabled) return; - const missing = firstMissing(); + // Enter en una parte intermedia avanza, no envía. + if (steps && steps.current < blocks.length - 1) { + goNext(); + return; + } + + const missing = firstMissing(form); if (missing) { - const legend = missing.querySelector(':scope > legend'); - const question = legend ? legend.textContent.replace(/\*.*$/, '').trim() : ''; - showError(question ? 'Falta responder: ' + question : 'Revisa las preguntas obligatorias (*).', missing); + if (steps) { + const index = blocks.findIndex(block => block.contains(missing)); + if (index !== -1 && index !== steps.current) showStep(index, false); + } + showError(missingMessage(missing), missing); return; } const respuestas = collect(); - const satisfaccion = Number(respuestas.satisfaccion); - const recomendacion = Number(respuestas.recomendacion); + // La encuesta de no asistentes no tiene estas dos preguntas: van como null. + const satisfaccion = 'satisfaccion' in respuestas ? Number(respuestas.satisfaccion) : null; + const recomendacion = 'recomendacion' in respuestas ? Number(respuestas.recomendacion) : null; delete respuestas.satisfaccion; delete respuestas.recomendacion; diff --git a/tests/encuestas-page.cjs b/tests/encuestas-page.cjs index 9b652ad..c25fe38 100644 --- a/tests/encuestas-page.cjs +++ b/tests/encuestas-page.cjs @@ -5,6 +5,7 @@ const path = require('node:path'); const ENCUESTAS = { 'asistentes-csgiiz': 'asistentes', + 'no-asistentes-msphsx': 'no_asistentes', 'voluntariado-qpntig': 'voluntariado', 'equipo-ml38re': 'equipo' }; @@ -29,9 +30,15 @@ for (const [slug, audiencia] of Object.entries(ENCUESTAS)) { assert.match(page, new RegExp(`id="surveyForm"[^>]+data-audiencia="${audiencia}"`)); assert.doesNotMatch(page, /name="(?:nombre|email|telefono|correo)"/); assert.doesNotMatch(page, /type="email"|autocomplete="(?:name|email|tel)"/); - assert.match(page, /input type="radio" name="satisfaccion" value="1" required/); - assert.match(page, /input type="radio" name="recomendacion" value="0" required/); - assert.equal((page.match(/name="recomendacion"/g) || []).length, 11); + if (audiencia === 'no_asistentes') { + // No vivieron el evento: sin satisfacción ni NPS, y el motivo es obligatorio. + assert.doesNotMatch(page, /name="(?:satisfaccion|recomendacion)"/); + assert.match(page, /id="grupo-motivos" data-required-group/); + } else { + assert.match(page, /input type="radio" name="satisfaccion" value="1" required/); + assert.match(page, /input type="radio" name="recomendacion" value="0" required/); + assert.equal((page.match(/name="recomendacion"/g) || []).length, 11); + } assert.match(page, /data-cierre="2026-12-01T00:00:00-05:00"/); assert.match(page, /id="encuestaCerrada"[^>]*hidden/); assert.match(page, new RegExp(``));