hr-design-system-handlebars 1.114.83 → 1.114.84
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/CHANGELOG.md +13 -0
- package/dist/assets/index.css +16 -3
- package/dist/assets/js/components/content/copytext/components/gallery/js/gallerySlider.alpine.js +27 -8
- package/dist/views/components/base/image/responsive_image.hbs +3 -2
- package/dist/views/components/content/copytext/components/gallery/galleryitem_copytext.hbs +8 -4
- package/dist/views/components/content/copytext/components/gallery/galleryitem_description_copytext.hbs +1 -1
- package/dist/views/components/content/copytext/components/gallery/galleryitem_figure.hbs +7 -4
- package/dist/views_static/components/base/image/responsive_image.hbs +3 -2
- package/dist/views_static/components/content/copytext/components/gallery/galleryitem_copytext.hbs +8 -4
- package/dist/views_static/components/content/copytext/components/gallery/galleryitem_description_copytext.hbs +1 -1
- package/dist/views_static/components/content/copytext/components/gallery/galleryitem_figure.hbs +7 -4
- package/package.json +1 -1
- package/src/stories/views/components/base/image/responsive_image.hbs +3 -2
- package/src/stories/views/components/content/copytext/components/gallery/galleryitem_copytext.hbs +8 -4
- package/src/stories/views/components/content/copytext/components/gallery/galleryitem_description_copytext.hbs +1 -1
- package/src/stories/views/components/content/copytext/components/gallery/galleryitem_figure.hbs +7 -4
- package/src/stories/views/components/content/copytext/components/gallery/js/gallerySlider.alpine.js +27 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# v1.114.84 (Wed Feb 05 2025)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- add spinning wheel loading and Fix issue two galleries [#1233](https://github.com/mumprod/hr-design-system-handlebars/pull/1233) (saad.elbaciri@hr.de [@selbaciri](https://github.com/selbaciri))
|
|
6
|
+
|
|
7
|
+
#### Authors: 2
|
|
8
|
+
|
|
9
|
+
- Saad El Baciri ([@selbaciri](https://github.com/selbaciri))
|
|
10
|
+
- selbaciri (saad.elbaciri@hr.de)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
1
14
|
# v1.114.83 (Wed Feb 05 2025)
|
|
2
15
|
|
|
3
16
|
#### 🐛 Bug Fix
|
package/dist/assets/index.css
CHANGED
|
@@ -3828,7 +3828,7 @@ article #commentList {
|
|
|
3828
3828
|
border-bottom-color: var(--color-secondary-ds);
|
|
3829
3829
|
}
|
|
3830
3830
|
.counter-reset {
|
|
3831
|
-
counter-reset:
|
|
3831
|
+
counter-reset: cnt1738773896776;
|
|
3832
3832
|
}
|
|
3833
3833
|
.animate-delay-100 {
|
|
3834
3834
|
--tw-animate-delay: 100ms;
|
|
@@ -3845,6 +3845,11 @@ article #commentList {
|
|
|
3845
3845
|
animation-duration: 500ms;
|
|
3846
3846
|
animation-duration: var(--tw-animate-duration);
|
|
3847
3847
|
}
|
|
3848
|
+
.animate-infinite {
|
|
3849
|
+
--tw-animate-iteration: infinite;
|
|
3850
|
+
animation-iteration-count: infinite;
|
|
3851
|
+
animation-iteration-count: var(--tw-animate-iteration);
|
|
3852
|
+
}
|
|
3848
3853
|
.animate-once {
|
|
3849
3854
|
--tw-animate-iteration: 1;
|
|
3850
3855
|
animation-iteration-count: 1;
|
|
@@ -4268,7 +4273,7 @@ html { scroll-behavior: smooth; }
|
|
|
4268
4273
|
--tw-ring-color: rgba(255, 255, 255, 0.5);
|
|
4269
4274
|
}
|
|
4270
4275
|
.-ordered {
|
|
4271
|
-
counter-increment:
|
|
4276
|
+
counter-increment: cnt1738773896776 1;
|
|
4272
4277
|
}
|
|
4273
4278
|
.-ordered::before {
|
|
4274
4279
|
position: absolute;
|
|
@@ -4286,7 +4291,7 @@ html { scroll-behavior: smooth; }
|
|
|
4286
4291
|
--tw-text-opacity: 1;
|
|
4287
4292
|
color: rgba(0, 0, 0, 1);
|
|
4288
4293
|
color: rgba(0, 0, 0, var(--tw-text-opacity));
|
|
4289
|
-
content: counter(
|
|
4294
|
+
content: counter(cnt1738773896776);
|
|
4290
4295
|
}
|
|
4291
4296
|
/*! ****************************/
|
|
4292
4297
|
/*! DataPolicy stuff */
|
|
@@ -7543,6 +7548,10 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
|
|
|
7543
7548
|
display: none;
|
|
7544
7549
|
}
|
|
7545
7550
|
|
|
7551
|
+
.md\:h-11 {
|
|
7552
|
+
height: 2.75rem;
|
|
7553
|
+
}
|
|
7554
|
+
|
|
7546
7555
|
.md\:h-12 {
|
|
7547
7556
|
height: 3rem;
|
|
7548
7557
|
}
|
|
@@ -7583,6 +7592,10 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
|
|
|
7583
7592
|
width: 25%;
|
|
7584
7593
|
}
|
|
7585
7594
|
|
|
7595
|
+
.md\:w-11 {
|
|
7596
|
+
width: 2.75rem;
|
|
7597
|
+
}
|
|
7598
|
+
|
|
7586
7599
|
.md\:w-12 {
|
|
7587
7600
|
width: 3rem;
|
|
7588
7601
|
}
|
package/dist/assets/js/components/content/copytext/components/gallery/js/gallerySlider.alpine.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function gallerySlider() {
|
|
1
|
+
export default function gallerySlider(gallerySelector) {
|
|
2
2
|
return {
|
|
3
3
|
slides: [],
|
|
4
4
|
captions: [],
|
|
@@ -8,23 +8,30 @@ export default function gallerySlider() {
|
|
|
8
8
|
touchStartX: null,
|
|
9
9
|
touchEndX: null,
|
|
10
10
|
swipeThreshold: 50,
|
|
11
|
+
loadedImages: [],
|
|
12
|
+
loading: true,
|
|
11
13
|
previous() {
|
|
12
14
|
this.animationEnabled = true;
|
|
13
15
|
this.slideToRight = false;
|
|
14
|
-
this.currentSlideIndex = (this.currentSlideIndex - 1 > 0) ? this.currentSlideIndex - 1 : this.slides.length;
|
|
16
|
+
this.currentSlideIndex = (this.currentSlideIndex - 1 > 0) ? this.currentSlideIndex - 1 : this.slides.length;
|
|
17
|
+
this.updateLoadingState(this.currentSlideIndex - 1);
|
|
15
18
|
},
|
|
16
|
-
next() {
|
|
19
|
+
next() {
|
|
17
20
|
if (this.slides.length > 0) {
|
|
18
21
|
this.animationEnabled = true;
|
|
19
22
|
this.slideToRight = true;
|
|
20
23
|
this.currentSlideIndex = (this.currentSlideIndex % this.slides.length) + 1;
|
|
21
24
|
}
|
|
25
|
+
this.updateLoadingState(this.currentSlideIndex - 1);
|
|
22
26
|
},
|
|
23
27
|
loadSlider() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
const galleryContainer = document.querySelector(`.${gallerySelector}`);
|
|
29
|
+
if (galleryContainer) {
|
|
30
|
+
this.slides = [...galleryContainer.querySelectorAll('.js-gallery-slider-image')];
|
|
31
|
+
this.slides.forEach((slide, index) => slide.setAttribute('x-show', `currentSlideIndex === ${index + 1}`));
|
|
32
|
+
this.captions = [...galleryContainer.querySelectorAll('.js-gallery-slider-caption')];
|
|
33
|
+
this.captions.forEach((caption, index) => caption.setAttribute('x-show', `currentSlideIndex === ${index + 1}`));
|
|
34
|
+
}
|
|
28
35
|
},
|
|
29
36
|
handleTouchStart(event) {
|
|
30
37
|
this.touchStartX = event.touches[0].clientX
|
|
@@ -43,7 +50,19 @@ export default function gallerySlider() {
|
|
|
43
50
|
this.touchStartX = null
|
|
44
51
|
this.touchEndX = null
|
|
45
52
|
}
|
|
53
|
+
},
|
|
54
|
+
handleImageLoad(event) {
|
|
55
|
+
const img = event.target;
|
|
56
|
+
if (img.complete) {
|
|
57
|
+
this.loading = false;
|
|
58
|
+
this.loadedImages.push(img);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
updateLoadingState(currentSlideIndex) {
|
|
62
|
+
const currentSlide = this.slides[currentSlideIndex];
|
|
63
|
+
if (currentSlide) {
|
|
64
|
+
this.loading = !this.loadedImages.includes(currentSlide.querySelector('.js-gallery-image'));
|
|
65
|
+
}
|
|
46
66
|
}
|
|
47
|
-
|
|
48
67
|
};
|
|
49
68
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
{{#with this.srcset}} srcset="{{this}}"{{/with}}>
|
|
21
21
|
{{/each}}
|
|
22
22
|
{{/with}}
|
|
23
|
-
<img {{#if ../_isWebview}}data-primary-type="hr-nt:image" data-image-id="{{nextRandom}}"{{/if}} class="w-full{{~#if ../_addClassImg}} {{../_addClassImg}}{{/if}}" loading="{{#if ../_noDelay}}auto{{else}}lazy{{/if}}"{{#if ../_noDelay}} fetchpriority="high"{{/if}} src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="{{#if ../_alttext}}{{../_alttext}}{{else}}{{../this.alttext}}{{/if}}" {{~#if ../_title}} title="{{../_title}}"{{~/if}} {{~#if ../_errorHandler }} onerror="this.onerror=null; {{../_errorHandler}}"{{/if}}>
|
|
23
|
+
<img {{#if ../_isWebview}}data-primary-type="hr-nt:image" data-image-id="{{nextRandom}}"{{/if}} class="w-full{{~#if ../_addClassImg}} {{../_addClassImg}}{{/if}}" loading="{{#if ../_noDelay}}auto{{else}}lazy{{/if}}"{{#if ../_noDelay}} fetchpriority="high"{{/if}} src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="{{#if ../_alttext}}{{../_alttext}}{{else}}{{../this.alttext}}{{/if}}" {{~#if ../_title}} title="{{../_title}}"{{~/if}} {{~#if ../_errorHandler }} onerror="this.onerror=null; {{../_errorHandler}}"{{/if}} {{~#if ../../_loadHandler}} x-on:load="{{../../_loadHandler}}" {{~/if}}>
|
|
24
24
|
</picture>
|
|
25
25
|
{{#unless _disableNoScript}}
|
|
26
26
|
<noscript>
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
alt="{{#if ../../_alttext}}{{../../_alttext}}{{else}}{{../../this.alttext}}{{/if}}"
|
|
50
50
|
class="w-full{{~#with ../../_addClassImg }} {{this}}{{/with}}"
|
|
51
51
|
{{~#if ../../_title}} title="{{../../_title}}"{{~/if}}
|
|
52
|
-
{{~#if ../../_errorHandler}} onerror="this.onerror=null; {{../../_errorHandler}}" {{~/if}}
|
|
52
|
+
{{~#if ../../_errorHandler}} onerror="this.onerror=null; {{../../_errorHandler}}" {{~/if}}
|
|
53
|
+
{{~#if ../../_loadHandler}} x-on:load="{{../../_loadHandler}}" {{~/if}}>
|
|
53
54
|
{{~#with ../../_addClass }}</div>{{/with}}
|
|
54
55
|
{{/with}}
|
|
55
56
|
{{/if}}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
{{~changeRandom~}}
|
|
1
2
|
{{~#with this.gallery ~}}
|
|
2
|
-
<div class="relative w-full overflow-hidden" x-on:touchstart="handleTouchStart($event)" x-on:touchmove="handleTouchMove($event)" x-on:touchend="handleTouchEnd()"
|
|
3
|
-
x-data="gallerySlider()"
|
|
3
|
+
<div class="relative w-full overflow-hidden js-gallery{{getRandom}}" x-on:touchstart="handleTouchStart($event)" x-on:touchmove="handleTouchMove($event)" x-on:touchend="handleTouchEnd()"
|
|
4
|
+
x-data="gallerySlider('js-gallery{{getRandom}}')"
|
|
4
5
|
x-init="loadSlider()"
|
|
5
6
|
ax-load
|
|
6
7
|
x-ignore
|
|
7
8
|
>
|
|
8
9
|
<div class="relative w-full select-none">
|
|
9
|
-
<div class="absolute top-0 bottom-0 left-0 right-0 ar-16-9">
|
|
10
|
+
<div class="absolute top-0 bottom-0 left-0 right-0 z-30 ar-16-9">
|
|
10
11
|
{{#> components/button/button _variant="transparent" _alpineClick="previous()" _css="absolute z-10 flex items-center justify-center left-4 bottom-4 sm:left-5 sm:bottom-5" _onBackground=true}}
|
|
11
12
|
{{> components/button/components/button_icon _icon="arrow-left" _iconmap="icons" _css="w-8 h-8 sm:w-11 sm:h-11 py-1 sm:py-2 fill-link dark:fill-link-dark" }}
|
|
12
13
|
{{/components/button/button}}
|
|
@@ -14,8 +15,11 @@
|
|
|
14
15
|
{{> components/button/components/button_icon _icon="arrow-right" _iconmap="icons" _css="w-8 h-8 sm:w-11 sm:h-11 py-1 sm:py-2 fill-link dark:fill-link-dark" }}
|
|
15
16
|
{{/components/button/button}}
|
|
16
17
|
</div>
|
|
18
|
+
<div class="absolute inset-0 z-20 flex items-center justify-center ar-16-9" aria-hidden="true" x-show="loading">
|
|
19
|
+
{{> components/base/image/icon _icon="loading" _addClass="animate-spin animate-infinite h-8 w-8 md:w-11 md:h-11 fill-link dark:fill-link-dark" }}
|
|
20
|
+
</div>
|
|
17
21
|
{{#each this.items}}
|
|
18
|
-
|
|
22
|
+
{{~> components/content/copytext/components/gallery/galleryitem_figure _mediaBacklinkToStoryTeaser=../../../this.toModel.mediaBacklinkToStoryTeaser-adjust_context _cssClassCaption=../../_cssClassCaption ~}}
|
|
19
23
|
{{/each}}
|
|
20
24
|
</div>
|
|
21
25
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<figcaption class="gallery-
|
|
1
|
+
<figcaption class="js-gallery-slider-caption">
|
|
2
2
|
{{~#> components/content/copytext/components/image/caption _isFullTextVisible=true _cssClassCaption=_cssClassCaption~}}
|
|
3
3
|
<span class="block font-bold">{{loca "gallery_image_number"}} {{this.number}}/{{this.totalNumber}} {{~#with this.title}} <span class="mx-1.5">|</span>{{this}}{{/with~}}</span>
|
|
4
4
|
{{#if this.caption}} {{~> components/content/copytext/components/image/image_caption_text~}} {{/if}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<figure {{#unless @first}} x-cloak {{/unless}}>
|
|
2
|
-
<div class="relative ar-16-9 gallery-
|
|
2
|
+
<div class="relative ar-16-9 js-gallery-slider-image animate-duration-500 animate-delay-100 animate-once animate-ease-in-out"
|
|
3
3
|
:class="animationEnabled ? (slideToRight ? 'animate-fade-left' : 'animate-fade-right') : ''">
|
|
4
4
|
{{~#if this.displayOriginal.isTrue ~}}
|
|
5
5
|
<div class="relative" aria-hidden="true">
|
|
@@ -16,16 +16,19 @@
|
|
|
16
16
|
_type="gallery"
|
|
17
17
|
_variant="portrait"
|
|
18
18
|
_addClass="absolute top-0 left-0 right-0 bottom-0"
|
|
19
|
-
_addClassImg="!w-auto h-full absolute left-1/2 -translate-x-1/2"
|
|
19
|
+
_addClassImg="!w-auto h-full absolute left-1/2 -translate-x-1/2 js-gallery-image"
|
|
20
20
|
_noDelay=(if @first true '')
|
|
21
|
-
_isWebview=true
|
|
21
|
+
_isWebview=true
|
|
22
|
+
_loadHandler="handleImageLoad($event)"}}
|
|
22
23
|
{{else}}
|
|
23
24
|
{{> components/base/image/responsive_image
|
|
24
25
|
_type="gallery"
|
|
25
26
|
_variant="default"
|
|
26
27
|
_addClass="ar-16-9"
|
|
28
|
+
_addClassImg="js-gallery-image"
|
|
27
29
|
_noDelay=(if @first true '')
|
|
28
|
-
_isWebview=true
|
|
30
|
+
_isWebview=true
|
|
31
|
+
_loadHandler="handleImageLoad($event)"}}
|
|
29
32
|
{{~/if~}}
|
|
30
33
|
</div>
|
|
31
34
|
{{~> components/content/copytext/components/gallery/galleryitem_description_copytext _mediaBacklinkToStoryTeaser=_mediaBacklinkToStoryTeaser _cssClassCaption=_cssClassCaption~}}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
{{#with this.srcset}} srcset="{{this}}"{{/with}}>
|
|
21
21
|
{{/each}}
|
|
22
22
|
{{/with}}
|
|
23
|
-
<img {{#if ../_isWebview}}data-primary-type="hr-nt:image" data-image-id="{{nextRandom}}"{{/if}} class="w-full{{~#if ../_addClassImg}} {{../_addClassImg}}{{/if}}" loading="{{#if ../_noDelay}}auto{{else}}lazy{{/if}}"{{#if ../_noDelay}} fetchpriority="high"{{/if}} src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="{{#if ../_alttext}}{{../_alttext}}{{else}}{{../this.alttext}}{{/if}}" {{~#if ../_title}} title="{{../_title}}"{{~/if}} {{~#if ../_errorHandler }} onerror="this.onerror=null; {{../_errorHandler}}"{{/if}}>
|
|
23
|
+
<img {{#if ../_isWebview}}data-primary-type="hr-nt:image" data-image-id="{{nextRandom}}"{{/if}} class="w-full{{~#if ../_addClassImg}} {{../_addClassImg}}{{/if}}" loading="{{#if ../_noDelay}}auto{{else}}lazy{{/if}}"{{#if ../_noDelay}} fetchpriority="high"{{/if}} src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="{{#if ../_alttext}}{{../_alttext}}{{else}}{{../this.alttext}}{{/if}}" {{~#if ../_title}} title="{{../_title}}"{{~/if}} {{~#if ../_errorHandler }} onerror="this.onerror=null; {{../_errorHandler}}"{{/if}} {{~#if ../../_loadHandler}} x-on:load="{{../../_loadHandler}}" {{~/if}}>
|
|
24
24
|
</picture>
|
|
25
25
|
{{#unless _disableNoScript}}
|
|
26
26
|
<noscript>
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
alt="{{#if ../../_alttext}}{{../../_alttext}}{{else}}{{../../this.alttext}}{{/if}}"
|
|
50
50
|
class="w-full{{~#with ../../_addClassImg }} {{this}}{{/with}}"
|
|
51
51
|
{{~#if ../../_title}} title="{{../../_title}}"{{~/if}}
|
|
52
|
-
{{~#if ../../_errorHandler}} onerror="this.onerror=null; {{../../_errorHandler}}" {{~/if}}
|
|
52
|
+
{{~#if ../../_errorHandler}} onerror="this.onerror=null; {{../../_errorHandler}}" {{~/if}}
|
|
53
|
+
{{~#if ../../_loadHandler}} x-on:load="{{../../_loadHandler}}" {{~/if}}>
|
|
53
54
|
{{~#with ../../_addClass }}</div>{{/with}}
|
|
54
55
|
{{/with}}
|
|
55
56
|
{{/if}}
|
package/dist/views_static/components/content/copytext/components/gallery/galleryitem_copytext.hbs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
{{~changeRandom~}}
|
|
1
2
|
{{~#with this.gallery ~}}
|
|
2
|
-
<div class="relative w-full overflow-hidden" x-on:touchstart="handleTouchStart($event)" x-on:touchmove="handleTouchMove($event)" x-on:touchend="handleTouchEnd()"
|
|
3
|
-
x-data="gallerySlider()"
|
|
3
|
+
<div class="relative w-full overflow-hidden js-gallery{{getRandom}}" x-on:touchstart="handleTouchStart($event)" x-on:touchmove="handleTouchMove($event)" x-on:touchend="handleTouchEnd()"
|
|
4
|
+
x-data="gallerySlider('js-gallery{{getRandom}}')"
|
|
4
5
|
x-init="loadSlider()"
|
|
5
6
|
ax-load
|
|
6
7
|
x-ignore
|
|
7
8
|
>
|
|
8
9
|
<div class="relative w-full select-none">
|
|
9
|
-
<div class="absolute top-0 bottom-0 left-0 right-0 ar-16-9">
|
|
10
|
+
<div class="absolute top-0 bottom-0 left-0 right-0 z-30 ar-16-9">
|
|
10
11
|
{{#> components/button/button _variant="transparent" _alpineClick="previous()" _css="absolute z-10 flex items-center justify-center left-4 bottom-4 sm:left-5 sm:bottom-5" _onBackground=true}}
|
|
11
12
|
{{> components/button/components/button_icon _icon="arrow-left" _iconmap="icons" _css="w-8 h-8 sm:w-11 sm:h-11 py-1 sm:py-2 fill-link dark:fill-link-dark" }}
|
|
12
13
|
{{/components/button/button}}
|
|
@@ -14,8 +15,11 @@
|
|
|
14
15
|
{{> components/button/components/button_icon _icon="arrow-right" _iconmap="icons" _css="w-8 h-8 sm:w-11 sm:h-11 py-1 sm:py-2 fill-link dark:fill-link-dark" }}
|
|
15
16
|
{{/components/button/button}}
|
|
16
17
|
</div>
|
|
18
|
+
<div class="absolute inset-0 z-20 flex items-center justify-center ar-16-9" aria-hidden="true" x-show="loading">
|
|
19
|
+
{{> components/base/image/icon _icon="loading" _addClass="animate-spin animate-infinite h-8 w-8 md:w-11 md:h-11 fill-link dark:fill-link-dark" }}
|
|
20
|
+
</div>
|
|
17
21
|
{{#each this.items}}
|
|
18
|
-
|
|
22
|
+
{{~> components/content/copytext/components/gallery/galleryitem_figure _mediaBacklinkToStoryTeaser=../../this.toModel.mediaBacklinkToStoryTeaser _cssClassCaption=../../_cssClassCaption ~}}
|
|
19
23
|
{{/each}}
|
|
20
24
|
</div>
|
|
21
25
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<figcaption class="gallery-
|
|
1
|
+
<figcaption class="js-gallery-slider-caption">
|
|
2
2
|
{{~#> components/content/copytext/components/image/caption _isFullTextVisible=true _cssClassCaption=_cssClassCaption~}}
|
|
3
3
|
<span class="block font-bold">{{loca "gallery_image_number"}} {{this.number}}/{{this.totalNumber}} {{~#with this.title}} <span class="mx-1.5">|</span>{{this}}{{/with~}}</span>
|
|
4
4
|
{{#if this.caption}} {{~> components/content/copytext/components/image/image_caption_text~}} {{/if}}
|
package/dist/views_static/components/content/copytext/components/gallery/galleryitem_figure.hbs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<figure {{#unless @first}} x-cloak {{/unless}}>
|
|
2
|
-
<div class="relative ar-16-9 gallery-
|
|
2
|
+
<div class="relative ar-16-9 js-gallery-slider-image animate-duration-500 animate-delay-100 animate-once animate-ease-in-out"
|
|
3
3
|
:class="animationEnabled ? (slideToRight ? 'animate-fade-left' : 'animate-fade-right') : ''">
|
|
4
4
|
{{~#if this.displayOriginal.isTrue ~}}
|
|
5
5
|
<div class="relative" aria-hidden="true">
|
|
@@ -16,16 +16,19 @@
|
|
|
16
16
|
_type="gallery"
|
|
17
17
|
_variant="portrait"
|
|
18
18
|
_addClass="absolute top-0 left-0 right-0 bottom-0"
|
|
19
|
-
_addClassImg="!w-auto h-full absolute left-1/2 -translate-x-1/2"
|
|
19
|
+
_addClassImg="!w-auto h-full absolute left-1/2 -translate-x-1/2 js-gallery-image"
|
|
20
20
|
_noDelay=(if @first true '')
|
|
21
|
-
_isWebview=true
|
|
21
|
+
_isWebview=true
|
|
22
|
+
_loadHandler="handleImageLoad($event)"}}
|
|
22
23
|
{{else}}
|
|
23
24
|
{{> components/base/image/responsive_image
|
|
24
25
|
_type="gallery"
|
|
25
26
|
_variant="default"
|
|
26
27
|
_addClass="ar-16-9"
|
|
28
|
+
_addClassImg="js-gallery-image"
|
|
27
29
|
_noDelay=(if @first true '')
|
|
28
|
-
_isWebview=true
|
|
30
|
+
_isWebview=true
|
|
31
|
+
_loadHandler="handleImageLoad($event)"}}
|
|
29
32
|
{{~/if~}}
|
|
30
33
|
</div>
|
|
31
34
|
{{~> components/content/copytext/components/gallery/galleryitem_description_copytext _mediaBacklinkToStoryTeaser=_mediaBacklinkToStoryTeaser _cssClassCaption=_cssClassCaption~}}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"repository": "https://github.com/szuelch/hr-design-system-handlebars",
|
|
9
|
-
"version": "1.114.
|
|
9
|
+
"version": "1.114.84",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "storybook dev -p 6006 public",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
{{#with this.srcset}} srcset="{{this}}"{{/with}}>
|
|
21
21
|
{{/each}}
|
|
22
22
|
{{/with}}
|
|
23
|
-
<img {{#if ../_isWebview}}data-primary-type="hr-nt:image" data-image-id="{{nextRandom}}"{{/if}} class="w-full{{~#if ../_addClassImg}} {{../_addClassImg}}{{/if}}" loading="{{#if ../_noDelay}}auto{{else}}lazy{{/if}}"{{#if ../_noDelay}} fetchpriority="high"{{/if}} src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="{{#if ../_alttext}}{{../_alttext}}{{else}}{{../this.alttext}}{{/if}}" {{~#if ../_title}} title="{{../_title}}"{{~/if}} {{~#if ../_errorHandler }} onerror="this.onerror=null; {{../_errorHandler}}"{{/if}}>
|
|
23
|
+
<img {{#if ../_isWebview}}data-primary-type="hr-nt:image" data-image-id="{{nextRandom}}"{{/if}} class="w-full{{~#if ../_addClassImg}} {{../_addClassImg}}{{/if}}" loading="{{#if ../_noDelay}}auto{{else}}lazy{{/if}}"{{#if ../_noDelay}} fetchpriority="high"{{/if}} src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="{{#if ../_alttext}}{{../_alttext}}{{else}}{{../this.alttext}}{{/if}}" {{~#if ../_title}} title="{{../_title}}"{{~/if}} {{~#if ../_errorHandler }} onerror="this.onerror=null; {{../_errorHandler}}"{{/if}} {{~#if ../../_loadHandler}} x-on:load="{{../../_loadHandler}}" {{~/if}}>
|
|
24
24
|
</picture>
|
|
25
25
|
{{#unless _disableNoScript}}
|
|
26
26
|
<noscript>
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
alt="{{#if ../../_alttext}}{{../../_alttext}}{{else}}{{../../this.alttext}}{{/if}}"
|
|
50
50
|
class="w-full{{~#with ../../_addClassImg }} {{this}}{{/with}}"
|
|
51
51
|
{{~#if ../../_title}} title="{{../../_title}}"{{~/if}}
|
|
52
|
-
{{~#if ../../_errorHandler}} onerror="this.onerror=null; {{../../_errorHandler}}" {{~/if}}
|
|
52
|
+
{{~#if ../../_errorHandler}} onerror="this.onerror=null; {{../../_errorHandler}}" {{~/if}}
|
|
53
|
+
{{~#if ../../_loadHandler}} x-on:load="{{../../_loadHandler}}" {{~/if}}>
|
|
53
54
|
{{~#with ../../_addClass }}</div>{{/with}}
|
|
54
55
|
{{/with}}
|
|
55
56
|
{{/if}}
|
package/src/stories/views/components/content/copytext/components/gallery/galleryitem_copytext.hbs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
{{~changeRandom~}}
|
|
1
2
|
{{~#with this.gallery ~}}
|
|
2
|
-
<div class="relative w-full overflow-hidden" x-on:touchstart="handleTouchStart($event)" x-on:touchmove="handleTouchMove($event)" x-on:touchend="handleTouchEnd()"
|
|
3
|
-
x-data="gallerySlider()"
|
|
3
|
+
<div class="relative w-full overflow-hidden js-gallery{{getRandom}}" x-on:touchstart="handleTouchStart($event)" x-on:touchmove="handleTouchMove($event)" x-on:touchend="handleTouchEnd()"
|
|
4
|
+
x-data="gallerySlider('js-gallery{{getRandom}}')"
|
|
4
5
|
x-init="loadSlider()"
|
|
5
6
|
ax-load
|
|
6
7
|
x-ignore
|
|
7
8
|
>
|
|
8
9
|
<div class="relative w-full select-none">
|
|
9
|
-
<div class="absolute top-0 bottom-0 left-0 right-0 ar-16-9">
|
|
10
|
+
<div class="absolute top-0 bottom-0 left-0 right-0 z-30 ar-16-9">
|
|
10
11
|
{{#> components/button/button _variant="transparent" _alpineClick="previous()" _css="absolute z-10 flex items-center justify-center left-4 bottom-4 sm:left-5 sm:bottom-5" _onBackground=true}}
|
|
11
12
|
{{> components/button/components/button_icon _icon="arrow-left" _iconmap="icons" _css="w-8 h-8 sm:w-11 sm:h-11 py-1 sm:py-2 fill-link dark:fill-link-dark" }}
|
|
12
13
|
{{/components/button/button}}
|
|
@@ -14,8 +15,11 @@
|
|
|
14
15
|
{{> components/button/components/button_icon _icon="arrow-right" _iconmap="icons" _css="w-8 h-8 sm:w-11 sm:h-11 py-1 sm:py-2 fill-link dark:fill-link-dark" }}
|
|
15
16
|
{{/components/button/button}}
|
|
16
17
|
</div>
|
|
18
|
+
<div class="absolute inset-0 z-20 flex items-center justify-center ar-16-9" aria-hidden="true" x-show="loading">
|
|
19
|
+
{{> components/base/image/icon _icon="loading" _addClass="animate-spin animate-infinite h-8 w-8 md:w-11 md:h-11 fill-link dark:fill-link-dark" }}
|
|
20
|
+
</div>
|
|
17
21
|
{{#each this.items}}
|
|
18
|
-
|
|
22
|
+
{{~> components/content/copytext/components/gallery/galleryitem_figure _mediaBacklinkToStoryTeaser=../../this.toModel.mediaBacklinkToStoryTeaser-adjust_context _cssClassCaption=../../_cssClassCaption ~}}
|
|
19
23
|
{{/each}}
|
|
20
24
|
</div>
|
|
21
25
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<figcaption class="gallery-
|
|
1
|
+
<figcaption class="js-gallery-slider-caption">
|
|
2
2
|
{{~#> components/content/copytext/components/image/caption _isFullTextVisible=true _cssClassCaption=_cssClassCaption~}}
|
|
3
3
|
<span class="block font-bold">{{loca "gallery_image_number"}} {{this.number}}/{{this.totalNumber}} {{~#with this.title}} <span class="mx-1.5">|</span>{{this}}{{/with~}}</span>
|
|
4
4
|
{{#if this.caption}} {{~> components/content/copytext/components/image/image_caption_text~}} {{/if}}
|
package/src/stories/views/components/content/copytext/components/gallery/galleryitem_figure.hbs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<figure {{#unless @first}} x-cloak {{/unless}}>
|
|
2
|
-
<div class="relative ar-16-9 gallery-
|
|
2
|
+
<div class="relative ar-16-9 js-gallery-slider-image animate-duration-500 animate-delay-100 animate-once animate-ease-in-out"
|
|
3
3
|
:class="animationEnabled ? (slideToRight ? 'animate-fade-left' : 'animate-fade-right') : ''">
|
|
4
4
|
{{~#if this.displayOriginal.isTrue ~}}
|
|
5
5
|
<div class="relative" aria-hidden="true">
|
|
@@ -16,16 +16,19 @@
|
|
|
16
16
|
_type="gallery"
|
|
17
17
|
_variant="portrait"
|
|
18
18
|
_addClass="absolute top-0 left-0 right-0 bottom-0"
|
|
19
|
-
_addClassImg="!w-auto h-full absolute left-1/2 -translate-x-1/2"
|
|
19
|
+
_addClassImg="!w-auto h-full absolute left-1/2 -translate-x-1/2 js-gallery-image"
|
|
20
20
|
_noDelay=(if @first true '')
|
|
21
|
-
_isWebview=true
|
|
21
|
+
_isWebview=true
|
|
22
|
+
_loadHandler="handleImageLoad($event)"}}
|
|
22
23
|
{{else}}
|
|
23
24
|
{{> components/base/image/responsive_image
|
|
24
25
|
_type="gallery"
|
|
25
26
|
_variant="default"
|
|
26
27
|
_addClass="ar-16-9"
|
|
28
|
+
_addClassImg="js-gallery-image"
|
|
27
29
|
_noDelay=(if @first true '')
|
|
28
|
-
_isWebview=true
|
|
30
|
+
_isWebview=true
|
|
31
|
+
_loadHandler="handleImageLoad($event)"}}
|
|
29
32
|
{{~/if~}}
|
|
30
33
|
</div>
|
|
31
34
|
{{~> components/content/copytext/components/gallery/galleryitem_description_copytext _mediaBacklinkToStoryTeaser=_mediaBacklinkToStoryTeaser _cssClassCaption=_cssClassCaption~}}
|
package/src/stories/views/components/content/copytext/components/gallery/js/gallerySlider.alpine.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function gallerySlider() {
|
|
1
|
+
export default function gallerySlider(gallerySelector) {
|
|
2
2
|
return {
|
|
3
3
|
slides: [],
|
|
4
4
|
captions: [],
|
|
@@ -8,23 +8,30 @@ export default function gallerySlider() {
|
|
|
8
8
|
touchStartX: null,
|
|
9
9
|
touchEndX: null,
|
|
10
10
|
swipeThreshold: 50,
|
|
11
|
+
loadedImages: [],
|
|
12
|
+
loading: true,
|
|
11
13
|
previous() {
|
|
12
14
|
this.animationEnabled = true;
|
|
13
15
|
this.slideToRight = false;
|
|
14
|
-
this.currentSlideIndex = (this.currentSlideIndex - 1 > 0) ? this.currentSlideIndex - 1 : this.slides.length;
|
|
16
|
+
this.currentSlideIndex = (this.currentSlideIndex - 1 > 0) ? this.currentSlideIndex - 1 : this.slides.length;
|
|
17
|
+
this.updateLoadingState(this.currentSlideIndex - 1);
|
|
15
18
|
},
|
|
16
|
-
next() {
|
|
19
|
+
next() {
|
|
17
20
|
if (this.slides.length > 0) {
|
|
18
21
|
this.animationEnabled = true;
|
|
19
22
|
this.slideToRight = true;
|
|
20
23
|
this.currentSlideIndex = (this.currentSlideIndex % this.slides.length) + 1;
|
|
21
24
|
}
|
|
25
|
+
this.updateLoadingState(this.currentSlideIndex - 1);
|
|
22
26
|
},
|
|
23
27
|
loadSlider() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
const galleryContainer = document.querySelector(`.${gallerySelector}`);
|
|
29
|
+
if (galleryContainer) {
|
|
30
|
+
this.slides = [...galleryContainer.querySelectorAll('.js-gallery-slider-image')];
|
|
31
|
+
this.slides.forEach((slide, index) => slide.setAttribute('x-show', `currentSlideIndex === ${index + 1}`));
|
|
32
|
+
this.captions = [...galleryContainer.querySelectorAll('.js-gallery-slider-caption')];
|
|
33
|
+
this.captions.forEach((caption, index) => caption.setAttribute('x-show', `currentSlideIndex === ${index + 1}`));
|
|
34
|
+
}
|
|
28
35
|
},
|
|
29
36
|
handleTouchStart(event) {
|
|
30
37
|
this.touchStartX = event.touches[0].clientX
|
|
@@ -43,7 +50,19 @@ export default function gallerySlider() {
|
|
|
43
50
|
this.touchStartX = null
|
|
44
51
|
this.touchEndX = null
|
|
45
52
|
}
|
|
53
|
+
},
|
|
54
|
+
handleImageLoad(event) {
|
|
55
|
+
const img = event.target;
|
|
56
|
+
if (img.complete) {
|
|
57
|
+
this.loading = false;
|
|
58
|
+
this.loadedImages.push(img);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
updateLoadingState(currentSlideIndex) {
|
|
62
|
+
const currentSlide = this.slides[currentSlideIndex];
|
|
63
|
+
if (currentSlide) {
|
|
64
|
+
this.loading = !this.loadedImages.includes(currentSlide.querySelector('.js-gallery-image'));
|
|
65
|
+
}
|
|
46
66
|
}
|
|
47
|
-
|
|
48
67
|
};
|
|
49
68
|
}
|