@hagicode/hagilight-docusaurus 0.0.0-stage → 0.1.0-dev.148.1.e0c630e

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/promoto.css ADDED
@@ -0,0 +1,508 @@
1
+ /*
2
+ * Promote card on Infima tokens. Layout: content on top, one action row below.
3
+ * The call to action sits bottom-left; pager and pause share that row at the
4
+ * bottom-right. Dismiss is a corner mark. Portrait phones keep only a thumbnail
5
+ * beside the title; short landscape viewports drop the thumbnail for a thin strip.
6
+ */
7
+
8
+ .hagilight-promoto {
9
+ --hagilight-promoto-cta-text: var(--ifm-color-white);
10
+ --promoto-control-size: 1.75rem;
11
+ --promoto-cta-height: 2.25rem;
12
+ --promoto-pad: 0.875rem;
13
+ --promoto-pager-width: calc(3 * var(--promoto-control-size) + 2.25rem + 0.375rem);
14
+ --promoto-muted: var(--ifm-color-emphasis-700);
15
+ /* Motion: a damped spring where linear() exists, a long ease-out elsewhere. */
16
+ --promoto-ease: cubic-bezier(0.22, 1, 0.36, 1);
17
+ --promoto-rotation: 8000ms;
18
+ --promoto-shift: 1rem;
19
+ display: block;
20
+ }
21
+
22
+ @supports (transition-timing-function: linear(0, 1)) {
23
+ .hagilight-promoto {
24
+ --promoto-ease: linear(0, 0.066, 0.22, 0.409, 0.597, 0.761, 0.89, 0.983, 1.042, 1.073, 1.083, 1.079, 1.067, 1.052, 1.036, 1.022, 1.011, 1.002, 0.997, 0.994, 0.993, 0.993, 1);
25
+ }
26
+ }
27
+
28
+ .hagilight-promoto[data-dir='prev'] {
29
+ --promoto-shift: -1rem;
30
+ }
31
+
32
+ .hagilight-promoto[hidden],
33
+ .hagilight-promoto__shell[hidden],
34
+ .hagilight-promoto__controls[hidden] {
35
+ display: none !important;
36
+ }
37
+
38
+ .hagilight-promoto__shell {
39
+ position: fixed;
40
+ z-index: 40;
41
+ /* Centered in the content area: a theme narrows it by setting these two insets on :root. */
42
+ inset-inline-start: var(--hagilight-promoto-inset-start, 0px);
43
+ inset-inline-end: var(--hagilight-promoto-inset-end, 0px);
44
+ bottom: max(1rem, env(safe-area-inset-bottom));
45
+ width: min(42rem, calc(100% - var(--hagilight-promoto-inset-start, 0px) - var(--hagilight-promoto-inset-end, 0px) - 1rem - 2 * max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))));
46
+ margin-inline: auto;
47
+ overflow: hidden;
48
+ border: 1px solid color-mix(in srgb, var(--ifm-color-primary) 24%, var(--ifm-color-emphasis-300));
49
+ border-radius: 1rem;
50
+ background: color-mix(in srgb, var(--ifm-background-surface-color, var(--ifm-color-white)) 96%, var(--ifm-color-primary) 4%);
51
+ box-shadow: 0 12px 32px color-mix(in srgb, #000 14%, transparent);
52
+ color: var(--ifm-font-color-base);
53
+ opacity: 1;
54
+ visibility: visible;
55
+ transform: none;
56
+ transition: opacity 0.24s ease, transform 0.62s var(--promoto-ease), visibility 0s linear;
57
+ }
58
+
59
+ /* Rises into place on first render and whenever it returns from the footer or the page top. */
60
+ .hagilight-promoto[data-state='ready'] .hagilight-promoto__shell {
61
+ animation: hagilight-promoto-rise 0.62s var(--promoto-ease) backwards;
62
+ }
63
+
64
+ @keyframes hagilight-promoto-rise {
65
+ from { opacity: 0; transform: translateY(1.25rem) scale(0.97); }
66
+ to { opacity: 1; transform: none; }
67
+ }
68
+
69
+ .hagilight-promoto[data-state='footer-hidden'] .hagilight-promoto__shell,
70
+ .hagilight-promoto[data-state='top-hidden'] .hagilight-promoto__shell {
71
+ opacity: 0;
72
+ visibility: hidden;
73
+ pointer-events: none;
74
+ transform: translateY(1.25rem) scale(0.97);
75
+ /* Leaving is quick and does not bounce. */
76
+ transition: opacity 0.2s ease, transform 0.24s ease-in, visibility 0s linear 0.24s;
77
+ }
78
+
79
+ /* Time until the next card, drawn along the bottom edge; hovering the card or tabbing into it holds it. */
80
+ .hagilight-promoto__progress {
81
+ position: absolute;
82
+ inset-block-end: 0;
83
+ inset-inline: 0;
84
+ block-size: 2px;
85
+ background: var(--ifm-color-primary);
86
+ opacity: 0;
87
+ pointer-events: none;
88
+ transform: scaleX(0);
89
+ transform-origin: left center;
90
+ }
91
+
92
+ .hagilight-promoto__progress:dir(rtl) {
93
+ transform-origin: right center;
94
+ }
95
+
96
+ .hagilight-promoto[data-rotating] .hagilight-promoto__progress {
97
+ opacity: 0.55;
98
+ animation-duration: var(--promoto-rotation);
99
+ animation-timing-function: linear;
100
+ animation-fill-mode: forwards;
101
+ }
102
+
103
+ /* Two names for one keyframe set: flipping between them restarts the fill without a forced reflow. */
104
+ .hagilight-promoto[data-rotating][data-tick='0'] .hagilight-promoto__progress {
105
+ animation-name: hagilight-promoto-fill-a;
106
+ }
107
+
108
+ .hagilight-promoto[data-rotating][data-tick='1'] .hagilight-promoto__progress {
109
+ animation-name: hagilight-promoto-fill-b;
110
+ }
111
+
112
+ .hagilight-promoto[data-paused] .hagilight-promoto__progress,
113
+ .hagilight-promoto__shell:hover .hagilight-promoto__progress,
114
+ .hagilight-promoto__shell:has(:focus-visible) .hagilight-promoto__progress {
115
+ animation-play-state: paused;
116
+ }
117
+
118
+ @keyframes hagilight-promoto-fill-a {
119
+ from { transform: scaleX(0); }
120
+ to { transform: scaleX(1); }
121
+ }
122
+
123
+ @keyframes hagilight-promoto-fill-b {
124
+ from { transform: scaleX(0); }
125
+ to { transform: scaleX(1); }
126
+ }
127
+
128
+ .hagilight-promoto__viewport {
129
+ overflow: hidden;
130
+ }
131
+
132
+ .hagilight-promoto__track {
133
+ display: flex;
134
+ align-items: stretch;
135
+ width: 100%;
136
+ transition: transform 0.5s var(--promoto-ease);
137
+ }
138
+
139
+ /*
140
+ * Content settles after the track: the card being left fades out at once, the card
141
+ * arriving lands copy, then the action, each a beat behind the last. Pushes toward
142
+ * the direction of travel (--promoto-shift flips for Previous).
143
+ */
144
+ .hagilight-promoto__slide > * {
145
+ transition: opacity 0.32s ease, transform 0.55s var(--promoto-ease);
146
+ }
147
+
148
+ .hagilight-promoto__slide[aria-hidden='true'] > * {
149
+ opacity: 0;
150
+ transform: translateX(var(--promoto-shift));
151
+ transition-duration: 0.18s, 0.18s;
152
+ }
153
+
154
+ .hagilight-promoto__slide[aria-hidden='false'] > .hagilight-promoto__copy {
155
+ transition-delay: 0.08s;
156
+ }
157
+
158
+ .hagilight-promoto__slide[aria-hidden='false'] > .hagilight-promoto__cta {
159
+ transition-delay: 0.14s;
160
+ }
161
+
162
+ .hagilight-promoto__slide {
163
+ display: grid;
164
+ grid-template-columns: auto minmax(0, 1fr);
165
+ grid-template-areas:
166
+ 'media copy'
167
+ 'media cta';
168
+ align-items: start;
169
+ column-gap: 1rem;
170
+ row-gap: 0.75rem;
171
+ width: 100%;
172
+ min-width: 100%;
173
+ padding: var(--promoto-pad);
174
+ }
175
+
176
+ .hagilight-promoto__slide:not([data-has-image='true']) {
177
+ grid-template-columns: minmax(0, 1fr);
178
+ grid-template-areas:
179
+ 'copy'
180
+ 'cta';
181
+ padding-inline-start: 1.25rem;
182
+ }
183
+
184
+ .hagilight-promoto__slide[aria-hidden='true'] {
185
+ pointer-events: none;
186
+ }
187
+
188
+ .hagilight-promoto__copy {
189
+ grid-area: copy;
190
+ display: grid;
191
+ gap: 0.25rem;
192
+ min-width: 0;
193
+ }
194
+
195
+ .hagilight-promoto__title,
196
+ .hagilight-promoto__description {
197
+ display: -webkit-box;
198
+ overflow: hidden;
199
+ margin: 0;
200
+ -webkit-box-orient: vertical;
201
+ -webkit-line-clamp: 2;
202
+ }
203
+
204
+ .hagilight-promoto__title {
205
+ padding-inline-end: 2rem;
206
+ color: var(--ifm-heading-color);
207
+ font-size: 1rem;
208
+ font-weight: 700;
209
+ line-height: 1.3;
210
+ text-wrap: balance;
211
+ }
212
+
213
+ .hagilight-promoto__description {
214
+ color: var(--promoto-muted);
215
+ font-size: 0.875rem;
216
+ font-weight: 400;
217
+ line-height: 1.4;
218
+ }
219
+
220
+ .hagilight-promoto__media {
221
+ grid-area: media;
222
+ display: inline-flex;
223
+ align-items: center;
224
+ justify-content: center;
225
+ width: 4.5rem;
226
+ min-width: 4.5rem;
227
+ aspect-ratio: 1;
228
+ overflow: hidden;
229
+ border: 1px solid color-mix(in srgb, var(--ifm-color-primary-dark) 18%, var(--ifm-color-emphasis-300));
230
+ border-radius: 0.75rem;
231
+ background: var(--ifm-color-emphasis-100);
232
+ }
233
+
234
+ .hagilight-promoto__image {
235
+ display: block;
236
+ width: 100%;
237
+ height: 100%;
238
+ object-fit: cover;
239
+ }
240
+
241
+ .hagilight-promoto__media picture {
242
+ display: contents;
243
+ }
244
+
245
+ .hagilight-promoto__cta {
246
+ grid-area: cta;
247
+ display: inline-flex;
248
+ align-items: center;
249
+ justify-content: center;
250
+ justify-self: start;
251
+ max-width: min(100%, 16rem);
252
+ min-height: var(--promoto-cta-height);
253
+ padding: 0.4rem 1rem;
254
+ border: 1px solid color-mix(in srgb, var(--ifm-color-primary-dark) 30%, transparent);
255
+ border-radius: 999px;
256
+ background: var(--ifm-color-primary);
257
+ color: var(--hagilight-promoto-cta-text);
258
+ font-size: 0.875rem;
259
+ font-weight: 600;
260
+ line-height: 1.2;
261
+ text-align: center;
262
+ text-decoration: none;
263
+ }
264
+
265
+ .hagilight-promoto[data-multiple] .hagilight-promoto__cta {
266
+ max-width: min(16rem, calc(100% - var(--promoto-pager-width)));
267
+ }
268
+
269
+ .hagilight-promoto__cta:hover,
270
+ .hagilight-promoto__cta:focus-visible {
271
+ background: var(--ifm-color-primary-dark);
272
+ }
273
+
274
+ /* Pager and pause sit on the call-to-action row, bottom-right. */
275
+ .hagilight-promoto__controls {
276
+ position: absolute;
277
+ inset-block-end: var(--promoto-pad);
278
+ inset-inline-end: 0.5rem;
279
+ display: flex;
280
+ align-items: center;
281
+ height: var(--promoto-cta-height);
282
+ gap: 0.125rem;
283
+ }
284
+
285
+ .hagilight-promoto__dismiss,
286
+ .hagilight-promoto__control {
287
+ position: relative;
288
+ display: inline-grid;
289
+ place-items: center;
290
+ flex: none;
291
+ width: var(--promoto-control-size);
292
+ height: var(--promoto-control-size);
293
+ padding: 0;
294
+ border: 0;
295
+ border-radius: 999px;
296
+ background: transparent;
297
+ color: var(--promoto-muted);
298
+ cursor: pointer;
299
+ transition: background-color 0.15s ease, color 0.15s ease;
300
+ }
301
+
302
+ /* Keep the tap target larger than the visible mark. */
303
+ .hagilight-promoto__dismiss::before,
304
+ .hagilight-promoto__control::before {
305
+ content: '';
306
+ position: absolute;
307
+ inset-block: -0.375rem;
308
+ inset-inline: 0;
309
+ }
310
+
311
+ .hagilight-promoto__dismiss {
312
+ position: absolute;
313
+ inset-block-start: 0.375rem;
314
+ inset-inline-end: 0.375rem;
315
+ }
316
+
317
+ .hagilight-promoto__dismiss::before {
318
+ inset-inline: -0.25rem;
319
+ }
320
+
321
+ .hagilight-promoto__icon {
322
+ width: 1rem;
323
+ height: 1rem;
324
+ fill: none;
325
+ stroke: currentColor;
326
+ stroke-width: 2;
327
+ stroke-linecap: round;
328
+ stroke-linejoin: round;
329
+ pointer-events: none;
330
+ }
331
+
332
+ .hagilight-promoto__icon--play {
333
+ display: none;
334
+ fill: currentColor;
335
+ }
336
+
337
+ .hagilight-promoto__control[aria-pressed='true'] .hagilight-promoto__icon--pause {
338
+ display: none;
339
+ }
340
+
341
+ .hagilight-promoto__control[aria-pressed='true'] .hagilight-promoto__icon--play {
342
+ display: block;
343
+ }
344
+
345
+ .hagilight-promoto__count {
346
+ min-width: 2.25rem;
347
+ color: var(--promoto-muted);
348
+ font-size: 0.75rem;
349
+ font-variant-numeric: tabular-nums;
350
+ line-height: 1;
351
+ text-align: center;
352
+ white-space: nowrap;
353
+ }
354
+
355
+ .hagilight-promoto__control:disabled {
356
+ cursor: default;
357
+ opacity: 0.45;
358
+ }
359
+
360
+ .hagilight-promoto__status {
361
+ position: absolute;
362
+ width: 1px;
363
+ height: 1px;
364
+ overflow: hidden;
365
+ clip: rect(0, 0, 0, 0);
366
+ white-space: nowrap;
367
+ }
368
+
369
+ @media (hover: hover) {
370
+ .hagilight-promoto__dismiss:hover,
371
+ .hagilight-promoto__control:hover:not(:disabled) {
372
+ background: color-mix(in srgb, var(--ifm-color-primary) 12%, transparent);
373
+ color: var(--ifm-heading-color);
374
+ }
375
+ }
376
+
377
+ .hagilight-promoto__dismiss:focus-visible,
378
+ .hagilight-promoto__control:focus-visible,
379
+ .hagilight-promoto__cta:focus-visible {
380
+ outline: 2px solid var(--ifm-color-primary);
381
+ outline-offset: 2px;
382
+ }
383
+
384
+ @media (pointer: coarse) {
385
+ .hagilight-promoto {
386
+ --promoto-control-size: 2rem;
387
+ }
388
+ }
389
+
390
+ /* Portrait phones: thumbnail beside the title only; description and action row take the full width. */
391
+ @media (max-width: 36rem) and (min-height: 30rem) {
392
+ .hagilight-promoto {
393
+ --promoto-control-size: 2rem;
394
+ --promoto-pad: 0.75rem;
395
+ }
396
+
397
+ .hagilight-promoto__shell {
398
+ bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
399
+ width: min(calc(100vw - 1rem - 2 * max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))), 28rem);
400
+ border-radius: 0.875rem;
401
+ }
402
+
403
+ .hagilight-promoto__slide[data-has-image] {
404
+ grid-template-columns: minmax(0, 1fr);
405
+ grid-template-areas: 'title' 'desc' 'cta';
406
+ gap: 0.375rem;
407
+ padding: var(--promoto-pad);
408
+ }
409
+
410
+ .hagilight-promoto__slide[data-has-image='true'] {
411
+ grid-template-columns: 3rem minmax(0, 1fr);
412
+ grid-template-areas: 'media title' 'desc desc' 'cta cta';
413
+ column-gap: 0.625rem;
414
+ }
415
+
416
+ /* Flatten copy so the thumbnail sits beside the title only. */
417
+ .hagilight-promoto__copy {
418
+ display: contents;
419
+ }
420
+
421
+ .hagilight-promoto__title {
422
+ grid-area: title;
423
+ align-self: center;
424
+ font-size: 0.95rem;
425
+ }
426
+
427
+ .hagilight-promoto__description {
428
+ grid-area: desc;
429
+ font-size: 0.85rem;
430
+ line-height: 1.35;
431
+ }
432
+
433
+ .hagilight-promoto__media {
434
+ width: 3rem;
435
+ min-width: 3rem;
436
+ border-radius: 0.625rem;
437
+ }
438
+
439
+ .hagilight-promoto__cta {
440
+ margin-block-start: 0.25rem;
441
+ padding-inline: 0.875rem;
442
+ }
443
+ }
444
+
445
+ @media (max-width: 22.5rem) and (min-height: 30rem) {
446
+ .hagilight-promoto {
447
+ --promoto-pager-width: 6rem;
448
+ }
449
+
450
+ .hagilight-promoto__count {
451
+ display: none;
452
+ }
453
+
454
+ .hagilight-promoto__cta {
455
+ padding-inline: 0.625rem;
456
+ }
457
+ }
458
+
459
+ /* Short landscape viewports: thin strip, no thumbnail, one-line description. */
460
+ @media (max-height: 30rem) {
461
+ .hagilight-promoto {
462
+ --promoto-cta-height: 2rem;
463
+ --promoto-pad: 0.5rem;
464
+ }
465
+
466
+ .hagilight-promoto__shell {
467
+ bottom: max(0.5rem, env(safe-area-inset-bottom));
468
+ }
469
+
470
+ .hagilight-promoto__media {
471
+ display: none;
472
+ }
473
+
474
+ .hagilight-promoto__slide[data-has-image] {
475
+ grid-template-columns: minmax(0, 1fr);
476
+ grid-template-areas: 'copy' 'cta';
477
+ row-gap: 0.375rem;
478
+ padding: 0.5rem 0.75rem 0.5rem 1rem;
479
+ }
480
+
481
+ .hagilight-promoto__description {
482
+ -webkit-line-clamp: 1;
483
+ }
484
+
485
+ .hagilight-promoto__dismiss {
486
+ inset-block-start: 0.25rem;
487
+ inset-inline-end: 0.25rem;
488
+ }
489
+ }
490
+
491
+ @media (prefers-reduced-motion: reduce) {
492
+ .hagilight-promoto__shell,
493
+ .hagilight-promoto__track,
494
+ .hagilight-promoto__slide > *,
495
+ .hagilight-promoto__dismiss,
496
+ .hagilight-promoto__control {
497
+ transition: none;
498
+ }
499
+
500
+ .hagilight-promoto__shell {
501
+ transform: none !important;
502
+ animation: none !important;
503
+ }
504
+
505
+ .hagilight-promoto__progress {
506
+ display: none;
507
+ }
508
+ }