@cube-drone/marquee-css 0.3.0 → 0.5.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/marquee.css +118 -0
- package/package.json +1 -1
package/marquee.css
CHANGED
|
@@ -123,6 +123,95 @@
|
|
|
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
|
+
|
|
171
|
+
/* ---- conflict / variant: a versioned-document merge conflict, shown inside
|
|
172
|
+
the body (the editor is the merge tool). Synthesized by the embedder at read
|
|
173
|
+
time, never authored. Stacked variants, each with an advisory label/when
|
|
174
|
+
line; the common ancestor (role=base) is de-emphasized, never hidden -
|
|
175
|
+
losing words is the one thing a conflict must not do. ---- */
|
|
176
|
+
.mq-conflict {
|
|
177
|
+
/* A light red wash: enough to say "resolve me", not enough to alarm. Low
|
|
178
|
+
alpha so it tints correctly over a light or a dark page. */
|
|
179
|
+
border: 1px solid rgba(200, 70, 70, 0.5);
|
|
180
|
+
border-radius: 0.375rem;
|
|
181
|
+
margin: 1rem 0;
|
|
182
|
+
background: rgba(200, 70, 70, 0.07);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.mq-variant {
|
|
186
|
+
padding: 0.5rem 0.75rem;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.mq-variant + .mq-variant {
|
|
190
|
+
border-top: 1px solid rgba(200, 70, 70, 0.25);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.mq-variant-head {
|
|
194
|
+
display: flex;
|
|
195
|
+
gap: 0.5rem;
|
|
196
|
+
align-items: baseline;
|
|
197
|
+
margin-bottom: 0.25rem;
|
|
198
|
+
font-size: 0.85em;
|
|
199
|
+
opacity: 0.75;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.mq-variant-label {
|
|
203
|
+
font-weight: 600;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.mq-variant-when {
|
|
207
|
+
opacity: 0.7;
|
|
208
|
+
font-variant-numeric: tabular-nums;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.mq-variant-base {
|
|
212
|
+
opacity: 0.6;
|
|
213
|
+
}
|
|
214
|
+
|
|
126
215
|
/* ---- the color slot: validated author values, property mapping ours ---- */
|
|
127
216
|
|
|
128
217
|
.mq-color {
|
|
@@ -512,6 +601,35 @@ big {
|
|
|
512
601
|
* belong to the interactive renderer; this is the best-effort CSS reveal,
|
|
513
602
|
* same tier as every other effect.) */
|
|
514
603
|
|
|
604
|
+
/* ---- the interactive renderer's half of the animation contract.
|
|
605
|
+
Every rule here is inert without `.mq-js`, which only an interactive
|
|
606
|
+
renderer adds, and only AFTER mount - so a static page (or markup that
|
|
607
|
+
never hydrates) animates immediately, exactly as before. The hold exists
|
|
608
|
+
only where JavaScript is alive to release it: never a hostage situation.
|
|
609
|
+
|
|
610
|
+
`.mq-anim` marks an effect element; `[data-mq-play]` is the observer
|
|
611
|
+
saying "this one has been seen"; `[data-mq-skip]` on an ancestor is the
|
|
612
|
+
reader saying "enough" - which stills every effect and, because reveal
|
|
613
|
+
effects hide only inside their keyframes, shows all text whole. ---- */
|
|
614
|
+
|
|
615
|
+
.mq-js .mq-anim,
|
|
616
|
+
.mq-js .mq-anim .mq-l,
|
|
617
|
+
.mq-js .mq-anim .mq-marquee-inner {
|
|
618
|
+
animation-play-state: paused;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.mq-js .mq-anim[data-mq-play],
|
|
622
|
+
.mq-js .mq-anim[data-mq-play] .mq-l,
|
|
623
|
+
.mq-js .mq-anim[data-mq-play] .mq-marquee-inner {
|
|
624
|
+
animation-play-state: running;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
[data-mq-skip] .mq-anim,
|
|
628
|
+
[data-mq-skip] .mq-anim .mq-l,
|
|
629
|
+
[data-mq-skip] .mq-anim .mq-marquee-inner {
|
|
630
|
+
animation: none;
|
|
631
|
+
}
|
|
632
|
+
|
|
515
633
|
/* ---- layouts: picked, not authored ---- */
|
|
516
634
|
|
|
517
635
|
.mq-page {
|