skydancer 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,185 @@
1
+ # Changelog
2
+
3
+ Embeds point at `@2`, which follows the newest `v2.x.x` tag, so everything
4
+ below reaches an existing embed as soon as it is tagged. This is the place to
5
+ look when a dancer starts looking different.
6
+
7
+ ## v2.11.0 — 2026-11-20
8
+
9
+ - A dancer with something to `shout` can be poked from a keyboard: it carries
10
+ a button that does what a poke does, hidden until it is tabbed to. Offered
11
+ only when a poke would be worth taking, so a decorative dancer still costs
12
+ the page no tab stop.
13
+ - Importing the widget where there is no browser -- a page being rendered on
14
+ a server -- does nothing instead of throwing, so a framework can pull it
15
+ in beside the markup that uses it.
16
+ - The widget is an npm package as well as a script tag: `npm install
17
+ skydancer`, then `import 'skydancer'` once to register the element. It is
18
+ the same file either way -- it already loaded as a module, so there is no
19
+ second build and nothing to keep in step.
20
+
21
+ ## v2.10.2 — 2026-11-20
22
+
23
+ - **Fixed:** a dancer with `hours` came back from off screen already
24
+ standing instead of filling. The hours ask for the same thing every
25
+ minute, and off screen there is no loop to finish the breath that
26
+ started; an arrival only fills when nothing else is breathing. Asking
27
+ for what it is already doing is no longer a breath at all.
28
+
29
+ ## v2.10.1 — 2026-11-20
30
+
31
+ - **Fixed:** a dancer stood up at full height on load instead of filling
32
+ with air as it arrived. v2.10.0's opening hours took a breath on every
33
+ connect, and the arrival fill only runs when nothing else is breathing.
34
+ - Customizer: a field for `hours`, under Wind.
35
+
36
+ ## v2.10.0 — 2026-11-20
37
+
38
+ - The page scrolling past is wind: a dancer is blown along with it, right
39
+ going down and left going up, and settles when the scrolling stops. It
40
+ scales with `wind` like everything else, so `wind="0"` ignores it, and a
41
+ paused dancer or a reader who asked for less motion never sees it. Only
42
+ the page's own scroll counts, not a scrolling container's.
43
+ - Customizer: four looks to start from -- car yard, shop front, party and
44
+ late night -- above the controls that refine one. Each is a whole dancer,
45
+ so none of them inherit the last one's leftovers, and your size and where
46
+ you dragged it are kept.
47
+ - `hours` gives a dancer opening times, as `9-17`, or `22-6` to run through
48
+ midnight. Outside them the air is out and it lies flat, which is what a
49
+ real one does when the fan goes off. It reads the reader's own clock.
50
+
51
+ ## v2.9.1 — 2026-11-19
52
+
53
+ - The `placard` is about two fifths bigger, so the words that hold still
54
+ are the ones you can read.
55
+
56
+ ## v2.9.0 — 2026-11-19
57
+
58
+ - **The balloon's dismiss button is gone**, along with the `closable`
59
+ attribute and the `close` event it fired. A page that hid a dancer that
60
+ way should call `hide()` or set `hidden` instead.
61
+ - `print` is lettered by hand now, in Skia where there is one, and heavier:
62
+ it is a sign painted on cloth rather than a label, and it is read at a
63
+ distance across a moving, shaded tube.
64
+ - **Fixed:** a literal NUL character in a `sign` or a `shout` was read as a
65
+ pipe and split the words there.
66
+
67
+ ## v2.8.0 — 2026-11-19
68
+
69
+ - `print` puts words down the body, the way a real one carries SALE or OPEN.
70
+ Each letter turns with the tube, so the line bends as the dancer moves.
71
+ - `placard` stakes a board at its feet, for words that hold still while
72
+ everything above them thrashes.
73
+ - `shout` is what a dancer blurts when poked. The word pops up beside it and
74
+ fades, somewhere different each time, leaving whatever the sign says alone.
75
+ Divide several with `|` as the sign does, and each poke takes one of them --
76
+ never the one it took last. A `shout` that already contains a pipe now
77
+ splits there; `||` writes a literal one.
78
+ - Words in the speech balloon type themselves out rather than appearing whole.
79
+ - Customizer: undo, redo and reset moved off the title row, which had run
80
+ out of room for them.
81
+
82
+ ## v2.7.0 — 2026-11-18
83
+
84
+ - `deflate()` and `inflate()` let a page flop a dancer and stand it back up,
85
+ the counterpart to `cheer()`. It stays on show either way.
86
+ - Customizer: a redo to go with the undo, and Cmd/Ctrl+Z and Cmd+Shift+Z.
87
+
88
+ ## v2.6.1 — 2026-11-18
89
+
90
+ - Customizer: an undo that steps back up to five changes. A slider drag counts
91
+ as one, and Surprise me and Reset are each a single step.
92
+
93
+ ## v2.6.0 — 2026-11-18
94
+
95
+ - A dancer fills with air when it first comes into view, and empties before it
96
+ goes when the balloon is dismissed.
97
+ - `pattern` puts `rings` or a `spiral` on the body, in the accent colour.
98
+ - `href` gives a dancer somewhere to lead. A click opens it in a new tab, and
99
+ it is a real link that can be tabbed to. Only `http`, `https`, `mailto` and
100
+ `tel` are followed — anything else is ignored, since the destination can
101
+ arrive from a page's templating or from a shared customizer link rather than
102
+ from whoever wrote the embed.
103
+ - The eyes follow the pointer while it is over the dancer.
104
+ - Customizer: a reset, and a link you can send someone.
105
+
106
+ ## v2.5.0 — 2026-11-18
107
+
108
+ - `paused` holds a dancer's pose without hiding it. A paused dancer still
109
+ repaints when an attribute changes or the widget is resized; it simply has no
110
+ loop of its own.
111
+ - A doubled pipe in `sign` is a literal pipe. Dividing phrases on a single pipe
112
+ (v2.4.0) had made one impossible to write.
113
+ - Customizer: it can hand you a link to the dancer you built, rather than only
114
+ saving it to your own browser, and the crowd size and its switch are boxed
115
+ together.
116
+
117
+ ## v2.4.0 — 2026-11-18
118
+
119
+ - Four more faces — `wink`, `joy`, `sleepy` and `angry` — alongside the first
120
+ three. A `variety` crowd draws on all seven.
121
+ - `cheer()` sets a dancer off on demand, the same burst a poke gives it.
122
+ - **A `sign` divided by pipes becomes several phrases the dancer works
123
+ through.** This changes an existing embed whose sign already contains a
124
+ pipe: it now splits there. v2.5.0 added `||` as the way to write one.
125
+ - Leaving `color` or `accent` off the tag lets the page set them in CSS, with
126
+ `--sky-dancer-color` and `--sky-dancer-accent`, so a dancer can follow a
127
+ light and a dark scheme without the embed being rewritten.
128
+ - The canvas is marked as decoration, a sign's words are mirrored into a hidden
129
+ element where a screen reader, the page's own find and a translator can reach
130
+ them, and the balloon's dismiss button is a real button you can tab to.
131
+ - The head is flatter, and the stripes are quieter.
132
+ - **Fixed:** a deeply sagging dancer's outline broke where the body bowed over.
133
+ The flattened head was being made by clipping, and the clip swallowed
134
+ whatever part of the body curled past the tube's tip. The cap is painted now,
135
+ so nothing is cut.
136
+
137
+ ## v2.3.1 — 2026-11-17
138
+
139
+ - **Fixed:** the shading stripes stopped short of the rounded ends, leaving the
140
+ head and the arm tips in flat colour. They now run out to the edge.
141
+
142
+ ## v2.3.0 — 2026-11-17
143
+
144
+ - `variety` gives every dancer in a crowd its own colour, face, girth, arm
145
+ length, hair and flail. The colours you chose stay on the first dancer and
146
+ the rest walk round the hue wheel, so a line-up reads as one set.
147
+
148
+ ## v2.2.0 — 2026-11-17
149
+
150
+ - Tubes are lit from the edge rather than shaded as cylinders: a bright strip
151
+ down the lit side, flat colour through the middle, shade opposite.
152
+ - Highlights and shadows are drawn from the tube's own colour rather than
153
+ washed with white and black, which keeps a flat fill from going grey. Any CSS
154
+ colour works, not only hex.
155
+ - A tube is stepped in five flat bands across its width rather than ramped, so
156
+ it reads as drawn rather than rendered.
157
+
158
+ ## v2.1.2 — 2026-11-17
159
+
160
+ - Shaded flatter again, more like a drawing than a render.
161
+ - Corrected v2.1.1, which had gone out carrying a shading value that was never
162
+ the one tested.
163
+
164
+ ## v2.1.1 — 2026-11-17
165
+
166
+ - Flattened the tube shading further.
167
+
168
+ ## v2.1.0 — 2026-11-17
169
+
170
+ - Shaded the tubes as cylinders, with a lit side and a shaded one.
171
+ - Customizer: redesigned, and given some personality.
172
+
173
+ ## v2.0.2 — 2026-11-17
174
+
175
+ - **Fixed:** the speech balloon hopped from one side of the head to the other.
176
+ - Customizer: dropped the checkerboard behind the preview.
177
+
178
+ ## v2.0.1 — 2026-11-16
179
+
180
+ - Dropped the ground shadow.
181
+
182
+ ## v2.0.0 — 2026-11-16
183
+
184
+ - First release on the `@2` line. The widget is always transparent and crops
185
+ close to the dancer, so it sits on whatever the page puts behind it.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marjan Bajc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # Skydancer
2
+
3
+ ![Three skydancers side by side: one with SALE printed down it and a placard at its feet, one with a speech bubble, one with a spiral](docs/preview.png)
4
+
5
+ **[Try it live](https://marjanb.github.io/skydancer/)** - tweak one and copy its embed code.
6
+
7
+ An animated inflatable tube man as an embeddable web widget. It is transparent, has no dependencies, and pauses itself while scrolled out of view. The dancer leans toward the mouse pointer and gets blown around by random gusts.
8
+
9
+ ## Embed
10
+
11
+ ```html
12
+ <script src="https://cdn.jsdelivr.net/gh/marjanb/skydancer@2/skydancer.min.js"></script>
13
+ <sky-dancer color="#7d3cff" accent="#00e0c6" face="cool" style="height: 500px"></sky-dancer>
14
+ ```
15
+
16
+ With a bundler, install it and import it once instead -- for its side effect,
17
+ since importing is what registers `<sky-dancer>`:
18
+
19
+ ```sh
20
+ npm install skydancer
21
+ ```
22
+
23
+ ```js
24
+ import 'skydancer';
25
+ ```
26
+
27
+ It is the same file either way: no build step, no dependencies, and nothing to
28
+ call once it is in.
29
+
30
+ The widget is 400px tall by default and crops to the dancer: its width follows its height (1.4x, plus a little per extra dancer), so it sits inline like an image rather than filling the page. Size it with CSS -- set the height and the width follows, or set both to override the crop. The dancer scales with the height and keeps its proportions.
31
+
32
+ | Attribute | Default | Meaning |
33
+ |--------------|-----------|--------------------------------------------|
34
+ | `color` | `#ff3b30` | body colour |
35
+ | `accent` | `#ffd60a` | arms and hair colour |
36
+ | `girth` | `64` | body thickness (px at 1000px widget height) |
37
+ | `arm-length` | `0.32` | arm length as a fraction of body height |
38
+ | `speed` | `1` | animation speed |
39
+ | `wildness` | `1` | how much it flails |
40
+ | `wind` | `1` | wind strength; `0` is calm. Scales the gusts, the pointer, and the page scrolling past |
41
+ | `hours` | none | when it is worth dancing, as `9-17`; `22-6` runs through midnight. Outside them the air is out and the dancer lies flat |
42
+ | `face` | `happy` | `happy`, `surprised`, `cool`, `wink`, `joy`, `sleepy` or `angry` |
43
+ | `pattern` | `none` | markings on the body: `none`, `rings` or `spiral` |
44
+ | `hair` | `true` | `false` hides the hair |
45
+ | `count` | `1` | how many dancers stand together (max 6) |
46
+ | `variety` | `false` | `true` gives each dancer in a crowd its own colour, face, girth, arms and hair |
47
+ | `paused` | `false` | `true` holds the pose; the dancer stays on show, it just stops |
48
+ | `sign` | none | words in a speech bubble; divide several with `\|` and it works through them, 4s each. `\|\|` is a literal pipe |
49
+ | `print` | none | words printed down the body, bending with the tube |
50
+ | `placard` | none | words on a board staked at the dancer's feet, which hold still |
51
+ | `shout` | none | what it blurts when poked; the word pops up beside it and fades, leaving the sign alone. Divide several with `\|` (and `\|\|` for a literal one) and a poke takes one |
52
+ | `bubble` | `drawn` | bubble shape: `drawn`, `box` or `burst` |
53
+ | `href` | none | where a click on the dancer leads, in a new tab; it also becomes a link that can be tabbed to |
54
+
55
+ The `sign` attribute puts words in a hand-drawn speech balloon beside the dancer's head. It drifts rather than tracking the head, so the words stay readable.
56
+
57
+ A poke is a pointer gesture, so a dancer with something to `shout` also
58
+ carries a button that does the same, hidden until it is tabbed to. It is
59
+ offered only when a poke would be worth taking -- there are words to hear and
60
+ the dancer is not held -- so a purely decorative one costs the page no tab
61
+ stop.
62
+
63
+ The canvas is marked `aria-hidden`, since it is decoration. The sign's words
64
+ are mirrored into a visually hidden element, so a screen reader, the page's own
65
+ find and a translator can all reach them.
66
+
67
+ ## Theming from CSS
68
+
69
+ Leave `color` or `accent` off the tag and the dancer takes them from custom
70
+ properties instead, so a page can dress it from its own stylesheet and follow a
71
+ light and a dark scheme without the embed being rewritten:
72
+
73
+ ```css
74
+ :root { --sky-dancer-color: #15803d; --sky-dancer-accent: #d7f000; }
75
+ ```
76
+
77
+ An attribute wins over a custom property, and an unreadable value falls back to
78
+ the default. The widget rereads them when the colour scheme changes, when
79
+ `<html>` gains or loses a class or `data-theme`, and when a colour attribute is
80
+ set, so a theme toggle reaches the dancer either way.
81
+
82
+ ## Scripting
83
+
84
+ ```js
85
+ document.querySelector('sky-dancer').cheer(); // set it flailing
86
+ document.querySelector('sky-dancer').deflate(); // flop
87
+ document.querySelector('sky-dancer').inflate(); // stand back up
88
+ ```
89
+
90
+ `cheer()` gives the same burst a poke does, for a page with something to
91
+ celebrate. It does nothing on a dancer that is off screen or holding a still
92
+ pose for `prefers-reduced-motion`, rather than saving the flail up.
93
+
94
+ `deflate()` and `inflate()` are the other half: a dancer that sags when
95
+ something goes wrong and rises when it comes right. It stays on show either
96
+ way — a mood, not `hide()` and `show()` — and one left down stays down, even
97
+ if it scrolls out of view and back. A held pose takes the change at once
98
+ instead of breathing into it.
99
+
100
+ The page's own scroll is what counts: a dancer inside a scrolling container, or in an iframe whose parent is what scrolls, is not blown by it. A jump to an anchor or to the end of the page reads as one gust rather than as the distance travelled, and a reflow above the viewport can stir it as a scroll would.
101
+
102
+ `hours` is read from the reader's own clock, not the shop's, so a visitor in another timezone sees their own hours. The page may still call `deflate()` or `inflate()` in between, and the next check puts it back where the hours say within the minute.
103
+
104
+ To show and hide a dancer, call `hide()` and `show()` on the element, or set the standard `hidden` property:
105
+
106
+ ```js
107
+ document.querySelector('sky-dancer').hide();
108
+ ```
109
+
110
+ A hidden dancer stops animating and costs nothing until it is shown again.
111
+
112
+ Poking a dancer knocks the air out of it. Where the viewer's system asks for reduced motion, it holds a still pose instead of animating.
113
+
114
+ ## Customizer
115
+
116
+ Open `index.html` to tweak a dancer with sliders and copy its embed code. `embed-example.html` shows several dancers on one page.
117
+
118
+ ## License
119
+
120
+ MIT, see [LICENSE](LICENSE).
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "skydancer",
3
+ "version": "2.11.0",
4
+ "description": "An embeddable inflatable tube dancer, as a custom element. Vanilla canvas, no dependencies.",
5
+ "keywords": [
6
+ "custom-element",
7
+ "web-component",
8
+ "canvas",
9
+ "animation",
10
+ "widget",
11
+ "skydancer",
12
+ "tube-man"
13
+ ],
14
+ "homepage": "https://marjanb.github.io/skydancer/",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/marjanb/skydancer.git"
18
+ },
19
+ "bugs": "https://github.com/marjanb/skydancer/issues",
20
+ "license": "MIT",
21
+ "author": "Marjan Bajc",
22
+ "type": "module",
23
+ "exports": {
24
+ ".": "./skydancer.js"
25
+ },
26
+ "main": "./skydancer.js",
27
+ "module": "./skydancer.js",
28
+ "unpkg": "./skydancer.js",
29
+ "jsdelivr": "./skydancer.js",
30
+ "files": [
31
+ "skydancer.js",
32
+ "README.md",
33
+ "CHANGELOG.md",
34
+ "LICENSE"
35
+ ],
36
+ "sideEffects": true,
37
+ "engines": {
38
+ "node": ">=18"
39
+ }
40
+ }