@mark1russell7/site-pages 0.2.9 → 0.2.10

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
@@ -81,7 +81,7 @@ The rule for a box that scrolls examines only tables, for these reasons:
81
81
 
82
82
  - A code block, a hex view, a row of tabs and a carousel are meant to scroll, and a visitor sees that they scroll.
83
83
  - A table in a box that scrolls looks complete on a phone, with no scroll bar. The visitor does not see the last columns.
84
- - The class `scroll-cue` shows a shade at the edge of the box, so a table in such a box does not count. The shade shows only when the cells have no background color of their own.
84
+ - The class `scroll-cue` shows a fade at the edge of the box, so a table in such a box does not count.
85
85
  - A false alarm costs more than a miss, because each false alarm needs an exception in the site.
86
86
 
87
87
  A table is `table`, `role="table"` or `role="grid"`. A desktop view has a scroll bar, so a table in a box that scrolls is not a problem there. `report.json` still shows the table in `measure.cut`.
@@ -371,7 +371,9 @@ The pages operate at a width of 390 px without horizontal scroll. The timeline s
371
371
 
372
372
  A wide code block or table on a narrow screen scrolls sideways. Without a cue, its text looks cut. The file `scroll-cue.css` of the package gives a cue:
373
373
 
374
- - A shade shows at each edge that has more content. At an end of the box, the shade of that end goes.
374
+ - The content fades at each edge that has more content. At an end of the box, the fade of that end goes.
375
+ - The fade shows along all of the edge of a tall box, and over cells with their own background color.
376
+ - A browser with no scroll timelines gets a shade at the edge. This shade shows only where the content has no background color.
375
377
  - The cue uses only CSS. It needs no JavaScript.
376
378
 
377
379
  Import the file in the site, and give the class `scroll-cue` to the box:
@@ -384,7 +386,7 @@ import "@mark1russell7/site-pages/scroll-cue.css";
384
386
  <pre class="scroll-cue">pnpm add @mark1russell7/site-pages</pre>
385
387
  ```
386
388
 
387
- The class sets `overflow-x: auto` and the background color of the box. Set `--scroll-cue-bg` to the background color of the box, and `--scroll-cue-shade` to the color of the shade:
389
+ The class sets `overflow-x: auto` and the background color of the box. Set `--scroll-cue-bg` to the background color of the box. In a browser with no scroll timelines, `--scroll-cue-shade` is the color of the shade:
388
390
 
389
391
  ```css
390
392
  .code {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@mark1russell7/site-pages",
4
- "version": "0.2.9",
4
+ "version": "0.2.10",
5
5
  "description": "A release timeline page and a live status page for the site of a GitHub repository: JSON data and standalone HTML, made at deploy time.",
6
6
  "keywords": [
7
7
  "github-pages",
@@ -1,7 +1,9 @@
1
1
  /*
2
2
  * @mark1russell7/site-pages/scroll-cue.css: a cue on a box that scrolls sideways.
3
- * A shade shows at each edge that has more content. When the box is at an end, the shade of that end goes.
4
- * The cue uses only CSS: two covers scroll with the content, and two shades stay at the edges.
3
+ * The content fades at each edge that has more content. When the box is at an end, the fade of that end goes.
4
+ * The cue uses only CSS. The fade shows along all of the edge, also over cells with their own background color.
5
+ * A browser with no scroll timelines gets two covers that scroll with the content and two shades that stay at the edges.
6
+ * In such a browser, the shade shows only where the content has no background color.
5
7
  *
6
8
  * Use: give the class scroll-cue to the box, and set --scroll-cue-bg to the background color of the box.
7
9
  * <pre class="scroll-cue">...</pre>
@@ -18,8 +20,8 @@
18
20
  background-image:
19
21
  linear-gradient(to right, var(--scroll-cue-bg) 40%, transparent),
20
22
  linear-gradient(to left, var(--scroll-cue-bg) 40%, transparent),
21
- radial-gradient(farthest-side at 0 50%, var(--scroll-cue-shade), transparent),
22
- radial-gradient(farthest-side at 100% 50%, var(--scroll-cue-shade), transparent);
23
+ linear-gradient(to right, var(--scroll-cue-shade), transparent),
24
+ linear-gradient(to left, var(--scroll-cue-shade), transparent);
23
25
  background-position: left center, right center, left center, right center;
24
26
  background-size:
25
27
  calc(var(--scroll-cue-size) * 2) 100%,
@@ -29,3 +31,43 @@
29
31
  background-repeat: no-repeat;
30
32
  background-attachment: local, local, scroll, scroll;
31
33
  }
34
+
35
+ @property --scroll-cue-fade-left {
36
+ syntax: "<length>";
37
+ inherits: false;
38
+ initial-value: 0px;
39
+ }
40
+
41
+ @property --scroll-cue-fade-right {
42
+ syntax: "<length>";
43
+ inherits: false;
44
+ initial-value: 0px;
45
+ }
46
+
47
+ @keyframes scroll-cue-fades {
48
+ 0% {
49
+ --scroll-cue-fade-left: 0px;
50
+ --scroll-cue-fade-right: calc(var(--scroll-cue-size) * 2);
51
+ }
52
+ 4% {
53
+ --scroll-cue-fade-left: calc(var(--scroll-cue-size) * 2);
54
+ }
55
+ 96% {
56
+ --scroll-cue-fade-right: calc(var(--scroll-cue-size) * 2);
57
+ }
58
+ 100% {
59
+ --scroll-cue-fade-left: calc(var(--scroll-cue-size) * 2);
60
+ --scroll-cue-fade-right: 0px;
61
+ }
62
+ }
63
+
64
+ /* A box with no overflow has no active timeline, so its fades stay at 0 and the mask hides nothing. */
65
+ @supports (animation-timeline: scroll()) {
66
+ .scroll-cue {
67
+ background-image: none;
68
+ -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--scroll-cue-fade-left), #000 calc(100% - var(--scroll-cue-fade-right)), transparent);
69
+ mask-image: linear-gradient(to right, transparent, #000 var(--scroll-cue-fade-left), #000 calc(100% - var(--scroll-cue-fade-right)), transparent);
70
+ animation: scroll-cue-fades linear both;
71
+ animation-timeline: scroll(self inline);
72
+ }
73
+ }