@total_onion/onion-library 2.0.60 → 2.0.61
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/components/block-featured-image-gallery-v3/featured-image-gallery-v3.js +13 -6
- package/components/block-featured-image-gallery-v3/featured-image-gallery-v3.scss +40 -4
- package/components/block-featured-image-gallery-v3/featured-image-gallery-v3.twig +29 -8
- package/package.json +1 -1
- package/public/assetList.mjs +4 -5
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export default function featuredImagegalleryJs(options = {}) {
|
|
2
2
|
try {
|
|
3
3
|
const {block} = options;
|
|
4
|
+
const featuredImageContainer = block.querySelector(
|
|
5
|
+
`.featured-image-gallery-v3__featured-image-container`
|
|
6
|
+
);
|
|
4
7
|
const featuredImage = block.querySelector(
|
|
5
8
|
`.featured-image-gallery-v3__featured-image`
|
|
6
9
|
);
|
|
@@ -9,12 +12,16 @@ export default function featuredImagegalleryJs(options = {}) {
|
|
|
9
12
|
);
|
|
10
13
|
otherImages.forEach((image) => {
|
|
11
14
|
image.addEventListener('click', function updateSrc() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
this.getAttribute('
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
featuredImageContainer.classList.add('changing-image');
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
featuredImage.setAttribute('src', this.getAttribute('src'));
|
|
18
|
+
featuredImage.setAttribute('alt', this.getAttribute('alt'));
|
|
19
|
+
featuredImage.setAttribute(
|
|
20
|
+
'srcset',
|
|
21
|
+
this.getAttribute('srcset')
|
|
22
|
+
);
|
|
23
|
+
featuredImageContainer.classList.remove('changing-image');
|
|
24
|
+
}, 800);
|
|
18
25
|
});
|
|
19
26
|
});
|
|
20
27
|
} catch (error) {
|
|
@@ -13,6 +13,45 @@
|
|
|
13
13
|
grid-gap: core-functions-v3.fluidSize(10);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
&__featured-image-container {
|
|
17
|
+
perspective: 1000px;
|
|
18
|
+
&.changing-image
|
|
19
|
+
.featured-image-gallery-v3__featured-image-inner-container {
|
|
20
|
+
transform: rotateY(180deg);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&__featured-image-inner-container {
|
|
25
|
+
position: relative;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
text-align: center;
|
|
29
|
+
transition: transform 0.8s;
|
|
30
|
+
transform-style: preserve-3d;
|
|
31
|
+
}
|
|
32
|
+
&__featured-image-front,
|
|
33
|
+
&__featured-image-back {
|
|
34
|
+
position: absolute;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
backface-visibility: hidden;
|
|
38
|
+
}
|
|
39
|
+
&__featured-image-front {
|
|
40
|
+
background-color: #bbb;
|
|
41
|
+
color: black;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__featured-image-back {
|
|
45
|
+
display: grid;
|
|
46
|
+
place-items: center;
|
|
47
|
+
background-color: var(--bally-blue-dark);
|
|
48
|
+
transform: rotateY(180deg);
|
|
49
|
+
padding: core-functions-v3.fluidSize(20);
|
|
50
|
+
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
51
|
+
padding: core-functions-v3.fluidSize(120);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
16
55
|
&__featured-image {
|
|
17
56
|
grid-area: featured;
|
|
18
57
|
object-fit: cover;
|
|
@@ -28,13 +67,10 @@
|
|
|
28
67
|
place-self: stretch;
|
|
29
68
|
display: grid;
|
|
30
69
|
grid-gap: core-functions-v3.fluidSize(8);
|
|
31
|
-
grid-template-columns:
|
|
32
|
-
grid-template-rows: 1fr;
|
|
70
|
+
grid-template-columns: repeat(3, 1fr);
|
|
33
71
|
grid-auto-rows: 1fr;
|
|
34
72
|
@include core-mixins-v3.device(breakpoints.$tabPortrait) {
|
|
35
|
-
grid-auto-rows: unset;
|
|
36
73
|
grid-gap: core-functions-v3.fluidSize(10);
|
|
37
|
-
grid-template-rows: 1fr 1fr 1fr;
|
|
38
74
|
}
|
|
39
75
|
}
|
|
40
76
|
|
|
@@ -1,13 +1,34 @@
|
|
|
1
|
-
{% set
|
|
2
|
-
|
|
3
|
-
{% set
|
|
4
|
-
|
|
1
|
+
{% set blockClassName = "featured-image-gallery-v3" %}
|
|
2
|
+
|
|
3
|
+
{% set classNameEntryPoint = include('entry-points/entry-point-classes.twig', { fields: fields, block: block }, with_context = false) %}
|
|
4
|
+
{% set htmlEntryPoint = include('entry-points/entry-point-html-v3.twig', { fields: fields, block: block, blockClassName, blockClassName }, with_context = false) %}
|
|
5
|
+
{% set dataAttributeEntryPoint = include('entry-points/entry-point-data-attribute.twig', { fields: fields, block: block }, with_context = false) %}
|
|
6
|
+
{% set styleEntryPoint = include('entry-points/entry-point-style-v3.twig', { fields: fields, block: block, is_preview }, with_context = false) %}
|
|
7
|
+
{% set previewEntryPoint = include('entry-points/entry-point-preview-info.twig', { fields, block, displaytype, is_preview }, with_context = false) %}
|
|
8
|
+
{% set sectionStyles = styleEntryPoint %}
|
|
9
|
+
{{previewEntryPoint}}
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
<style>
|
|
12
|
+
.{{blockClassName}}.{{block.id}}{
|
|
13
|
+
{{sectionStyles}}
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
{% set images = fields.images %}
|
|
17
|
+
<section {{block.anchor ? "id=" ~ block.anchor : ''}} class="{{blockClassName}} {{classNameEntryPoint}} lazy-fade {{block.id}}" {{dataAttributeEntryPoint}} data-assetkey="{{blockClassName}}">
|
|
10
18
|
|
|
19
|
+
<div class="{{blockClassName}}__featured-image-container">
|
|
20
|
+
<div class="{{blockClassName}}__featured-image-inner-container">
|
|
21
|
+
{% set image = get_image(images[0].image) %}
|
|
22
|
+
{% set srcset = gt_image_srcset(image) %}
|
|
23
|
+
{% set mainImageSrc = gt_image_mainsrc(image) %}
|
|
24
|
+
<div class="{{blockClassName}}__featured-image-front">
|
|
25
|
+
<img loading="lazy" class="{{blockClassName}}__featured-image" srcset="{{srcset}}" width="500" height="500" src="{{mainImageSrc}}" sizes="(min-width: 1366px) 50vw, (min-width: 1024px) 400px, 90vw" alt="{{image.alt}}">
|
|
26
|
+
</div>
|
|
27
|
+
<div class="{{blockClassName}}__featured-image-back">
|
|
28
|
+
<img class="{{blockClassName}}__featured-image-back-logo" src="{{options.site_logos.site_logo.src}}">
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
11
32
|
|
|
12
33
|
<div class="{{blockClassName}}__other-images">
|
|
13
34
|
{% for image in images %}
|
package/package.json
CHANGED
package/public/assetList.mjs
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
const dynamicAssets = [
|
|
2
|
+
"./components/block-accent-image-v3/accent-image-v3.scss",
|
|
3
|
+
"./components/block-accordion-v3/accordion-v3.scss",
|
|
4
|
+
"./components/block-betterreviews-display-v3/betterreviews-display-v3.scss",
|
|
5
|
+
"./components/block-block-interactions-v3/block-interactions-v3.scss",
|
|
2
6
|
"./components/block-video-content-v3/video-content-v3.scss",
|
|
3
7
|
"./components/block-sub-group-container-v3/sub-group-container-v3.scss",
|
|
4
8
|
"./components/block-sticky-buy-cta-v3/sticky-buy-cta-v3.scss",
|
|
@@ -23,12 +27,7 @@ const dynamicAssets = [
|
|
|
23
27
|
"./components/block-divider-v3/divider-v3.scss",
|
|
24
28
|
"./components/block-cover-link-v3/cover-link-v3.scss",
|
|
25
29
|
"./components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.scss",
|
|
26
|
-
"./components/block-block-interactions-v3/block-interactions-v3.scss",
|
|
27
|
-
"./components/block-betterreviews-display-v3/betterreviews-display-v3.scss",
|
|
28
|
-
"./components/block-accordion-v3/accordion-v3.scss",
|
|
29
|
-
"./components/block-accent-image-v3/accent-image-v3.scss",
|
|
30
30
|
"./components/block-featured-image-gallery-v3/featured-image-gallery-v3.scss",
|
|
31
31
|
"./components/block-responsive-table-v3/responsive-table-v3.scss",
|
|
32
|
-
"./components/block-product-info-v3/product-info-v3.scss",
|
|
33
32
|
];
|
|
34
33
|
export default dynamicAssets;
|