sweetbean.stimulus.RichInstructions
Rich, scroll-friendly instruction screens (html-keyboard-response).
SweetBean ships a global div { font-size: 36pt } in main.css. Long
instruction pages must wrap content in a scoped stylesheet or nested divs
inherit that size. This module provides the same pattern as
:class:InformedConsent: a single wrapper (.sweetbean-rich-instructions)
with defensive typography and semantic hooks for your inner HTML.
Inner HTML conventions (all optional — plain <p> / <h3> work too):
<h3 class="sbri-section">…</h3>— section heading (larger than body text).<ul class="sbri-panel-list">…</ul>— inset list / meta panel.<span class="sbri-accent">…</span>— subtle highlight (e.g. percentages).<div class="sbri-example">…</div>— boxed preview block.<div class="sbri-example-prompt">…</div>— prompt line inside the example.<div class="sbri-example-row">…</div>— horizontal row (e.g. two cards).<div class="sbri-example-keys">…</div>— key legend under the example.<p class="sbri-muted">…</p>— secondary note text.<p class="sbri-press">…</p>— footer; used by the default footer whenfooter_htmlis omitted.
Pass arbitrary HTML fragments as inner_html; they are inserted verbatim
(only the document title string is escaped).
RichInstructions
Bases: HtmlKeyboardResponse
Instruction page with readable typography on SweetBean's dark full-screen UI.
Participants press SPACE (by default) to continue. Auto-fit is off by default so long text scrolls naturally.
Source code in sweetbean/stimulus/RichInstructions.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
render_rich_instructions_html(*, title='Instructions', inner_html, footer_html=None, max_width_px=780, body_font_px=13, title_font_px=32, section_font_px=20)
Return a full <style> + wrapper HTML string (for reuse outside the stimulus).
Source code in sweetbean/stimulus/RichInstructions.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |