@gemboss/gem-framework 0.9.3 → 0.10.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/README.md +75 -0
- package/dist/SOURCE.json +3 -3
- package/dist/gem-framework.css +27 -37
- package/dist/gem-runtime.js +45 -2
- package/dist/index.js +300 -57
- package/dist/plugins/hero-slideshow.js +5 -1
- package/dist/plugins/media-gallery.js +25 -0
- package/dist/plugins/sticky-atc.js +15 -1
- package/dist/primitives.css +9 -23
- package/dist/section-gate.js +3287 -1
- package/dist/sections.css +18 -14
- package/package.json +1 -1
|
@@ -27,8 +27,22 @@ function install({ document, window, target, mark, canListen, listen: __gemListe
|
|
|
27
27
|
};
|
|
28
28
|
update();
|
|
29
29
|
if (canListen(target)) __gemListen(target, 'scroll', update, { passive: true });
|
|
30
|
+
const priceEl = bar.querySelector && bar.querySelector('[data-gem-sticky-atc-price]');
|
|
31
|
+
const select = bar.querySelector && bar.querySelector('select');
|
|
32
|
+
const syncPrice = () => { if (!priceEl || !select) return; const opt = select.options && select.selectedIndex > -1 ? select.options[select.selectedIndex] : null; const price = opt && opt.getAttribute && opt.getAttribute('data-gem-variant-price'); if (price) priceEl.textContent = price; };
|
|
33
|
+
if (canListen(select)) __gemListen(select, 'change', syncPrice);
|
|
34
|
+
syncPrice();
|
|
30
35
|
const form = bar.querySelector && bar.querySelector('form');
|
|
31
|
-
if (canListen(form)) __gemListen(form, 'submit', () =>
|
|
36
|
+
if (canListen(form)) __gemListen(form, 'submit', (event) => {
|
|
37
|
+
if (!(form.hasAttribute && form.hasAttribute('action'))) {
|
|
38
|
+
if (event && event.preventDefault) event.preventDefault();
|
|
39
|
+
const choice = form.querySelector && form.querySelector('select');
|
|
40
|
+
const trigger = bar.querySelector && bar.querySelector('[data-gem-variant-id]');
|
|
41
|
+
const variantId = (choice && choice.value) || (trigger && trigger.getAttribute('data-gem-variant-id')) || undefined;
|
|
42
|
+
if (bar.dispatchEvent && typeof window.CustomEvent === 'function') bar.dispatchEvent(new window.CustomEvent('gem:cart:add', { bubbles: true, detail: { variantId, quantity: 1 } }));
|
|
43
|
+
}
|
|
44
|
+
api.emit('gem:sticky-atc:submit', { source: 'gem-runtime', id: bar.id || undefined });
|
|
45
|
+
});
|
|
32
46
|
bound += 1;
|
|
33
47
|
});
|
|
34
48
|
api.emit('gem:sticky-atc:ready', { source: 'gem-runtime', count: bound });
|
package/dist/primitives.css
CHANGED
|
@@ -93,9 +93,9 @@ a {
|
|
|
93
93
|
justify-content: center;
|
|
94
94
|
min-height: var(--gem-component-input-height, 44px);
|
|
95
95
|
border: var(--gem-button-border-width, 1px) solid var(--gem-color-border);
|
|
96
|
-
border-radius: var(--gem-radius-md);
|
|
96
|
+
border-radius: var(--gem-radius-button, var(--gem-radius-md));
|
|
97
97
|
padding: var(--gem-component-button-padding-block, 12px) var(--gem-component-button-padding-inline, 18px);
|
|
98
|
-
font-weight: 700;
|
|
98
|
+
font-weight: var(--gem-font-button-weight, 700);
|
|
99
99
|
text-decoration: none;
|
|
100
100
|
transition: background var(--gem-motion-duration, 160ms) var(--gem-motion-easing, ease), color var(--gem-motion-duration, 160ms) var(--gem-motion-easing, ease);
|
|
101
101
|
}
|
|
@@ -373,23 +373,6 @@ a {
|
|
|
373
373
|
border-radius: var(--gem-radius-md);
|
|
374
374
|
background: color-mix(in srgb, var(--gem-color-text) 8%, var(--gem-color-background));
|
|
375
375
|
}
|
|
376
|
-
.gem-marquee {
|
|
377
|
-
overflow: hidden;
|
|
378
|
-
border-block: var(--gem-border-subtle, 1px solid var(--gem-color-border));
|
|
379
|
-
}
|
|
380
|
-
.gem-marquee__track {
|
|
381
|
-
display: flex;
|
|
382
|
-
gap: var(--gem-space-lg);
|
|
383
|
-
min-width: max-content;
|
|
384
|
-
animation: gem-marquee-scroll var(--gem-marquee-duration, 40s) linear infinite;
|
|
385
|
-
will-change: transform;
|
|
386
|
-
}
|
|
387
|
-
.gem-marquee:hover .gem-marquee__track {
|
|
388
|
-
animation-play-state: paused;
|
|
389
|
-
}
|
|
390
|
-
.gem-marquee[data-gem-marquee-reverse] .gem-marquee__track {
|
|
391
|
-
animation-direction: reverse;
|
|
392
|
-
}
|
|
393
376
|
.gem-carousel {
|
|
394
377
|
display: grid;
|
|
395
378
|
gap: var(--gem-space-md);
|
|
@@ -515,7 +498,10 @@ a {
|
|
|
515
498
|
overflow: hidden;
|
|
516
499
|
color: var(--gem-color-accent);
|
|
517
500
|
}
|
|
518
|
-
.gem-marquee {
|
|
501
|
+
.gem-marquee {
|
|
502
|
+
overflow: hidden;
|
|
503
|
+
border-block: var(--gem-border-subtle, 1px solid var(--gem-color-border));
|
|
504
|
+
}
|
|
519
505
|
.gem-marquee__viewport { display: flex; overflow: hidden; }
|
|
520
506
|
.gem-marquee__track {
|
|
521
507
|
flex: 0 0 auto;
|
|
@@ -526,9 +512,10 @@ a {
|
|
|
526
512
|
gap: var(--gem-space-lg);
|
|
527
513
|
white-space: nowrap;
|
|
528
514
|
animation: gem-marquee var(--gem-marquee-duration, 24s) linear infinite;
|
|
515
|
+
will-change: transform;
|
|
529
516
|
}
|
|
530
|
-
.gem-marquee__viewport:hover .gem-marquee__track { animation-play-state: paused; }
|
|
531
|
-
.gem-marquee--reverse .gem-marquee__track { animation-direction: reverse; }
|
|
517
|
+
.gem-marquee:hover .gem-marquee__track, .gem-marquee__viewport:hover .gem-marquee__track { animation-play-state: paused; }
|
|
518
|
+
.gem-marquee--reverse .gem-marquee__track, .gem-marquee[data-gem-marquee-reverse] .gem-marquee__track { animation-direction: reverse; }
|
|
532
519
|
@keyframes gem-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
|
|
533
520
|
@media (prefers-reduced-motion: reduce) {
|
|
534
521
|
.gem-marquee__track { animation: none; }
|
|
@@ -1042,7 +1029,6 @@ a {
|
|
|
1042
1029
|
@media (prefers-reduced-motion: reduce) {
|
|
1043
1030
|
[data-gem-ambient] { --gem-ambient-amp: 2px; animation-duration: 12s; }
|
|
1044
1031
|
[data-gem-reveal] { transition: none; opacity: 1; transform: none; }
|
|
1045
|
-
.gem-marquee__track { animation-duration: calc(var(--gem-marquee-duration, 40s) * 2.5); }
|
|
1046
1032
|
}
|
|
1047
1033
|
:is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-top], :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-bottom] { position: relative; overflow: clip; overflow-clip-margin: var(--gem-divider-height, 48px); }
|
|
1048
1034
|
:is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-bottom='wave']::after, :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-bottom='slope']::after, :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-bottom='spikes']::after, :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-bottom='arch']::after, :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-bottom='blob']::after, :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-top='wave']::before, :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-top='slope']::before, :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-top='spikes']::before, :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-top='arch']::before, :is(.gem-section, .gem-hero, .gem-hero-split, .gem-hero-collage, .gem-hero-triptych, .gem-slideshow)[data-gem-divider-top='blob']::before { content: ''; position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; height: var(--gem-divider-height, 48px); background: var(--gem-section-bg, var(--gem-color-background)); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
|