@cube-drone/marquee-css 0.3.0 → 0.4.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.
Files changed (2) hide show
  1. package/marquee.css +74 -0
  2. package/package.json +1 -1
package/marquee.css CHANGED
@@ -123,6 +123,51 @@
123
123
  background: rgba(127, 127, 127, 0.12);
124
124
  }
125
125
 
126
+ /* ---- spoilers: content present, visually withheld. Zero-JS: blurred,
127
+ revealed on hover or focus. The element is focusable (tabindex=0), so a
128
+ tap focuses and reveals it on phones too, where there is no hover - :focus
129
+ (not :focus-visible) because touch focus matches the former, not the
130
+ latter. That's the best a static page can do. An interactive renderer
131
+ wraps the document in .mq-root and click-gates it instead - hover/focus no
132
+ longer reveal, a deliberate click does (and sets data-mq-revealed).
133
+ Degrades to plain visible text without the sheet, because a hidden spoiler
134
+ is worse than a shown one. ---- */
135
+
136
+ .mq-spoiler {
137
+ filter: blur(0.35em);
138
+ background: rgba(127, 127, 127, 0.22);
139
+ border-radius: 0.2em;
140
+ cursor: pointer;
141
+ transition: filter 0.12s ease;
142
+ }
143
+
144
+ .mq-spoiler:hover,
145
+ .mq-spoiler:focus {
146
+ filter: none;
147
+ }
148
+
149
+ /* Under an interactive renderer: hover/focus must NOT reveal (a spoiler takes
150
+ a deliberate click); the click sets data-mq-revealed, which does. The
151
+ [data-mq-revealed] rule below is equal specificity but later, so a clicked
152
+ spoiler stays revealed even while it holds focus. */
153
+ .mq-root .mq-spoiler:hover,
154
+ .mq-root .mq-spoiler:focus {
155
+ filter: blur(0.35em);
156
+ }
157
+
158
+ .mq-root .mq-spoiler[data-mq-revealed] {
159
+ filter: none;
160
+ background: none;
161
+ cursor: text;
162
+ }
163
+
164
+ /* Block spoiler (`:::spoiler`): the same withholding, sized to a region -
165
+ an image, a paragraph - rather than a run of words. */
166
+ .mq-spoiler-block {
167
+ display: block;
168
+ padding: 0.5rem;
169
+ }
170
+
126
171
  /* ---- the color slot: validated author values, property mapping ours ---- */
127
172
 
128
173
  .mq-color {
@@ -512,6 +557,35 @@ big {
512
557
  * belong to the interactive renderer; this is the best-effort CSS reveal,
513
558
  * same tier as every other effect.) */
514
559
 
560
+ /* ---- the interactive renderer's half of the animation contract.
561
+ Every rule here is inert without `.mq-js`, which only an interactive
562
+ renderer adds, and only AFTER mount - so a static page (or markup that
563
+ never hydrates) animates immediately, exactly as before. The hold exists
564
+ only where JavaScript is alive to release it: never a hostage situation.
565
+
566
+ `.mq-anim` marks an effect element; `[data-mq-play]` is the observer
567
+ saying "this one has been seen"; `[data-mq-skip]` on an ancestor is the
568
+ reader saying "enough" - which stills every effect and, because reveal
569
+ effects hide only inside their keyframes, shows all text whole. ---- */
570
+
571
+ .mq-js .mq-anim,
572
+ .mq-js .mq-anim .mq-l,
573
+ .mq-js .mq-anim .mq-marquee-inner {
574
+ animation-play-state: paused;
575
+ }
576
+
577
+ .mq-js .mq-anim[data-mq-play],
578
+ .mq-js .mq-anim[data-mq-play] .mq-l,
579
+ .mq-js .mq-anim[data-mq-play] .mq-marquee-inner {
580
+ animation-play-state: running;
581
+ }
582
+
583
+ [data-mq-skip] .mq-anim,
584
+ [data-mq-skip] .mq-anim .mq-l,
585
+ [data-mq-skip] .mq-anim .mq-marquee-inner {
586
+ animation: none;
587
+ }
588
+
515
589
  /* ---- layouts: picked, not authored ---- */
516
590
 
517
591
  .mq-page {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cube-drone/marquee-css",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "The Marquee reference stylesheet: the mq-* class contract every renderer targets",
5
5
  "license": "MPL-2.0",
6
6
  "repository": {