@total_onion/onion-library 2.0.61 → 2.0.63

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.
@@ -7,18 +7,32 @@ export default function featuredImagegalleryJs(options = {}) {
7
7
  const featuredImage = block.querySelector(
8
8
  `.featured-image-gallery-v3__featured-image`
9
9
  );
10
- const otherImages = block.querySelectorAll(
11
- `.featured-image-gallery-v3__image`
10
+ const thumbnailImages = block.querySelectorAll(
11
+ `.featured-image-gallery-v3__image-wrapper`
12
12
  );
13
- otherImages.forEach((image) => {
13
+ thumbnailImages.forEach((image) => {
14
14
  image.addEventListener('click', function updateSrc() {
15
+ thumbnailImages.forEach((wrapper) => {
16
+ wrapper.classList.remove(
17
+ 'featured-image-gallery-v3__image-wrapper--active'
18
+ );
19
+ });
20
+ image.classList.add(
21
+ 'featured-image-gallery-v3__image-wrapper--active'
22
+ );
15
23
  featuredImageContainer.classList.add('changing-image');
16
24
  setTimeout(() => {
17
- featuredImage.setAttribute('src', this.getAttribute('src'));
18
- featuredImage.setAttribute('alt', this.getAttribute('alt'));
25
+ featuredImage.setAttribute(
26
+ 'src',
27
+ this.querySelector('img').getAttribute('src')
28
+ );
29
+ featuredImage.setAttribute(
30
+ 'alt',
31
+ this.querySelector('img').getAttribute('alt')
32
+ );
19
33
  featuredImage.setAttribute(
20
34
  'srcset',
21
- this.getAttribute('srcset')
35
+ this.querySelector('img').getAttribute('srcset')
22
36
  );
23
37
  featuredImageContainer.classList.remove('changing-image');
24
38
  }, 800);
@@ -7,20 +7,21 @@
7
7
  grid-template:
8
8
  'featured'
9
9
  'other' / 1fr;
10
- grid-gap: core-functions-v3.fluidSize(var(--column-gap), 10);
10
+ gap: core-functions-v3.fluidSize(10);
11
11
  @include core-mixins-v3.device(breakpoints.$tabPortrait) {
12
12
  grid-template: 'featured other' / 1fr 1fr;
13
- grid-gap: core-functions-v3.fluidSize(10);
13
+ grid-gap: core-functions-v3.fluidSize(20);
14
14
  }
15
-
16
15
  &__featured-image-container {
17
16
  perspective: 1000px;
17
+ grid-area: featured;
18
+ place-self: stretch;
19
+ aspect-ratio: 1;
18
20
  &.changing-image
19
21
  .featured-image-gallery-v3__featured-image-inner-container {
20
22
  transform: rotateY(180deg);
21
23
  }
22
24
  }
23
-
24
25
  &__featured-image-inner-container {
25
26
  position: relative;
26
27
  width: 100%;
@@ -37,10 +38,8 @@
37
38
  backface-visibility: hidden;
38
39
  }
39
40
  &__featured-image-front {
40
- background-color: #bbb;
41
- color: black;
41
+ background-color: var(--bally-blue-dark);
42
42
  }
43
-
44
43
  &__featured-image-back {
45
44
  display: grid;
46
45
  place-items: center;
@@ -51,7 +50,6 @@
51
50
  padding: core-functions-v3.fluidSize(120);
52
51
  }
53
52
  }
54
-
55
53
  &__featured-image {
56
54
  grid-area: featured;
57
55
  object-fit: cover;
@@ -61,38 +59,34 @@
61
59
  height: auto;
62
60
  }
63
61
  }
64
-
65
62
  &__other-images {
66
63
  grid-area: other;
67
64
  place-self: stretch;
68
65
  display: grid;
66
+ aspect-ratio: 1;
69
67
  grid-gap: core-functions-v3.fluidSize(8);
70
68
  grid-template-columns: repeat(3, 1fr);
71
- grid-auto-rows: 1fr;
69
+ grid-template-rows: repeat(3, 1fr);
72
70
  @include core-mixins-v3.device(breakpoints.$tabPortrait) {
73
71
  grid-gap: core-functions-v3.fluidSize(10);
74
72
  }
75
73
  }
76
-
77
74
  &__image-wrapper {
78
75
  display: flex;
79
76
  overflow: hidden;
80
77
  box-shadow: 0px 0px 8px transparent;
81
78
  transition: box-shadow 0.2s;
82
- &:hover {
83
- box-shadow: 0px 0px 8px white;
84
- cursor: pointer;
79
+ cursor: pointer;
80
+ &:hover,
81
+ &--active {
82
+ box-shadow: 0px 0px 0px core-functions-v3.fluidSize(2) white;
85
83
  }
86
84
  }
87
-
88
85
  &__image {
89
86
  object-fit: cover;
90
87
  aspect-ratio: 1;
91
88
  width: 100%;
92
89
  height: auto;
93
- transition: transform 0.5s ease-out, filter 0.5s;
94
- &:hover {
95
- filter: contrast(105%);
96
- }
90
+ transition: transform 0.5s ease-out;
97
91
  }
98
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "2.0.61",
3
+ "version": "2.0.63",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,6 +9,45 @@
9
9
  grid-gap: calc(10 / var(--design-reference) * var(--screen-width));
10
10
  }
11
11
  }
12
+ .featured-image-gallery-v3__featured-image-container {
13
+ perspective: 1000px;
14
+ }
15
+ .featured-image-gallery-v3__featured-image-container.changing-image .featured-image-gallery-v3__featured-image-inner-container {
16
+ transform: rotateY(180deg);
17
+ }
18
+ .featured-image-gallery-v3__featured-image-inner-container {
19
+ position: relative;
20
+ width: 100%;
21
+ height: 100%;
22
+ text-align: center;
23
+ transition: transform 0.8s;
24
+ transform-style: preserve-3d;
25
+ }
26
+ .featured-image-gallery-v3__featured-image-front,
27
+ .featured-image-gallery-v3__featured-image-back {
28
+ position: absolute;
29
+ width: 100%;
30
+ height: 100%;
31
+ backface-visibility: hidden;
32
+ }
33
+ .featured-image-gallery-v3__featured-image-front {
34
+ background-color: #bbb;
35
+ color: black;
36
+ }
37
+ .featured-image-gallery-v3__featured-image-back {
38
+ display: grid;
39
+ align-items: center;
40
+ justify-items: center;
41
+ place-items: center;
42
+ background-color: var(--bally-blue-dark);
43
+ transform: rotateY(180deg);
44
+ padding: calc(20 / var(--design-reference) * var(--screen-width));
45
+ }
46
+ @media screen and (min-width: 768px) {
47
+ .featured-image-gallery-v3__featured-image-back {
48
+ padding: calc(120 / var(--design-reference) * var(--screen-width));
49
+ }
50
+ }
12
51
  .featured-image-gallery-v3__featured-image {
13
52
  grid-area: featured;
14
53
  -o-object-fit: cover;
@@ -28,15 +67,12 @@
28
67
  place-self: stretch;
29
68
  display: grid;
30
69
  grid-gap: calc(8 / var(--design-reference) * var(--screen-width));
31
- grid-template-columns: 1fr 1fr 1fr;
32
- grid-template-rows: 1fr;
70
+ grid-template-columns: repeat(3, 1fr);
33
71
  grid-auto-rows: 1fr;
34
72
  }
35
73
  @media screen and (min-width: 768px) {
36
74
  .featured-image-gallery-v3__other-images {
37
- grid-auto-rows: initial;
38
75
  grid-gap: calc(10 / var(--design-reference) * var(--screen-width));
39
- grid-template-rows: 1fr 1fr 1fr;
40
76
  }
41
77
  }
42
78
  .featured-image-gallery-v3__image-wrapper {