hr-design-system-handlebars 1.114.98 → 1.114.100
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 +25 -0
- package/dist/assets/index.css +11 -4
- package/dist/assets/js/alpine.js +1 -2
- package/dist/assets/js/components/mediaplayer/stickyPlayer.alpine.js +71 -0
- package/dist/views/components/mediaplayer/mediaPlayer_stickyWrapper.hbs +1 -75
- package/dist/views/components/page/components/metadatabox.hbs +2 -2
- package/dist/views/components/page/components/publicationdate.hbs +4 -0
- package/dist/views/components/page/ticker/ticker.hbs +8 -0
- package/dist/views_static/components/mediaplayer/mediaPlayer_stickyWrapper.hbs +1 -75
- package/dist/views_static/components/page/components/metadatabox.hbs +2 -2
- package/dist/views_static/components/page/components/publicationdate.hbs +4 -0
- package/dist/views_static/components/page/ticker/ticker.hbs +8 -0
- package/package.json +1 -1
- package/src/assets/css/custom-utilities.css +1 -1
- package/src/assets/js/alpine.js +1 -2
- package/src/stories/views/components/mediaplayer/mediaPlayer_stickyWrapper.hbs +1 -75
- package/src/stories/views/components/mediaplayer/stickyPlayer.alpine.js +71 -0
- package/src/stories/views/components/page/components/metadatabox.hbs +2 -2
- package/src/stories/views/components/page/components/publicationdate.hbs +4 -0
- package/src/stories/views/components/page/ticker/ticker.hbs +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
# v1.114.100 (Wed Feb 19 2025)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Enhance publication date handling and add ticker component [#1247](https://github.com/mumprod/hr-design-system-handlebars/pull/1247) ([@vascoeduardo](https://github.com/vascoeduardo) [@eduardo-hr](https://github.com/eduardo-hr))
|
|
6
|
+
|
|
7
|
+
#### Authors: 2
|
|
8
|
+
|
|
9
|
+
- [@eduardo-hr](https://github.com/eduardo-hr)
|
|
10
|
+
- Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# v1.114.99 (Wed Feb 19 2025)
|
|
15
|
+
|
|
16
|
+
#### 🐛 Bug Fix
|
|
17
|
+
|
|
18
|
+
- move sticky player script to main alpine.js script and load it async [#1246](https://github.com/mumprod/hr-design-system-handlebars/pull/1246) ([@StefanVesper](https://github.com/StefanVesper))
|
|
19
|
+
|
|
20
|
+
#### Authors: 1
|
|
21
|
+
|
|
22
|
+
- SonicSoulSurfer ([@StefanVesper](https://github.com/StefanVesper))
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
1
26
|
# v1.114.98 (Wed Feb 19 2025)
|
|
2
27
|
|
|
3
28
|
#### ⚠️ Pushed to `main`
|
package/dist/assets/index.css
CHANGED
|
@@ -3846,7 +3846,7 @@ article #commentList {
|
|
|
3846
3846
|
border-bottom-color: var(--color-secondary-ds);
|
|
3847
3847
|
}
|
|
3848
3848
|
.counter-reset {
|
|
3849
|
-
counter-reset:
|
|
3849
|
+
counter-reset: cnt1739969968897;
|
|
3850
3850
|
}
|
|
3851
3851
|
.animate-delay-100 {
|
|
3852
3852
|
--tw-animate-delay: 100ms;
|
|
@@ -4088,7 +4088,7 @@ html { scroll-behavior: smooth; }
|
|
|
4088
4088
|
minmax(var(--mobile-padding), var(--desktop-padding)) [full-width-end];
|
|
4089
4089
|
grid-column: main;
|
|
4090
4090
|
}
|
|
4091
|
-
.grid-article > :not(.article-breakout):not(.article-full-width):not(.sticky) {
|
|
4091
|
+
.grid-article > :not(.article-breakout):not(.article-full-width):not(.article-narrow):not(.sticky) {
|
|
4092
4092
|
grid-column: narrow;
|
|
4093
4093
|
}
|
|
4094
4094
|
.article-full-width {
|
|
@@ -4291,7 +4291,7 @@ html { scroll-behavior: smooth; }
|
|
|
4291
4291
|
--tw-ring-color: rgba(255, 255, 255, 0.5);
|
|
4292
4292
|
}
|
|
4293
4293
|
.-ordered {
|
|
4294
|
-
counter-increment:
|
|
4294
|
+
counter-increment: cnt1739969968897 1;
|
|
4295
4295
|
}
|
|
4296
4296
|
.-ordered::before {
|
|
4297
4297
|
position: absolute;
|
|
@@ -4309,7 +4309,7 @@ html { scroll-behavior: smooth; }
|
|
|
4309
4309
|
--tw-text-opacity: 1;
|
|
4310
4310
|
color: rgba(0, 0, 0, 1);
|
|
4311
4311
|
color: rgba(0, 0, 0, var(--tw-text-opacity));
|
|
4312
|
-
content: counter(
|
|
4312
|
+
content: counter(cnt1739969968897);
|
|
4313
4313
|
}
|
|
4314
4314
|
/*! ****************************/
|
|
4315
4315
|
/*! DataPolicy stuff */
|
|
@@ -8235,6 +8235,10 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
|
|
|
8235
8235
|
margin-bottom: 0.125rem;
|
|
8236
8236
|
}
|
|
8237
8237
|
|
|
8238
|
+
.lg\:mb-13 {
|
|
8239
|
+
margin-bottom: 3.25rem;
|
|
8240
|
+
}
|
|
8241
|
+
|
|
8238
8242
|
.lg\:ml-0 {
|
|
8239
8243
|
margin-left: 0px;
|
|
8240
8244
|
}
|
|
@@ -8665,6 +8669,9 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
|
|
|
8665
8669
|
minmax(0, 1fr) [full-end];
|
|
8666
8670
|
}
|
|
8667
8671
|
}
|
|
8672
|
+
.lg\:article-breakout {
|
|
8673
|
+
grid-column: content;
|
|
8674
|
+
}
|
|
8668
8675
|
|
|
8669
8676
|
.lg\:col-main {
|
|
8670
8677
|
grid-column: main;
|
package/dist/assets/js/alpine.js
CHANGED
|
@@ -10,14 +10,13 @@ import mainNavigationHandler from 'components/site_header/mainNavigationHandler.
|
|
|
10
10
|
import flyoutHandler from 'components/site_header/flyoutHandler.alpine'
|
|
11
11
|
import overlayHandler from 'components/site_header/overlayHandler.alpine'
|
|
12
12
|
import dropdown from 'components/site_header/dropdown.alpine'
|
|
13
|
-
|
|
14
13
|
|
|
15
14
|
AsyncAlpine.init(Alpine)
|
|
16
15
|
.data('podcastPlayer', () => import('components/podcast/podcast_player.alpine.js'))
|
|
17
16
|
.data('slider', () =>
|
|
18
17
|
import('components/horizontal_scroll_container/horizontal_scroll_container.alpine.js')
|
|
19
18
|
)
|
|
20
|
-
|
|
19
|
+
.data('stickyPlayer', () => import('components/mediaplayer/stickyPlayer.alpine.js'))
|
|
21
20
|
.data('socialSharingHandler', ()=> import('components/social_sharing/socialSharingHandler.alpine.js'))
|
|
22
21
|
.data('inputHandler', ()=> import('components/forms/js/inputHandler.alpine.js'))
|
|
23
22
|
.data('contactForm', ()=> import('components/forms/js/contactForm.alpine.js'))
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export default function stickyPlayer() {
|
|
2
|
+
return {
|
|
3
|
+
eventListenerInitialized: false,
|
|
4
|
+
inViewport: true,
|
|
5
|
+
videoStarted: false,
|
|
6
|
+
videoStoped: true,
|
|
7
|
+
videoPlaying: false,
|
|
8
|
+
videoWasStopedWhenSticky: false,
|
|
9
|
+
videoWasClosedByUser: false,
|
|
10
|
+
videoElement: null,
|
|
11
|
+
|
|
12
|
+
shouldVideoBeFixed: function () {
|
|
13
|
+
return (!this.inViewport && this.videoPlaying) || (!this.inViewport && this.videoWasStopedWhenSticky)
|
|
14
|
+
},
|
|
15
|
+
setupVideoEventListeners: function () {
|
|
16
|
+
console.log("setupVideoEventListeners");
|
|
17
|
+
if(!this.eventListenerInitialized) {
|
|
18
|
+
this.videoElement.addEventListener("play", () => {
|
|
19
|
+
console.log("video:play");
|
|
20
|
+
this.videoStarted = true;
|
|
21
|
+
this.videoPlaying = true;
|
|
22
|
+
this.videoStoped = false;
|
|
23
|
+
});
|
|
24
|
+
this.videoElement.addEventListener("pause", () => {
|
|
25
|
+
console.log("video:pause");
|
|
26
|
+
this.videoPlaying = false;
|
|
27
|
+
this.videoStoped = true;
|
|
28
|
+
if (!this.inViewport ) {
|
|
29
|
+
if(this.videoWasClosedByUser){
|
|
30
|
+
this.videoWasClosedByUser = false
|
|
31
|
+
} else {
|
|
32
|
+
this.videoWasStopedWhenSticky = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
this.eventListenerInitialized = true;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
closeVideo: function () {
|
|
40
|
+
this.videoWasStopedWhenSticky = false;
|
|
41
|
+
this.videoWasClosedByUser = true;
|
|
42
|
+
this.videoElement.pause();
|
|
43
|
+
},
|
|
44
|
+
init: function () {
|
|
45
|
+
this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
|
|
46
|
+
if(this.videoElement) {
|
|
47
|
+
this.setupVideoEventListeners();
|
|
48
|
+
} else {
|
|
49
|
+
console.log("No video element found in sticky player.");
|
|
50
|
+
const self = this; // Save a reference to the Alpine instance
|
|
51
|
+
const observer = new MutationObserver(function() {
|
|
52
|
+
console.log("MutationObserver: Mutation observed in sticky player.");
|
|
53
|
+
|
|
54
|
+
// Re-check for the video element
|
|
55
|
+
self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
|
|
56
|
+
if (self.videoElement) {
|
|
57
|
+
console.log(self.videoElement)
|
|
58
|
+
self.setupVideoEventListeners();
|
|
59
|
+
observer.disconnect(); // Stop observing after the video is found
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
observer.observe(this.$refs.videoElementWrapper, {
|
|
64
|
+
subtree: true,
|
|
65
|
+
childList: true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<div x-data="stickyPlayer" class="relative ar-16-9" x-intersect:leave.threshold.45="inViewport = false" x-intersect:enter.threshold.45="inViewport = true; videoWasStopedWhenSticky = false">
|
|
1
|
+
<div x-data="stickyPlayer" ax-load x-ignore class="relative ar-16-9" x-intersect:leave.threshold.45="inViewport = false" x-intersect:enter.threshold.45="inViewport = true; videoWasStopedWhenSticky = false">
|
|
3
2
|
<div x-ref="videoElementWrapper"
|
|
4
3
|
class="transition-all lg:transition-none right-4"
|
|
5
4
|
:class="{ 'ar-16-9 w-1/2 max-w-70 sm:w-70 fixed z-300 animate-fade-right animate-once animate-duration-1000': shouldVideoBeFixed(),
|
|
@@ -17,77 +16,4 @@
|
|
|
17
16
|
</div>
|
|
18
17
|
</button>
|
|
19
18
|
</div>
|
|
20
|
-
<script>
|
|
21
|
-
var stickyPlayer = () => {
|
|
22
|
-
return {
|
|
23
|
-
eventListenerInitialized: false,
|
|
24
|
-
inViewport: true,
|
|
25
|
-
videoStarted: false,
|
|
26
|
-
videoStoped: true,
|
|
27
|
-
videoPlaying: false,
|
|
28
|
-
videoWasStopedWhenSticky: false,
|
|
29
|
-
videoWasClosedByUser: false,
|
|
30
|
-
videoElement: null,
|
|
31
|
-
|
|
32
|
-
shouldVideoBeFixed: function () {
|
|
33
|
-
return (!this.inViewport && this.videoPlaying) || (!this.inViewport && this.videoWasStopedWhenSticky)
|
|
34
|
-
},
|
|
35
|
-
setupVideoEventListeners: function () {
|
|
36
|
-
console.log("setupVideoEventListeners");
|
|
37
|
-
if(!this.eventListenerInitialized) {
|
|
38
|
-
this.videoElement.addEventListener("play", () => {
|
|
39
|
-
console.log("video:play");
|
|
40
|
-
this.videoStarted = true;
|
|
41
|
-
this.videoPlaying = true;
|
|
42
|
-
this.videoStoped = false;
|
|
43
|
-
});
|
|
44
|
-
this.videoElement.addEventListener("pause", () => {
|
|
45
|
-
console.log("video:pause");
|
|
46
|
-
this.videoPlaying = false;
|
|
47
|
-
this.videoStoped = true;
|
|
48
|
-
if (!this.inViewport ) {
|
|
49
|
-
if(this.videoWasClosedByUser){
|
|
50
|
-
this.videoWasClosedByUser = false
|
|
51
|
-
} else {
|
|
52
|
-
this.videoWasStopedWhenSticky = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
this.eventListenerInitialized = true;
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
closeVideo: function () {
|
|
60
|
-
this.videoWasStopedWhenSticky = false;
|
|
61
|
-
this.videoWasClosedByUser = true;
|
|
62
|
-
this.videoElement.pause();
|
|
63
|
-
},
|
|
64
|
-
init: function () {
|
|
65
|
-
this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
|
|
66
|
-
if(this.videoElement) {
|
|
67
|
-
this.setupVideoEventListeners();
|
|
68
|
-
} else {
|
|
69
|
-
console.log("No video element found in sticky player.");
|
|
70
|
-
const self = this; // Save a reference to the Alpine instance
|
|
71
|
-
const observer = new MutationObserver(function() {
|
|
72
|
-
console.log("MutationObserver: Mutation observed in sticky player.");
|
|
73
|
-
|
|
74
|
-
// Re-check for the video element
|
|
75
|
-
self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
|
|
76
|
-
if (self.videoElement) {
|
|
77
|
-
console.log(self.videoElement)
|
|
78
|
-
self.setupVideoEventListeners();
|
|
79
|
-
observer.disconnect(); // Stop observing after the video is found
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
observer.observe(this.$refs.videoElementWrapper, {
|
|
84
|
-
subtree: true,
|
|
85
|
-
childList: true
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
</script>
|
|
93
19
|
</div>
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
{{#if _showDate }}
|
|
8
8
|
{{#if this.hasMoreThanOneAuthor}}
|
|
9
|
-
{{> components/page/components/publicationdate }}
|
|
9
|
+
{{> components/page/components/publicationdate _isTicker=_isTicker}}
|
|
10
10
|
{{else}}
|
|
11
11
|
{{#unless this.hasOneAuthor}}
|
|
12
|
-
{{> components/page/components/publicationdate }}
|
|
12
|
+
{{> components/page/components/publicationdate _isTicker=_isTicker}}
|
|
13
13
|
{{/unless}}
|
|
14
14
|
{{/if}}
|
|
15
15
|
{{/if}}
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
{{~else}}
|
|
8
8
|
{{#if this.isPublicationDate ~}}
|
|
9
9
|
<time datetime="{{this.htmlDateTime}}">{{loca "date_published" this.date this.time }}</time>
|
|
10
|
+
{{else}}
|
|
11
|
+
{{#if ../_isTicker ~}}
|
|
12
|
+
<time datetime="{{this.htmlDateTime}}">{{loca "date_lastChanged" this.date this.time }}</time>
|
|
13
|
+
{{~/if}}
|
|
10
14
|
{{~/if}}
|
|
11
15
|
{{~/if}}
|
|
12
16
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<article class="grid items-start bg-white dark:bg-black grid-article">
|
|
2
|
+
<div class="mb-6 lg:mb-13 article-narrow md:article-breakout">
|
|
3
|
+
header
|
|
4
|
+
</div>
|
|
5
|
+
<div class="c-ticker__timelineWrapper article-full-width lg:article-breakout">
|
|
6
|
+
section
|
|
7
|
+
</div>
|
|
8
|
+
</article>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<div x-data="stickyPlayer" class="relative ar-16-9" x-intersect:leave.threshold.45="inViewport = false" x-intersect:enter.threshold.45="inViewport = true; videoWasStopedWhenSticky = false">
|
|
1
|
+
<div x-data="stickyPlayer" ax-load x-ignore class="relative ar-16-9" x-intersect:leave.threshold.45="inViewport = false" x-intersect:enter.threshold.45="inViewport = true; videoWasStopedWhenSticky = false">
|
|
3
2
|
<div x-ref="videoElementWrapper"
|
|
4
3
|
class="transition-all lg:transition-none right-4"
|
|
5
4
|
:class="{ 'ar-16-9 w-1/2 max-w-70 sm:w-70 fixed z-300 animate-fade-right animate-once animate-duration-1000': shouldVideoBeFixed(),
|
|
@@ -17,77 +16,4 @@
|
|
|
17
16
|
</div>
|
|
18
17
|
</button>
|
|
19
18
|
</div>
|
|
20
|
-
<script>
|
|
21
|
-
var stickyPlayer = () => {
|
|
22
|
-
return {
|
|
23
|
-
eventListenerInitialized: false,
|
|
24
|
-
inViewport: true,
|
|
25
|
-
videoStarted: false,
|
|
26
|
-
videoStoped: true,
|
|
27
|
-
videoPlaying: false,
|
|
28
|
-
videoWasStopedWhenSticky: false,
|
|
29
|
-
videoWasClosedByUser: false,
|
|
30
|
-
videoElement: null,
|
|
31
|
-
|
|
32
|
-
shouldVideoBeFixed: function () {
|
|
33
|
-
return (!this.inViewport && this.videoPlaying) || (!this.inViewport && this.videoWasStopedWhenSticky)
|
|
34
|
-
},
|
|
35
|
-
setupVideoEventListeners: function () {
|
|
36
|
-
console.log("setupVideoEventListeners");
|
|
37
|
-
if(!this.eventListenerInitialized) {
|
|
38
|
-
this.videoElement.addEventListener("play", () => {
|
|
39
|
-
console.log("video:play");
|
|
40
|
-
this.videoStarted = true;
|
|
41
|
-
this.videoPlaying = true;
|
|
42
|
-
this.videoStoped = false;
|
|
43
|
-
});
|
|
44
|
-
this.videoElement.addEventListener("pause", () => {
|
|
45
|
-
console.log("video:pause");
|
|
46
|
-
this.videoPlaying = false;
|
|
47
|
-
this.videoStoped = true;
|
|
48
|
-
if (!this.inViewport ) {
|
|
49
|
-
if(this.videoWasClosedByUser){
|
|
50
|
-
this.videoWasClosedByUser = false
|
|
51
|
-
} else {
|
|
52
|
-
this.videoWasStopedWhenSticky = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
this.eventListenerInitialized = true;
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
closeVideo: function () {
|
|
60
|
-
this.videoWasStopedWhenSticky = false;
|
|
61
|
-
this.videoWasClosedByUser = true;
|
|
62
|
-
this.videoElement.pause();
|
|
63
|
-
},
|
|
64
|
-
init: function () {
|
|
65
|
-
this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
|
|
66
|
-
if(this.videoElement) {
|
|
67
|
-
this.setupVideoEventListeners();
|
|
68
|
-
} else {
|
|
69
|
-
console.log("No video element found in sticky player.");
|
|
70
|
-
const self = this; // Save a reference to the Alpine instance
|
|
71
|
-
const observer = new MutationObserver(function() {
|
|
72
|
-
console.log("MutationObserver: Mutation observed in sticky player.");
|
|
73
|
-
|
|
74
|
-
// Re-check for the video element
|
|
75
|
-
self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
|
|
76
|
-
if (self.videoElement) {
|
|
77
|
-
console.log(self.videoElement)
|
|
78
|
-
self.setupVideoEventListeners();
|
|
79
|
-
observer.disconnect(); // Stop observing after the video is found
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
observer.observe(this.$refs.videoElementWrapper, {
|
|
84
|
-
subtree: true,
|
|
85
|
-
childList: true
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
</script>
|
|
93
19
|
</div>
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
{{#if _showDate }}
|
|
8
8
|
{{#if this.hasMoreThanOneAuthor}}
|
|
9
|
-
{{> components/page/components/publicationdate }}
|
|
9
|
+
{{> components/page/components/publicationdate _isTicker=_isTicker}}
|
|
10
10
|
{{else}}
|
|
11
11
|
{{#unless this.hasOneAuthor}}
|
|
12
|
-
{{> components/page/components/publicationdate }}
|
|
12
|
+
{{> components/page/components/publicationdate _isTicker=_isTicker}}
|
|
13
13
|
{{/unless}}
|
|
14
14
|
{{/if}}
|
|
15
15
|
{{/if}}
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
{{~else}}
|
|
8
8
|
{{#if this.isPublicationDate ~}}
|
|
9
9
|
<time datetime="{{this.htmlDateTime}}">{{loca "date_published" this.date this.time }}</time>
|
|
10
|
+
{{else}}
|
|
11
|
+
{{#if ../_isTicker ~}}
|
|
12
|
+
<time datetime="{{this.htmlDateTime}}">{{loca "date_lastChanged" this.date this.time }}</time>
|
|
13
|
+
{{~/if}}
|
|
10
14
|
{{~/if}}
|
|
11
15
|
{{~/if}}
|
|
12
16
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<article class="grid items-start bg-white dark:bg-black grid-article">
|
|
2
|
+
<div class="mb-6 lg:mb-13 article-narrow md:article-breakout">
|
|
3
|
+
header
|
|
4
|
+
</div>
|
|
5
|
+
<div class="c-ticker__timelineWrapper article-full-width lg:article-breakout">
|
|
6
|
+
section
|
|
7
|
+
</div>
|
|
8
|
+
</article>
|
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.100",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "storybook dev -p 6006 public",
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
minmax(var(--mobile-padding), var(--desktop-padding)) [full-width-end];
|
|
218
218
|
grid-column: main;
|
|
219
219
|
}
|
|
220
|
-
.grid-article > :not(.article-breakout, .article-full-width, .sticky) {
|
|
220
|
+
.grid-article > :not(.article-breakout, .article-full-width, .article-narrow, .sticky) {
|
|
221
221
|
grid-column: narrow;
|
|
222
222
|
}
|
|
223
223
|
.article-breakout {
|
package/src/assets/js/alpine.js
CHANGED
|
@@ -10,14 +10,13 @@ import mainNavigationHandler from 'components/site_header/mainNavigationHandler.
|
|
|
10
10
|
import flyoutHandler from 'components/site_header/flyoutHandler.alpine'
|
|
11
11
|
import overlayHandler from 'components/site_header/overlayHandler.alpine'
|
|
12
12
|
import dropdown from 'components/site_header/dropdown.alpine'
|
|
13
|
-
|
|
14
13
|
|
|
15
14
|
AsyncAlpine.init(Alpine)
|
|
16
15
|
.data('podcastPlayer', () => import('components/podcast/podcast_player.alpine.js'))
|
|
17
16
|
.data('slider', () =>
|
|
18
17
|
import('components/horizontal_scroll_container/horizontal_scroll_container.alpine.js')
|
|
19
18
|
)
|
|
20
|
-
|
|
19
|
+
.data('stickyPlayer', () => import('components/mediaplayer/stickyPlayer.alpine.js'))
|
|
21
20
|
.data('socialSharingHandler', ()=> import('components/social_sharing/socialSharingHandler.alpine.js'))
|
|
22
21
|
.data('inputHandler', ()=> import('components/forms/js/inputHandler.alpine.js'))
|
|
23
22
|
.data('contactForm', ()=> import('components/forms/js/contactForm.alpine.js'))
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<div x-data="stickyPlayer" class="relative ar-16-9" x-intersect:leave.threshold.45="inViewport = false" x-intersect:enter.threshold.45="inViewport = true; videoWasStopedWhenSticky = false">
|
|
1
|
+
<div x-data="stickyPlayer" ax-load x-ignore class="relative ar-16-9" x-intersect:leave.threshold.45="inViewport = false" x-intersect:enter.threshold.45="inViewport = true; videoWasStopedWhenSticky = false">
|
|
3
2
|
<div x-ref="videoElementWrapper"
|
|
4
3
|
class="transition-all lg:transition-none right-4"
|
|
5
4
|
:class="{ 'ar-16-9 w-1/2 max-w-70 sm:w-70 fixed z-300 animate-fade-right animate-once animate-duration-1000': shouldVideoBeFixed(),
|
|
@@ -17,77 +16,4 @@
|
|
|
17
16
|
</div>
|
|
18
17
|
</button>
|
|
19
18
|
</div>
|
|
20
|
-
<script>
|
|
21
|
-
var stickyPlayer = () => {
|
|
22
|
-
return {
|
|
23
|
-
eventListenerInitialized: false,
|
|
24
|
-
inViewport: true,
|
|
25
|
-
videoStarted: false,
|
|
26
|
-
videoStoped: true,
|
|
27
|
-
videoPlaying: false,
|
|
28
|
-
videoWasStopedWhenSticky: false,
|
|
29
|
-
videoWasClosedByUser: false,
|
|
30
|
-
videoElement: null,
|
|
31
|
-
|
|
32
|
-
shouldVideoBeFixed: function () {
|
|
33
|
-
return (!this.inViewport && this.videoPlaying) || (!this.inViewport && this.videoWasStopedWhenSticky)
|
|
34
|
-
},
|
|
35
|
-
setupVideoEventListeners: function () {
|
|
36
|
-
console.log("setupVideoEventListeners");
|
|
37
|
-
if(!this.eventListenerInitialized) {
|
|
38
|
-
this.videoElement.addEventListener("play", () => {
|
|
39
|
-
console.log("video:play");
|
|
40
|
-
this.videoStarted = true;
|
|
41
|
-
this.videoPlaying = true;
|
|
42
|
-
this.videoStoped = false;
|
|
43
|
-
});
|
|
44
|
-
this.videoElement.addEventListener("pause", () => {
|
|
45
|
-
console.log("video:pause");
|
|
46
|
-
this.videoPlaying = false;
|
|
47
|
-
this.videoStoped = true;
|
|
48
|
-
if (!this.inViewport ) {
|
|
49
|
-
if(this.videoWasClosedByUser){
|
|
50
|
-
this.videoWasClosedByUser = false
|
|
51
|
-
} else {
|
|
52
|
-
this.videoWasStopedWhenSticky = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
this.eventListenerInitialized = true;
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
closeVideo: function () {
|
|
60
|
-
this.videoWasStopedWhenSticky = false;
|
|
61
|
-
this.videoWasClosedByUser = true;
|
|
62
|
-
this.videoElement.pause();
|
|
63
|
-
},
|
|
64
|
-
init: function () {
|
|
65
|
-
this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
|
|
66
|
-
if(this.videoElement) {
|
|
67
|
-
this.setupVideoEventListeners();
|
|
68
|
-
} else {
|
|
69
|
-
console.log("No video element found in sticky player.");
|
|
70
|
-
const self = this; // Save a reference to the Alpine instance
|
|
71
|
-
const observer = new MutationObserver(function() {
|
|
72
|
-
console.log("MutationObserver: Mutation observed in sticky player.");
|
|
73
|
-
|
|
74
|
-
// Re-check for the video element
|
|
75
|
-
self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
|
|
76
|
-
if (self.videoElement) {
|
|
77
|
-
console.log(self.videoElement)
|
|
78
|
-
self.setupVideoEventListeners();
|
|
79
|
-
observer.disconnect(); // Stop observing after the video is found
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
observer.observe(this.$refs.videoElementWrapper, {
|
|
84
|
-
subtree: true,
|
|
85
|
-
childList: true
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
</script>
|
|
93
19
|
</div>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export default function stickyPlayer() {
|
|
2
|
+
return {
|
|
3
|
+
eventListenerInitialized: false,
|
|
4
|
+
inViewport: true,
|
|
5
|
+
videoStarted: false,
|
|
6
|
+
videoStoped: true,
|
|
7
|
+
videoPlaying: false,
|
|
8
|
+
videoWasStopedWhenSticky: false,
|
|
9
|
+
videoWasClosedByUser: false,
|
|
10
|
+
videoElement: null,
|
|
11
|
+
|
|
12
|
+
shouldVideoBeFixed: function () {
|
|
13
|
+
return (!this.inViewport && this.videoPlaying) || (!this.inViewport && this.videoWasStopedWhenSticky)
|
|
14
|
+
},
|
|
15
|
+
setupVideoEventListeners: function () {
|
|
16
|
+
console.log("setupVideoEventListeners");
|
|
17
|
+
if(!this.eventListenerInitialized) {
|
|
18
|
+
this.videoElement.addEventListener("play", () => {
|
|
19
|
+
console.log("video:play");
|
|
20
|
+
this.videoStarted = true;
|
|
21
|
+
this.videoPlaying = true;
|
|
22
|
+
this.videoStoped = false;
|
|
23
|
+
});
|
|
24
|
+
this.videoElement.addEventListener("pause", () => {
|
|
25
|
+
console.log("video:pause");
|
|
26
|
+
this.videoPlaying = false;
|
|
27
|
+
this.videoStoped = true;
|
|
28
|
+
if (!this.inViewport ) {
|
|
29
|
+
if(this.videoWasClosedByUser){
|
|
30
|
+
this.videoWasClosedByUser = false
|
|
31
|
+
} else {
|
|
32
|
+
this.videoWasStopedWhenSticky = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
this.eventListenerInitialized = true;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
closeVideo: function () {
|
|
40
|
+
this.videoWasStopedWhenSticky = false;
|
|
41
|
+
this.videoWasClosedByUser = true;
|
|
42
|
+
this.videoElement.pause();
|
|
43
|
+
},
|
|
44
|
+
init: function () {
|
|
45
|
+
this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
|
|
46
|
+
if(this.videoElement) {
|
|
47
|
+
this.setupVideoEventListeners();
|
|
48
|
+
} else {
|
|
49
|
+
console.log("No video element found in sticky player.");
|
|
50
|
+
const self = this; // Save a reference to the Alpine instance
|
|
51
|
+
const observer = new MutationObserver(function() {
|
|
52
|
+
console.log("MutationObserver: Mutation observed in sticky player.");
|
|
53
|
+
|
|
54
|
+
// Re-check for the video element
|
|
55
|
+
self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
|
|
56
|
+
if (self.videoElement) {
|
|
57
|
+
console.log(self.videoElement)
|
|
58
|
+
self.setupVideoEventListeners();
|
|
59
|
+
observer.disconnect(); // Stop observing after the video is found
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
observer.observe(this.$refs.videoElementWrapper, {
|
|
64
|
+
subtree: true,
|
|
65
|
+
childList: true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
{{#if _showDate }}
|
|
8
8
|
{{#if this.hasMoreThanOneAuthor}}
|
|
9
|
-
{{> components/page/components/publicationdate }}
|
|
9
|
+
{{> components/page/components/publicationdate _isTicker=_isTicker}}
|
|
10
10
|
{{else}}
|
|
11
11
|
{{#unless this.hasOneAuthor}}
|
|
12
|
-
{{> components/page/components/publicationdate }}
|
|
12
|
+
{{> components/page/components/publicationdate _isTicker=_isTicker}}
|
|
13
13
|
{{/unless}}
|
|
14
14
|
{{/if}}
|
|
15
15
|
{{/if}}
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
{{~else}}
|
|
8
8
|
{{#if this.isPublicationDate ~}}
|
|
9
9
|
<time datetime="{{this.htmlDateTime}}">{{loca "date_published" this.date this.time }}</time>
|
|
10
|
+
{{else}}
|
|
11
|
+
{{#if ../_isTicker ~}}
|
|
12
|
+
<time datetime="{{this.htmlDateTime}}">{{loca "date_lastChanged" this.date this.time }}</time>
|
|
13
|
+
{{~/if}}
|
|
10
14
|
{{~/if}}
|
|
11
15
|
{{~/if}}
|
|
12
16
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<article class="grid items-start bg-white dark:bg-black grid-article">
|
|
2
|
+
<div class="mb-6 lg:mb-13 article-narrow md:article-breakout">
|
|
3
|
+
header
|
|
4
|
+
</div>
|
|
5
|
+
<div class="c-ticker__timelineWrapper article-full-width lg:article-breakout">
|
|
6
|
+
section
|
|
7
|
+
</div>
|
|
8
|
+
</article>
|