Field type
triggers
What a Layout's boxes do as the page scrolls, written as a small script: a box that stays on the screen, a slider that changes with the words being read, boxes that fade, move, scale, rotate or blur. A line each, in CSS's own words. The page plays it with one small script; with none, or for a visitor who asks for less motion, the page is finished and still.
Type: triggers · Stored attribute type: string
Stored value
string — the script as written, a statement a line (or between ;); a note is after //
Supports
- A box by name, as CSS names it —
#photosthe element with that id (a Box's Name),.stepevery element with that class (a Box's "Additional CSS class"),allevery box of the Layout. Anything inside a box with an id or a class is named the same way. - A CSS property, a box,
fromortoa CSS value —opacity #a from 0·scale #a to 1.2·translate #a from 0 10vh(px, % of the box itself, vh, vw) ·rotate #a from -8deg·blur #a from 12px.to: it ends there.from: it starts there and ends as it was drawn. - Short words —
show #a·hide #a·move #a from down 0.1(a share of the screen) ·pulse #a. - When, a moment —
when #b enters(its top at the foot of the screen) ·arrives(its top at the middle) ·leaves(its foot off the top) ·when #b[50%](that far through its pass). The change eases in. - While, a stretch that follows the scroll forwards and back —
while #b enters·passes·leaves·while #b[0%-35%](that part of its pass: 0% its top at the foot of the screen, 100% its foot at the top). - Nothing after it — when the box itself enters. A line on many boxes that waits on those same boxes (
opacity .step from 0 while .step[0%-35%]) has each wait on itself. gather .pic— rows, in reading order. As written the page is already right: words, their picture in the box beside them (class pic), the next words, their picture; that is what a phone and a page with no script show. On a wide screen the .pic boxes gather in the first one's place, which stays on the screen while their rows pass, each shown while its own row is the one being read. Reorder the rows and nothing goes out of step.tilt #card— the box leans toward the pointer in 3D, up to 12deg each way, or as far as is said (tilt #card 20deg, 1deg to 30deg). What is inside it with a depth (the layers field) stands off it and slides against the rest as it turns. Flat on a touch screen. The one statement that follows the pointer, not the scroll.stack .card— a stack of cards: each .card stays near the top of the screen as the page scrolls and the next one slides over it. What a covered card does is a line beside it:scale .card to 0.92 while .card leaves. As written the cards are one under another.carry #film to #screen— one box into another's place: #film travels from its own place to #screen's place and size as the page scrolls (by default from when #screen comes onto the screen until it is in the middle of it,while #screen[0%-50%], so it ends in full view; any other stretch can be said).carry #film from #smallis the other way round: it starts in #small's place and ends as it was drawn, so the page as written shows it at full size. Both boxes by id, the same shape; wide screens only.hold #photos— the box stays in the middle of the screen while the rest of its row scrolls past (wide screens).- A slider — a Carousel block in a box, named by the box.
cycle #photos with .step: a slide for each box, as each is read.cycle #photos while #steps passes: through its slides, spread evenly over that stretch;cycle #photos 2-4for some of them. - Checked as written — the field shows what is wrong as sentences, the
gcblite/check-triggersability returns the same ones, and a script with anything wrong in it is not played: the page stands as drawn.
Gotchas
- A trigger waits on ONE box (an id), or on the very boxes it changes.
show #a when .step arrivesis refused. - Boxes take their places on the grid in reading order (left to right, top to bottom), not the order they are listed.
- Naming the box a line waits on, never a place down the page, keeps the script true when the words in a box grow or shrink.
Example
{ "id": "ctrl_triggers",
"type": "triggers",
"label": "Triggers",
"attributeKey": "triggers",
"default": "" }
Rows — words beside the picture that goes with them. Six boxes in two columns, in reading order: words (class step),
their picture (class pic), words, picture, words, picture:
gather .pic
opacity .step from 0.2 while .step[0%-35%]
translate .step from 0 10vh while .step[0%-35%]Every field also takes the keys common to all fields.