vUX / Core / v4.1.0
Importing any vUX module puts $$ on window: selection, class and style
chores, slides, flips, tweens, delegated events, a countdown and a handful of built-in extensions.
Wrap an element or a selector, then call one of nineteen manipulators on it. Click the card.
Rotated by the core on the Y axis. The option object is passed on every call.
$$.ss and $$.sa are querySelector and querySelectorAll.
$$.sm wraps an element or a selector: given a selector, hide,
unHide and the class methods act on every match, while
index, cssStyle and class.has read the first.
The active tab gets active and cOff, and being a <button> it is also
disabled: clicking it again does nothing. The parent scopes the clearing; without one,
every element in the document with that class is cleared.
Slides are CSS transitions the core sets up for you: it adds .vSlide, writes a start value,
forces a reflow and writes the end value. In position mode the direction is in the numbers:
toLeft and toRight both move x[0] → x[1].
A right-anchored panel, slid by its right with positionProperty: "right".
right: -260px.toRight opens the width to the content's own width; toLeft takes it back to 0.
After the transition the core hands the height back to CSS, so content that grows later (a late image, a wrapped line on resize) is not clipped at the height measured at open time.
toLeft and toRight fill in defaults for use, positions and dimensions. toTop and toBottom do not: leave use out and they take the position branch with no positions, and throw.
The element and the end size (a number of pixels) once speed milliseconds have passed. It is a timer, not a transitionend listener, so it fires even when nothing actually moved.
A requestAnimationFrame tween that hands each value to your draw(element, value).
value is a change, not a target, and the core remembers where each element
ended, so +300 then −300 brings the ball home.
The seven curves are the core's own timing table, a global. Two
animate() calls on one element run side by side, both writing: wait for one to finish.
Each writes inline styles or classes and leaves the rest to CSS. center* on a positioned element
is 50% plus a translate; on a static one it is auto margins, and the vertical part
adds a resize listener that is never removed.
A gradient layer under the content. The CSS text is attached once under id.
No image, just gradients.
A vertical scroller with its bar hidden. Locking sets overflow-y: hidden.
$$.attachEventHandler(event, classes, fn) puts one listener on window and calls
fn when the event's target carries the class. Tags added later work without
rebinding. "tag, pinned" means tag but not pinned; "keyup:key=Enter"
filters on the event's own properties.
The tag with a bold word inside: click the bold part and nothing
happens: the target is the <b>, which does not carry tag.
The utilities that are not about the DOM at all.
Time left until a moment, broken into parts. null once it has passed.
A getter over innerWidth, banded by your two breakpoints. Resize the window.
From Math.random(): for ids and demo data, not for secrets.
Parallel GETs; fn runs once per response with every body so far and the progress.
The core patches a few built-ins and promotes every helper in src/helpers.js to a global.
Each row below is evaluated live on this page.
Rows in amber are where the result is not what the name suggests: trimChar strips every
occurrence, and has/unique show up in a for…in over any array.
Most utilities check their arguments and throw an Error naming the method and the argument.
Each button makes the call and prints exactly what was thrown.
Each of these calls threw or returned the wrong thing earlier in v4.0.0. The buttons show what
they return now. IO.save downloads a small JSON file.
$$.delay is a synchronous wait by design. Use setTimeout for a timer.