Skip to content

Added a custom theme editor to the demo page - #4

Merged
saifulapm merged 2 commits into
rexa-developer:mainfrom
kyfex-uwu:main
Sep 6, 2026
Merged

saifulapm merged 2 commits into
rexa-developer:mainfrom
kyfex-uwu:main

Conversation

@kyfex-uwu

Copy link
Copy Markdown

No description provided.

kyfex-uwu and others added 2 commits September 5, 2026 13:04
The random starting values were written as their own set of literals,
separate from propertyRanges, and the two drifted apart: five of the six
sliders could open outside their own min/max. The browser clamps the
thumb but not the theme, so the slider showed one value while the sound
used another — 10 of 12 fresh opens had at least one desynced control.
Seed from propertyRanges instead, snapped to the slider's step, so the
two can't disagree.

Also stop feeding non-numbers to Web Audio. `parseFloat(value) || value`
put "" or "abc" straight into the theme when a number box was cleared or
given text, and the next sound threw out of the generator:

  baseFreq ""    -> RangeError: exponentialRampToValueAtTime target (0)
  attack   "abc" -> TypeError: linearRampToValueAtTime non-finite

The boxes are now type=number and updateTheme ignores anything
non-finite, normalizing on blur. Edits no longer write back to the
control being edited, so typing a multi-digit value isn't clobbered.

Smaller fixes alongside: give the theme a `name` (TiksTheme requires it,
and the demo is the example people copy); associate every label with its
control; scope the preset handler to `.theme-btn[data-theme]` so it stops
clearing the editor's own buttons.
@saifulapm
saifulapm merged commit 33e3861 into rexa-developer:main Sep 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants