skip to content

Some

Like <blam-blam> but it only affects some of the elements selected using to.

class
Some
extends
Set
tag
<some-blam>
see

Props

name type default description
min number 1

The minimum number of elements to affect.

max number

The maximum number of elements to affect. If not set (null), it is the total number of elements selected with to. There is some special behavior too... If max="1" and robin are in place, both the target to elements and the values (where using |-separated syntax) are cycled through, in order. If the number of to elements and the number of potential values differ, there’s a polymetric effect.

revert boolean false

In the case of <some-blam>, revert reverts all prop values at each event, before setting the value just for some.

ramp number

In beats. Where the prop is an audioParam, whether to ramp the value. For example, for gain, whether to fade/slide between the start and end values.

prop string null

Can be the name of a property (which may map to an audioParam), an attribute, a method/function, or prepend with -- to make it a CSS custom property. If class, the className is removed and reapplied at each event, triggering reflow so that animations (if in place) restart.

value string null

Set-derived elements support special value syntax. Separate with | and one value is chosen at random. You can “prefer” certian values by including them more than once, like 0.1|0.1|0.2. Separate with ~ and a value is chosen within the range [x]~[n]. Separate with (a single space) if you are supplying multiple args to an element’s method.

once boolean false

Whether to only handle the event one time. Interesting, compositionally, when paired with a low chance.

robin boolean false

Only applies when using |-separated value syntax. Whether to cycle from first to last and back again (a “round robin”).

mode string “events”

By default, Set-based elements just listens for events. Use mode="props" to listen for prop changes instead.

for string “blam any”

By default, ListenWatch-based elements listen for blam events and any prop/attribute changes.

from string

A CSS selector representing all elements from which events will be listened to. If not set, the node array defaults to the element’s defaultFrom function’s return value.

to string

A CSS selector representing all elements to affect in response to the event. If not set, the node array defaults to the element’s defaultTo function’s return value.

bypass boolean false

Whether to stop responding to events as they happen.

chance boolean 1

The probability that the event will be responded to. From 0 to 1.

Examples

Examples that use the Some element: