@hagicode/hagilight-core 0.6.2-dev.77.1.2359fea → 0.7.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/PromotoBanner.astro +58 -69
- package/package.json +1 -1
package/PromotoBanner.astro
CHANGED
|
@@ -58,16 +58,19 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
58
58
|
|
|
59
59
|
<style is:global>
|
|
60
60
|
/*
|
|
61
|
-
* Layout model: the card
|
|
62
|
-
* call to action
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
61
|
+
* Layout model: the card is content on top, one action row on the bottom.
|
|
62
|
+
* The call to action sits bottom-left; pager and pause share that row at the
|
|
63
|
+
* bottom-right, so controls never take a column or a row of their own. Dismiss
|
|
64
|
+
* is a small corner mark. Wide: media beside the copy. Portrait phones: a small
|
|
65
|
+
* thumbnail beside the title only. Short landscape viewports: no thumbnail and a
|
|
66
|
+
* one-line description, so the card stays a thin strip.
|
|
67
67
|
*/
|
|
68
68
|
.hagilight-promoto {
|
|
69
69
|
display: block;
|
|
70
70
|
--promoto-control-size: 1.75rem;
|
|
71
|
+
--promoto-cta-height: 2.25rem;
|
|
72
|
+
--promoto-pad: 0.875rem;
|
|
73
|
+
--promoto-pager-width: calc(3 * var(--promoto-control-size) + 2.25rem + 0.375rem);
|
|
71
74
|
--promoto-muted: var(--sl-color-gray-2, #4b5563);
|
|
72
75
|
}
|
|
73
76
|
|
|
@@ -82,10 +85,7 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
82
85
|
z-index: 40;
|
|
83
86
|
inset-inline: 0;
|
|
84
87
|
bottom: max(1rem, env(safe-area-inset-bottom));
|
|
85
|
-
|
|
86
|
-
grid-template-columns: minmax(0, 1fr) auto auto;
|
|
87
|
-
align-items: center;
|
|
88
|
-
width: min(72rem, calc(100vw - 1rem - 2 * max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))));
|
|
88
|
+
width: min(42rem, calc(100vw - 1rem - 2 * max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))));
|
|
89
89
|
margin-inline: auto;
|
|
90
90
|
overflow: hidden;
|
|
91
91
|
border: 1px solid color-mix(in srgb, var(--sl-color-accent, #2563eb) 24%, var(--sl-color-gray-5, #cbd5e1));
|
|
@@ -106,9 +106,6 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.hagilight-promoto__viewport {
|
|
109
|
-
grid-column: 1;
|
|
110
|
-
grid-row: 1;
|
|
111
|
-
min-width: 0;
|
|
112
109
|
overflow: hidden;
|
|
113
110
|
}
|
|
114
111
|
|
|
@@ -119,21 +116,26 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
119
116
|
transition: transform 0.34s ease;
|
|
120
117
|
}
|
|
121
118
|
|
|
122
|
-
/* Slide:
|
|
119
|
+
/* Slide: media beside copy and cta, so a tall image never opens a gap above the cta. The pager overlays the end of the cta row. */
|
|
123
120
|
.hagilight-promoto__slide {
|
|
124
121
|
display: grid;
|
|
125
|
-
grid-template-columns: auto minmax(0, 1fr)
|
|
126
|
-
grid-template-areas:
|
|
127
|
-
|
|
122
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
123
|
+
grid-template-areas:
|
|
124
|
+
'media copy'
|
|
125
|
+
'media cta';
|
|
126
|
+
align-items: start;
|
|
128
127
|
column-gap: 1rem;
|
|
128
|
+
row-gap: 0.75rem;
|
|
129
129
|
width: 100%;
|
|
130
130
|
min-width: 100%;
|
|
131
|
-
padding:
|
|
131
|
+
padding: var(--promoto-pad);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
.hagilight-promoto__slide:not([data-has-image='true']) {
|
|
135
|
-
grid-template-columns: minmax(0, 1fr)
|
|
136
|
-
grid-template-areas:
|
|
135
|
+
grid-template-columns: minmax(0, 1fr);
|
|
136
|
+
grid-template-areas:
|
|
137
|
+
'copy'
|
|
138
|
+
'cta';
|
|
137
139
|
padding-inline-start: 1.25rem;
|
|
138
140
|
}
|
|
139
141
|
|
|
@@ -158,6 +160,7 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
.hagilight-promoto__title {
|
|
163
|
+
padding-inline-end: 2rem;
|
|
161
164
|
color: var(--sl-color-text-high, var(--sl-color-gray-1, #111827));
|
|
162
165
|
font-size: var(--sl-text-base, 1rem);
|
|
163
166
|
font-weight: 700;
|
|
@@ -198,8 +201,9 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
198
201
|
display: inline-flex;
|
|
199
202
|
align-items: center;
|
|
200
203
|
justify-content: center;
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
justify-self: start;
|
|
205
|
+
max-width: min(100%, 16rem);
|
|
206
|
+
min-height: var(--promoto-cta-height);
|
|
203
207
|
padding: 0.4rem 1rem;
|
|
204
208
|
border: 1px solid color-mix(in srgb, var(--sl-color-accent-high, #1d4ed8) 30%, transparent);
|
|
205
209
|
border-radius: 999px;
|
|
@@ -212,17 +216,23 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
212
216
|
text-decoration: none;
|
|
213
217
|
}
|
|
214
218
|
|
|
219
|
+
.hagilight-promoto[data-multiple] .hagilight-promoto__cta {
|
|
220
|
+
max-width: min(16rem, calc(100% - var(--promoto-pager-width)));
|
|
221
|
+
}
|
|
222
|
+
|
|
215
223
|
.hagilight-promoto__cta:hover,
|
|
216
224
|
.hagilight-promoto__cta:focus-visible {
|
|
217
225
|
background: var(--sl-color-accent-high, #1d4ed8);
|
|
218
226
|
}
|
|
219
227
|
|
|
220
|
-
/*
|
|
228
|
+
/* Pager + pause: bottom-right, on the same row as the call to action. */
|
|
221
229
|
.hagilight-promoto__controls {
|
|
222
|
-
|
|
223
|
-
|
|
230
|
+
position: absolute;
|
|
231
|
+
inset-block-end: var(--promoto-pad);
|
|
232
|
+
inset-inline-end: 0.5rem;
|
|
224
233
|
display: flex;
|
|
225
234
|
align-items: center;
|
|
235
|
+
height: var(--promoto-cta-height);
|
|
226
236
|
gap: 0.125rem;
|
|
227
237
|
}
|
|
228
238
|
|
|
@@ -252,10 +262,11 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
252
262
|
inset-inline: 0;
|
|
253
263
|
}
|
|
254
264
|
|
|
265
|
+
/* Dismiss: a small corner mark, out of the content flow. */
|
|
255
266
|
.hagilight-promoto__dismiss {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
267
|
+
position: absolute;
|
|
268
|
+
inset-block-start: 0.375rem;
|
|
269
|
+
inset-inline-end: 0.375rem;
|
|
259
270
|
}
|
|
260
271
|
|
|
261
272
|
.hagilight-promoto__dismiss::before {
|
|
@@ -332,27 +343,24 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
332
343
|
}
|
|
333
344
|
}
|
|
334
345
|
|
|
335
|
-
/* Portrait phones
|
|
336
|
-
@media (max-width:
|
|
346
|
+
/* Portrait phones: thumbnail beside the title only; the description and the action row use the full width. */
|
|
347
|
+
@media (max-width: 36rem) and (min-height: 30rem) {
|
|
337
348
|
.hagilight-promoto {
|
|
338
349
|
--promoto-control-size: 2rem;
|
|
339
|
-
--promoto-
|
|
350
|
+
--promoto-pad: 0.75rem;
|
|
340
351
|
}
|
|
341
352
|
|
|
342
353
|
.hagilight-promoto__shell {
|
|
343
|
-
display: block;
|
|
344
354
|
bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
|
|
345
|
-
width: min(calc(100vw - 1rem - 2 * max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))),
|
|
355
|
+
width: min(calc(100vw - 1rem - 2 * max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))), 28rem);
|
|
346
356
|
border-radius: 0.875rem;
|
|
347
357
|
}
|
|
348
358
|
|
|
349
|
-
.hagilight-promoto__slide
|
|
350
|
-
.hagilight-promoto__slide:not([data-has-image='true']) {
|
|
359
|
+
.hagilight-promoto__slide[data-has-image] {
|
|
351
360
|
grid-template-columns: minmax(0, 1fr);
|
|
352
361
|
grid-template-areas: 'title' 'desc' 'cta';
|
|
353
|
-
align-items: start;
|
|
354
362
|
gap: 0.375rem;
|
|
355
|
-
padding:
|
|
363
|
+
padding: var(--promoto-pad);
|
|
356
364
|
}
|
|
357
365
|
|
|
358
366
|
.hagilight-promoto__slide[data-has-image='true'] {
|
|
@@ -369,7 +377,6 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
369
377
|
.hagilight-promoto__title {
|
|
370
378
|
grid-area: title;
|
|
371
379
|
align-self: center;
|
|
372
|
-
padding-inline-end: 1.75rem;
|
|
373
380
|
font-size: 0.95rem;
|
|
374
381
|
}
|
|
375
382
|
|
|
@@ -386,33 +393,9 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
386
393
|
}
|
|
387
394
|
|
|
388
395
|
.hagilight-promoto__cta {
|
|
389
|
-
justify-self: start;
|
|
390
396
|
margin-block-start: 0.25rem;
|
|
391
|
-
min-height: 2.25rem;
|
|
392
397
|
padding-inline: 0.875rem;
|
|
393
398
|
}
|
|
394
|
-
|
|
395
|
-
.hagilight-promoto[data-multiple] .hagilight-promoto__cta {
|
|
396
|
-
max-width: calc(100% - var(--promoto-pager-width));
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.hagilight-promoto__dismiss {
|
|
400
|
-
position: absolute;
|
|
401
|
-
inset-block-start: 0.375rem;
|
|
402
|
-
inset-inline-end: 0.375rem;
|
|
403
|
-
margin: 0;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.hagilight-promoto__controls {
|
|
407
|
-
position: absolute;
|
|
408
|
-
inset-block-end: 0.75rem;
|
|
409
|
-
inset-inline-end: 0.5rem;
|
|
410
|
-
gap: 0;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
.hagilight-promoto__count {
|
|
414
|
-
min-width: 2.25rem;
|
|
415
|
-
}
|
|
416
399
|
}
|
|
417
400
|
|
|
418
401
|
@media (max-width: 22.5rem) and (min-height: 30rem) {
|
|
@@ -429,8 +412,13 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
429
412
|
}
|
|
430
413
|
}
|
|
431
414
|
|
|
432
|
-
/* Short landscape viewports:
|
|
415
|
+
/* Short landscape viewports: thin strip, no thumbnail, one-line description. */
|
|
433
416
|
@media (max-height: 30rem) {
|
|
417
|
+
.hagilight-promoto {
|
|
418
|
+
--promoto-cta-height: 2rem;
|
|
419
|
+
--promoto-pad: 0.5rem;
|
|
420
|
+
}
|
|
421
|
+
|
|
434
422
|
.hagilight-promoto__shell {
|
|
435
423
|
bottom: max(0.5rem, env(safe-area-inset-bottom));
|
|
436
424
|
}
|
|
@@ -439,10 +427,10 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
439
427
|
display: none;
|
|
440
428
|
}
|
|
441
429
|
|
|
442
|
-
.hagilight-promoto__slide
|
|
443
|
-
|
|
444
|
-
grid-template-
|
|
445
|
-
|
|
430
|
+
.hagilight-promoto__slide[data-has-image] {
|
|
431
|
+
grid-template-columns: minmax(0, 1fr);
|
|
432
|
+
grid-template-areas: 'copy' 'cta';
|
|
433
|
+
row-gap: 0.375rem;
|
|
446
434
|
padding: 0.5rem 0.75rem 0.5rem 1rem;
|
|
447
435
|
}
|
|
448
436
|
|
|
@@ -450,8 +438,9 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
|
|
|
450
438
|
-webkit-line-clamp: 1;
|
|
451
439
|
}
|
|
452
440
|
|
|
453
|
-
.hagilight-
|
|
454
|
-
|
|
441
|
+
.hagilight-promoto__dismiss {
|
|
442
|
+
inset-block-start: 0.25rem;
|
|
443
|
+
inset-inline-end: 0.25rem;
|
|
455
444
|
}
|
|
456
445
|
}
|
|
457
446
|
|
package/package.json
CHANGED