--- /* One question, one artboard: the shape screens 03 onward all share. A screen that only remaps artboard slots needs nothing of its own here, so it arrives as data and its design lives in its own stylesheet. */ import Artboard from './Artboard.astro'; import { SURFACE_ANSWERS, surfacesAsked, surfaceTabsAttrs } from '../data/surfaces.js'; interface Option { value: string; title: string; desc: string; /* The sentence that stands in for the description on a surface this option does not suit. Present only on options some surface rules out. */ blocked?: string; } /* A screen whose answer reads differently on each surface draws a board per surface instead of repainting one, the arrangement the font screen already uses. `class` is the modifier that board's own scene keys on. */ interface Board { surface: 'persuade' | 'operate' | 'read' | 'experience'; class?: string; } interface Props { id: string; step: string; slug: string; name: string; title: string; legend: string; cta: string; options: Option[]; previewClass: string; phone?: boolean; boards?: Board[]; } const { id, step, slug, name, title, legend, cta, options, previewClass, phone = true, boards } = Astro.props; const titleId = `picker-${slug}-title`; const artboardClass = phone ? previewClass : `${previewClass} picker-artboard--solo`; // A question listed in the matrix is answered once per chosen surface, which // buys it a tab strip on the frame and a field per surface to answer into. // Everything else about the screen is unchanged by opting in. const perSurface = SURFACE_ANSWERS[name]; // Only the surfaces the question is put to. A surface with no field here is a // surface that was never asked, and that absence is the whole of how the script // and the final document know it. const asked = perSurface ? surfacesAsked(name) : []; const tabsAttrs = perSurface ? surfaceTabsAttrs(name) : null; ---