WHEEL CONTROL DESK / STATE MAP
Set entries, then read the wheel’s visible state
This decision board maps the current wheel editor: its entry limits, palette order, spin settings, rotation calculation, history, elimination state, and browser controls.
- 4 localized starting entries
- 2–30 entries · 80 characters
- 8 palettes · speed 1–10 · duration 2–15 s
Entry rail and palette order
At start, the editor creates four localized default entries. A saved pickerWheelOptions value is JSON-parsed only when it is an array with at least two entries; entries require string id and text fields, are limited to 30, and labels are sliced to 80 characters. An older set of exactly four English default labels is replaced with localized labels. This record assigns no recovery outcome to overlong or otherwise invalid stored values.
01 · INPUT — Add, remove, arrange
Adding trims then slices text to 80 characters and stops at 30 entries. Removal stops at two entries. Sort uses text.localeCompare; Shuffle is Fisher–Yates with Math.random() and targetIndex = Math.floor(Math.random() * (index + 1)).
02 · PALETTE — Eight named color sets
The visible themes are vibrant, pastel, sunset, forest, ocean, candy, earth, and neon. Colors repeat cyclically along the current entry order.
03 · CHANGE — Theme remaps visible order
Changing the theme assigns that theme’s colors again by the current entry order. Sorting and shuffling likewise assign colors from that order.
Palette register
A theme changes the segment colors associated with the current sequence; it does not add another entry state.
- vibrant
- pastel
- sunset
- forest
- ocean
- candy
- earth
- neon
Spin calculation board
The wheel needs at least two entries. A spin starts from the current rotation and uses the visible setting values. The editor uses an ease-out cubic motion curve during the calculated duration.
01 · SETTINGS — Speed and duration
spinSpeed begins at 5 and accepts 1–10. spinDuration begins at 5 seconds and accepts 2–15 seconds.
02 · TIME — Duration expression
actualDuration = spinDuration * 1000 / (spinSpeed / 5).
03 · ROTATION — Turn range
Rotations are 5 + spinSpeed through 8 + spinSpeed, using Math.random() between those bounds; total rotation is rotations * 2 * Math.PI.
04 · SEGMENT — Pointer derivation
At the end, normalizedRotation = newRotation % (2 * Math.PI), pointerAngle = (2 * Math.PI - normalizedRotation) % (2 * Math.PI), and the segment index is Math.floor(pointerAngle / anglePerOption).
Result, history, and elimination ledger
When the animation ends, the selected entry label is shown, total spins increments, and the result is inserted at the front of the history. The display retains at most 10 history records.
01 · HISTORY — Front insert, limit 10
The end path uses [newResult, ...previous].slice(0, 10). Each result contains the shown entry text and a timestamp.
02 · ELIMINATION — Copy, then conditional removal
Turning Elimination Mode on copies the current entries. After a result, its entry is removed only when at least two entries remain; otherwise the list is retained.
03 · RESET — Rotation and shown label reset
Reset returns rotation to 0 and clears the shown label. When Elimination Mode is active and original entries exist, Reset restores that copied list.
Stored-key ledger and control scope
The editor writes its displayed state under named localStorage keys. History is written only while nonempty; Clear history empties state and removes its key.
OPTIONS — pickerWheelOptions
Entry state is written as JSON after option changes. The other written preferences are pickerWheelSound, pickerWheelEliminationMode, pickerWheelColorTheme, pickerWheelSpinSpeed, pickerWheelSpinDuration, and pickerWheelTotalSpins.
HISTORY — pickerWheelHistory
A nonempty history is written under pickerWheelHistory. Clear history removes pickerWheelHistory after setting the displayed history to an empty list.
INPUT / VIEW — Keyboard, sound, fullscreen
The button and canvas can start a spin. Enter or Space can do so when the active element is not an INPUT. AudioContext initialization is attempted after the first document click and sound has a toggle. Fullscreen uses a native API when available, otherwise a CSS view fallback, including an iOS detection branch.
Scope notes
- This board describes the current editor paths and formulas, not a selection assessment.
- The selection index is derived from final normalized rotation and segment width under the pointer.
- The editor uses Math.random() in its shuffle and spin paths; this page does not characterize those outcomes.
- Stored values, sound initialization, and fullscreen behavior are described as code paths rather than platform-wide expectations.
Continue with adjacent controls
Each linked tool has its own interface and state path.
- Coin Flip
Open the separate two-sided coin interface.
- Sudoku
Open a grid puzzle with its own board controls.
- Word Puzzle
Open the word-based puzzle interface.
Questions about the wheel control desk
What entries are present at start?
The editor starts with four localized default entries. A saved pickerWheelOptions value is used only after JSON parsing as an array with at least two entries; valid entries need string id and text fields, at most 30 are retained, and labels are sliced to 80 characters.
Which color themes are visible?
The visible theme names are vibrant, pastel, sunset, forest, ocean, candy, earth, and neon. Colors are assigned cyclically by current entry order, including after a theme change.
How are duration and rotation calculated?
spinSpeed is 1–10 and spinDuration is 2–15 seconds. actualDuration = spinDuration * 1000 / (spinSpeed / 5). Rotation uses a value between 5 + spinSpeed and 8 + spinSpeed, then an ease-out cubic curve.
How is the displayed entry derived?
At spin end, the code normalizes rotation with newRotation % (2 * Math.PI), derives pointerAngle as (2 * Math.PI - normalizedRotation) % (2 * Math.PI), then takes Math.floor(pointerAngle / anglePerOption).
What do history and Elimination Mode do?
A result is prepended and history is limited to 10. Enabling Elimination Mode copies current entries; after a result it removes that entry only if at least two entries remain. Reset restores the copied entries when that mode is active.
Which keys are stored?
The editor writes pickerWheelOptions, pickerWheelHistory when history is nonempty, pickerWheelSound, pickerWheelEliminationMode, pickerWheelColorTheme, pickerWheelSpinSpeed, pickerWheelSpinDuration, and pickerWheelTotalSpins. Clear history removes pickerWheelHistory.
Open the wheel controls
Set entries, inspect the palette and settings, then use the visible wheel controls.