@plusguard/reels 1.10.0 → 1.10.1

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/README.md CHANGED
@@ -23,9 +23,9 @@ From npm, through jsDelivr — the npm package is the code alone (about
23
23
  jsDelivr's GitHub route.
24
24
 
25
25
  ```html
26
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@plusguard/reels@1.10.0/index.css" />
26
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@plusguard/reels@1.10.1/index.css" />
27
27
  <script type="module">
28
- import { initReels } from "https://cdn.jsdelivr.net/npm/@plusguard/reels@1.10.0/dist/index.js";
28
+ import { initReels } from "https://cdn.jsdelivr.net/npm/@plusguard/reels@1.10.1/dist/index.js";
29
29
  initReels();
30
30
  </script>
31
31
  ```
@@ -92,6 +92,12 @@ below).
92
92
  plays; a bar pressed is that clip at once — one bar even for a card of
93
93
  one clip. Under the mouse they thicken, to be pressed easily. Out of sight it stops and waits on its poster; a hidden tab
94
94
  stops them all.
95
+ - **Only what plays loads.** Write each video `preload="none"` with a
96
+ `poster`: the page fetches the posters, and a video only when its clip
97
+ plays — the playing clip of each card in sight. The other clips, and the
98
+ cards out of sight, cost nothing but their poster until their turn. The
99
+ full view fetches its own clip, and ahead of time only the stills of the
100
+ groups beside it and of the clip after it, so a slide is never blank.
95
101
  - **The product is the clip's.** The products under a card are one a clip;
96
102
  the playing one's shows (`data-pg-reels-current`).
97
103
  - **Sound is one card's.** A sound button pressed gives the sound to its
@@ -115,6 +121,18 @@ below).
115
121
  counts and leaves out the same visitor twice a day — and writes the
116
122
  number back in `data-pg-reels-views`.
117
123
 
124
+ - **Once a page visit.** The same clip is not told twice while the page
125
+ stays open — a card going round, the full view opened again. A visit
126
+ later (the page opened again, or reloaded), it is told again, however
127
+ long since.
128
+ - **The server decides what counts.** Its rule is its own — the same
129
+ visitor and clip once a day, say: watched again the next day, counted
130
+ again; five reloads in a day, counted once. Once an hour, every time,
131
+ or never twice: the site's to choose.
132
+ - **Not the rings.** The seen rings (below) and their
133
+ `--pg-reels-seen-for` are only how the avatars look: a ring bright
134
+ again changes no count, and a count changes no ring.
135
+
118
136
  ```js
119
137
  section.addEventListener("pg-reels:watched", (e) => {
120
138
  const { id, clip, where } = e.detail;
@@ -154,7 +172,7 @@ classic script in `<head>` after the stylesheets, marks each group as the
154
172
  browser reads it, before anything is drawn:
155
173
 
156
174
  ```html
157
- <script src="https://cdn.jsdelivr.net/npm/@plusguard/reels@1.10.0/early.js"></script>
175
+ <script src="https://cdn.jsdelivr.net/npm/@plusguard/reels@1.10.1/early.js"></script>
158
176
  ```
159
177
 
160
178
  No dependencies, nothing to call; `initReels()` takes over after. It reads
package/dist/index.js CHANGED
@@ -36,7 +36,8 @@
36
36
  * are one per clip, and only the playing one's shows. So with view
37
37
  * counts: one data-pg-reels-views a clip, in order, and only the playing
38
38
  * clip's shows — or one for the whole group, always shown. The others wait
39
- * on their posters. Out of sight, nothing plays.
39
+ * on their posters. Out of sight, nothing plays — and with each video
40
+ * written preload="none", nothing loads but its poster until its turn.
40
41
  *
41
42
  * The strip scrolls sideways — a finger, a wheel, its arrows; it never
42
43
  * moves by itself. data-pg-reels-start / -end on the section while it
@@ -50,9 +51,11 @@
50
51
  * Watched: a clip that has played 3 seconds — or half of it, if it is
51
52
  * shorter than 6 — on a card or in the full view, sends pg-reels:watched
52
53
  * on the section (detail: group, clip, id — its group's data-pg-reels-id —
53
- * and where: "card" or "full"), once a clip a page visit. The package only
54
- * says so; counting, and the number shown in data-pg-reels-views, are the
55
- * site's.
54
+ * and where: "card" or "full"), once a clip a page visit — a visit later
55
+ * (opened again, reloaded) it is told again. The package only says so;
56
+ * counting — what counts, the same visitor once a day, say — and the
57
+ * number shown in data-pg-reels-views, are the site's server's. The seen
58
+ * rings are apart from it: a ring bright again changes no count.
56
59
  *
57
60
  * The full view — a <dialog>, built here on <body>, its contents copies:
58
61
  * the clip playing, the group's data-pg-reels-head, the clip's product.
package/early.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * A classic script, in <head>, after the page's stylesheets and before its
10
10
  * markup — not deferred, not a module:
11
11
  *
12
- * <script src="https://cdn.jsdelivr.net/npm/@plusguard/reels@1.10.0/early.js"></script>
12
+ * <script src="https://cdn.jsdelivr.net/npm/@plusguard/reels@1.10.1/early.js"></script>
13
13
  *
14
14
  * or its text written inline there. No dependencies; nothing to call. It
15
15
  * reads --pg-reels-seen and --pg-reels-seen-for from the stylesheets, as
package/index.ts CHANGED
@@ -36,7 +36,8 @@
36
36
  * are one per clip, and only the playing one's shows. So with view
37
37
  * counts: one data-pg-reels-views a clip, in order, and only the playing
38
38
  * clip's shows — or one for the whole group, always shown. The others wait
39
- * on their posters. Out of sight, nothing plays.
39
+ * on their posters. Out of sight, nothing plays — and with each video
40
+ * written preload="none", nothing loads but its poster until its turn.
40
41
  *
41
42
  * The strip scrolls sideways — a finger, a wheel, its arrows; it never
42
43
  * moves by itself. data-pg-reels-start / -end on the section while it
@@ -50,9 +51,11 @@
50
51
  * Watched: a clip that has played 3 seconds — or half of it, if it is
51
52
  * shorter than 6 — on a card or in the full view, sends pg-reels:watched
52
53
  * on the section (detail: group, clip, id — its group's data-pg-reels-id —
53
- * and where: "card" or "full"), once a clip a page visit. The package only
54
- * says so; counting, and the number shown in data-pg-reels-views, are the
55
- * site's.
54
+ * and where: "card" or "full"), once a clip a page visit — a visit later
55
+ * (opened again, reloaded) it is told again. The package only says so;
56
+ * counting — what counts, the same visitor once a day, say — and the
57
+ * number shown in data-pg-reels-views, are the site's server's. The seen
58
+ * rings are apart from it: a ring bright again changes no count.
56
59
  *
57
60
  * The full view — a <dialog>, built here on <body>, its contents copies:
58
61
  * the clip playing, the group's data-pg-reels-head, the clip's product.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plusguard/reels",
3
- "version": "1.10.0",
4
- "description": "Shoppable reels for a store: a strip of video cards — each a group of clips, each clip with its own product — that opens into a full view. Up and down between groups, left and right within one, the product beside the video on a computer and under it on a phone. No dependencies.",
3
+ "version": "1.10.1",
4
+ "description": "Shoppable reels for a store: a strip of video cards — each a group of clips, each clip with its own product — that opens into a full view. Up and down between groups, left and right within one, the product beside the video on a computer and under it on a phone. Only the playing clips load; a clip watched is told to the site (pg-reels:watched), which counts. No dependencies.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",