@total_onion/onion-library 2.0.62 → 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.62",
3
+ "version": "2.0.63",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {