hr-design-system-handlebars 1.114.67 → 1.114.69

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 CHANGED
@@ -1,3 +1,29 @@
1
+ # v1.114.69 (Tue Jan 21 2025)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Enhance media player sticky wrapper positioning based on subnavigation visibility [#1218](https://github.com/mumprod/hr-design-system-handlebars/pull/1218) ([@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.68 (Tue Jan 21 2025)
15
+
16
+ #### 🐛 Bug Fix
17
+
18
+ - DPE-1087 - Ticker: Livestreams ohne Unterbrechung (Enhancements) [#1217](https://github.com/mumprod/hr-design-system-handlebars/pull/1217) ([@vascoeduardo](https://github.com/vascoeduardo) [@eduardo-hr](https://github.com/eduardo-hr))
19
+
20
+ #### Authors: 2
21
+
22
+ - [@eduardo-hr](https://github.com/eduardo-hr)
23
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
24
+
25
+ ---
26
+
1
27
  # v1.114.67 (Mon Jan 20 2025)
2
28
 
3
29
  #### 🐛 Bug Fix
@@ -1136,27 +1136,18 @@ article #commentList {
1136
1136
  bottom: 0px;
1137
1137
  left: 0px;
1138
1138
  }
1139
- .-bottom-20 {
1140
- bottom: -5rem;
1141
- }
1142
1139
  .-left-4 {
1143
1140
  left: -1rem;
1144
1141
  }
1145
1142
  .-left-5 {
1146
1143
  left: -1.25rem;
1147
1144
  }
1148
- .-right-80 {
1149
- right: -20rem;
1150
- }
1151
1145
  .bottom-0 {
1152
1146
  bottom: 0px;
1153
1147
  }
1154
1148
  .bottom-11 {
1155
1149
  bottom: 2.75rem;
1156
1150
  }
1157
- .bottom-12 {
1158
- bottom: 3rem;
1159
- }
1160
1151
  .bottom-15 {
1161
1152
  bottom: 3.75rem;
1162
1153
  }
@@ -1188,9 +1179,6 @@ article #commentList {
1188
1179
  .right-11 {
1189
1180
  right: 2.75rem;
1190
1181
  }
1191
- .right-12 {
1192
- right: 3rem;
1193
- }
1194
1182
  .right-4 {
1195
1183
  right: 1rem;
1196
1184
  }
@@ -1218,6 +1206,24 @@ article #commentList {
1218
1206
  .top-10 {
1219
1207
  top: 2.5rem;
1220
1208
  }
1209
+ .top-14 {
1210
+ top: 3.5rem;
1211
+ }
1212
+ .top-16 {
1213
+ top: 4rem;
1214
+ }
1215
+ .top-20 {
1216
+ top: 5rem;
1217
+ }
1218
+ .top-31 {
1219
+ top: 7.75rem;
1220
+ }
1221
+ .top-4 {
1222
+ top: 1rem;
1223
+ }
1224
+ .top-40 {
1225
+ top: 10rem;
1226
+ }
1221
1227
  .top-8 {
1222
1228
  top: 2rem;
1223
1229
  }
@@ -1794,6 +1800,9 @@ article #commentList {
1794
1800
  .w-0 {
1795
1801
  width: 0px;
1796
1802
  }
1803
+ .w-1\/2 {
1804
+ width: 50%;
1805
+ }
1797
1806
  .w-10 {
1798
1807
  width: 2.5rem;
1799
1808
  }
@@ -1860,9 +1869,6 @@ article #commentList {
1860
1869
  .w-9\.5 {
1861
1870
  width: 2.375rem;
1862
1871
  }
1863
- .w-96 {
1864
- width: 24rem;
1865
- }
1866
1872
  .w-\[19px\] {
1867
1873
  width: 19px;
1868
1874
  }
@@ -1929,6 +1935,9 @@ article #commentList {
1929
1935
  .max-w-3\/4 {
1930
1936
  max-width: 75%;
1931
1937
  }
1938
+ .max-w-70 {
1939
+ max-width: 17.5rem;
1940
+ }
1932
1941
  .max-w-\[480px\] {
1933
1942
  max-width: 480px;
1934
1943
  }
@@ -2101,6 +2110,36 @@ article #commentList {
2101
2110
  .transform {
2102
2111
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2103
2112
  }
2113
+ @keyframes fade {
2114
+
2115
+ 0% {
2116
+ opacity: 0;
2117
+ }
2118
+
2119
+ 100% {
2120
+ opacity: 1;
2121
+ }
2122
+ }
2123
+ .animate-fade {
2124
+ animation: fade 1s ease 0s 1 both;
2125
+ animation: fade var(--tw-animate-duration, 1s) var(--tw-animate-easing, ease) var(--tw-animate-delay, 0s) var(--tw-animate-iteration, 1) var(--tw-animate-fill, both);
2126
+ }
2127
+ @keyframes fade-right {
2128
+
2129
+ 0% {
2130
+ opacity: 0;
2131
+ transform: translateX(-2rem);
2132
+ }
2133
+
2134
+ 100% {
2135
+ opacity: 1;
2136
+ transform: translateX(0);
2137
+ }
2138
+ }
2139
+ .animate-fade-right {
2140
+ animation: fade-right 1s ease 0s 1 both;
2141
+ animation: fade-right var(--tw-animate-duration, 1s) var(--tw-animate-easing, ease) var(--tw-animate-delay, 0s) var(--tw-animate-iteration, 1) var(--tw-animate-fill, both);
2142
+ }
2104
2143
  .animate-none {
2105
2144
  animation: none;
2106
2145
  }
@@ -2111,7 +2150,8 @@ article #commentList {
2111
2150
  }
2112
2151
  }
2113
2152
  .animate-spin {
2114
- animation: spin 1s linear infinite;
2153
+ animation: spin 1s linear 0s infinite none;
2154
+ animation: spin var(--tw-animate-duration, 1s) var(--tw-animate-easing, linear) var(--tw-animate-delay, 0s) var(--tw-animate-iteration, infinite) var(--tw-animate-fill, none);
2115
2155
  }
2116
2156
  .\!cursor-not-allowed {
2117
2157
  cursor: not-allowed !important;
@@ -3737,7 +3777,22 @@ article #commentList {
3737
3777
  border-bottom-color: var(--color-secondary-ds);
3738
3778
  }
3739
3779
  .counter-reset {
3740
- counter-reset: cnt1737404341121;
3780
+ counter-reset: cnt1737474959465;
3781
+ }
3782
+ .animate-duration-1000 {
3783
+ --tw-animate-duration: 1000ms;
3784
+ animation-duration: 1000ms;
3785
+ animation-duration: var(--tw-animate-duration);
3786
+ }
3787
+ .animate-once {
3788
+ --tw-animate-iteration: 1;
3789
+ animation-iteration-count: 1;
3790
+ animation-iteration-count: var(--tw-animate-iteration);
3791
+ }
3792
+ .animate-ease-in-out {
3793
+ --tw-animate-easing: cubic-bezier(0.4, 0, 0.2, 1);
3794
+ animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
3795
+ animation-timing-function: var(--tw-animate-easing);
3741
3796
  }
3742
3797
  html { scroll-behavior: smooth; }
3743
3798
  .placeholder-text-xs::-webkit-input-placeholder {
@@ -4152,7 +4207,7 @@ html { scroll-behavior: smooth; }
4152
4207
  --tw-ring-color: rgba(255, 255, 255, 0.5);
4153
4208
  }
4154
4209
  .-ordered {
4155
- counter-increment: cnt1737404341121 1;
4210
+ counter-increment: cnt1737474959465 1;
4156
4211
  }
4157
4212
  .-ordered::before {
4158
4213
  position: absolute;
@@ -4170,7 +4225,7 @@ html { scroll-behavior: smooth; }
4170
4225
  --tw-text-opacity: 1;
4171
4226
  color: rgba(0, 0, 0, 1);
4172
4227
  color: rgba(0, 0, 0, var(--tw-text-opacity));
4173
- content: counter(cnt1737404341121);
4228
+ content: counter(cnt1737474959465);
4174
4229
  }
4175
4230
  /*! ****************************/
4176
4231
  /*! DataPolicy stuff */
@@ -6929,6 +6984,10 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
6929
6984
  width: 58.333333%;
6930
6985
  }
6931
6986
 
6987
+ .sm\:w-70 {
6988
+ width: 17.5rem;
6989
+ }
6990
+
6932
6991
  .sm\:w-\[220px\] {
6933
6992
  width: 220px;
6934
6993
  }
@@ -7223,6 +7282,10 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
7223
7282
  top: 3rem;
7224
7283
  }
7225
7284
 
7285
+ .md\:top-16 {
7286
+ top: 4rem;
7287
+ }
7288
+
7226
7289
  .md\:top-auto {
7227
7290
  top: auto;
7228
7291
  }
@@ -7982,6 +8045,18 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
7982
8045
  top: 3.75rem;
7983
8046
  }
7984
8047
 
8048
+ .lg\:top-20 {
8049
+ top: 5rem;
8050
+ }
8051
+
8052
+ .lg\:top-31 {
8053
+ top: 7.75rem;
8054
+ }
8055
+
8056
+ .lg\:top-40 {
8057
+ top: 10rem;
8058
+ }
8059
+
7985
8060
  .lg\:z-50 {
7986
8061
  z-index: 50;
7987
8062
  }
@@ -8407,6 +8482,10 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
8407
8482
  filter: none;
8408
8483
  }
8409
8484
 
8485
+ .lg\:transition-none {
8486
+ transition-property: none;
8487
+ }
8488
+
8410
8489
  .lg\:duration-0 {
8411
8490
  transition-duration: 0ms;
8412
8491
  }
@@ -1,82 +1,92 @@
1
1
 
2
- <div x-data="stickyPlayer" x-init="init()" class="relative ar-16-9 bg-slate-400" x-intersect:leave.threshold.15="inViewport = false" x-intersect:enter.threshold.15="inViewport = true; videoWasStopedWhenSticky = false">
3
- <div x-ref="videoElementWrapper"
4
- class=""
5
- :class="{ 'ar-16-9 w-96 fixed right-12 bottom-12 z-300 ': shouldVideoBeFixed() }">
6
- {{> @partial-block }}
7
- </div>
8
- <div class="absolute hidden bg-white -bottom-20 -right-80">
9
- shouldVideoBeFixed: <span x-text="shouldVideoBeFixed()"></span><br>
10
- inViewport: <span x-text="inViewport"></span><br>
11
- videoStarted: <span x-text="videoStarted"></span><br>
12
- videoStoped: <span x-text="videoStoped"></span><br>
13
- videoPlaying: <span x-text="videoPlaying"></span><br>
14
- videoWasStopedWhenSticky: <span x-text="videoWasStopedWhenSticky"></span><br>
15
-
2
+ <div x-data="stickyPlayer" class="relative ar-16-9 bg-slate-400" x-intersect:leave.threshold.45="inViewport = false" x-intersect:enter.threshold.45="inViewport = true; videoWasStopedWhenSticky = false">
3
+ <div x-ref="videoElementWrapper"
4
+ class="transition-all lg:transition-none right-4"
5
+ :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(),
6
+ 'animate-fade animate-duration-1000 animate-ease-in-out': !shouldVideoBeFixed(),
7
+ 'top-14 md:top-16': $store.navIsVisible,
8
+ 'lg:top-31': $store.navIsVisible && !$store.subNavIsVisible,
9
+ 'lg:top-40': $store.navIsVisible && $store.subNavIsVisible,
10
+ 'top-4 lg:top-20': !$store.navIsVisible}">
11
+ {{> @partial-block }}
12
+ <button @click="closeVideo()" class="absolute top-0 right-0 flex items-center justify-center w-12 h-12 z-300 hover:scale-105"
13
+ :class="{'hidden': !shouldVideoBeFixed(),
14
+ 'flex': shouldVideoBeFixed()}">
15
+ <div class="flex items-center justify-center w-8 h-8 {{> components/button/utilities/button_base_classes}} {{> components/button/utilities/button_variation_classes _variant="primary"}}">
16
+ {{> components/button/components/button_icon _icon="close" _iconmap="icons" _css="" }}
17
+ </div>
18
+ </button>
19
+ </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
+ videoWasStopedByUser: false,
30
+ videoElement: null,
16
31
 
17
- </div>
18
- <script>
19
- var stickyPlayer = () => {
20
- return {
21
- eventListenerInitialized: false,
22
- inViewport: true,
23
- videoStarted: false,
24
- videoStoped: true,
25
- videoPlaying: false,
26
- videoWasStopedWhenSticky: false,
27
- videoElement: null,
28
- shouldVideoBeFixed: function () {
29
- return (!this.inViewport && this.videoPlaying) || (!this.inViewport && this.videoWasStopedWhenSticky)
30
- //return !this.inViewport;
31
- },
32
- setupVideoEventListeners: function () {
33
- console.log("setupVideoEventListeners");
34
- if(!this.eventListenerInitialized) {
35
- this.videoElement.addEventListener("play", () => {
36
- console.log("video:play");
37
- this.videoStarted = true;
38
- this.videoPlaying = true;
39
- this.videoStoped = false;
40
- });
41
- this.videoElement.addEventListener("pause", () => {
42
- console.log("video:pause");
43
- this.videoPlaying = false;
44
- this.videoStoped = true;
45
- if (!this.inViewport) {
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.videoWasStopedByUser){
50
+ this.videoWasStopedByUser = false
51
+ } else {
46
52
  this.videoWasStopedWhenSticky = true;
47
- }
48
- });
49
- this.eventListenerInitialized = true;
50
- }
51
- },
52
- init: function () {
53
- this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
54
- if(this.videoElement) {
55
- this.setupVideoEventListeners();
56
- } else {
57
- console.log("No video element found in sticky player.");
58
- const self = this; // Save a reference to the Alpine instance
59
- const observer = new MutationObserver(function() {
60
- console.log("MutationObserver: Mutation observed in sticky player.");
61
-
62
- // Re-check for the video element
63
- self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
64
- if (self.videoElement) {
65
- console.log(self.videoElement)
66
- self.setupVideoEventListeners();
67
- observer.disconnect(); // Stop observing after the video is found
68
- }
69
- });
53
+ }
54
+ }
55
+ });
56
+ this.eventListenerInitialized = true;
57
+ }
58
+ },
59
+ closeVideo: function () {
60
+ this.videoElement.pause();
61
+ this.videoWasStopedByUser = true;
62
+ },
63
+ init: function () {
64
+ this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
65
+ if(this.videoElement) {
66
+ this.setupVideoEventListeners();
67
+ } else {
68
+ console.log("No video element found in sticky player.");
69
+ const self = this; // Save a reference to the Alpine instance
70
+ const observer = new MutationObserver(function() {
71
+ console.log("MutationObserver: Mutation observed in sticky player.");
72
+
73
+ // Re-check for the video element
74
+ self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
75
+ if (self.videoElement) {
76
+ console.log(self.videoElement)
77
+ self.setupVideoEventListeners();
78
+ observer.disconnect(); // Stop observing after the video is found
79
+ }
80
+ });
70
81
 
71
- observer.observe(this.$refs.videoElementWrapper, {
72
- subtree: true,
73
- childList: true
74
- });
75
- }
76
-
77
- },
78
- }
79
- }
80
- </script>
81
-
82
- </div>
82
+ observer.observe(this.$refs.videoElementWrapper, {
83
+ subtree: true,
84
+ childList: true
85
+ });
86
+ }
87
+
88
+ },
89
+ }
90
+ }
91
+ </script>
92
+ </div>
@@ -1,82 +1,92 @@
1
1
 
2
- <div x-data="stickyPlayer" x-init="init()" class="relative ar-16-9 bg-slate-400" x-intersect:leave.threshold.15="inViewport = false" x-intersect:enter.threshold.15="inViewport = true; videoWasStopedWhenSticky = false">
3
- <div x-ref="videoElementWrapper"
4
- class=""
5
- :class="{ 'ar-16-9 w-96 fixed right-12 bottom-12 z-300 ': shouldVideoBeFixed() }">
6
- {{> @partial-block }}
7
- </div>
8
- <div class="absolute hidden bg-white -bottom-20 -right-80">
9
- shouldVideoBeFixed: <span x-text="shouldVideoBeFixed()"></span><br>
10
- inViewport: <span x-text="inViewport"></span><br>
11
- videoStarted: <span x-text="videoStarted"></span><br>
12
- videoStoped: <span x-text="videoStoped"></span><br>
13
- videoPlaying: <span x-text="videoPlaying"></span><br>
14
- videoWasStopedWhenSticky: <span x-text="videoWasStopedWhenSticky"></span><br>
15
-
2
+ <div x-data="stickyPlayer" class="relative ar-16-9 bg-slate-400" x-intersect:leave.threshold.45="inViewport = false" x-intersect:enter.threshold.45="inViewport = true; videoWasStopedWhenSticky = false">
3
+ <div x-ref="videoElementWrapper"
4
+ class="transition-all lg:transition-none right-4"
5
+ :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(),
6
+ 'animate-fade animate-duration-1000 animate-ease-in-out': !shouldVideoBeFixed(),
7
+ 'top-14 md:top-16': $store.navIsVisible,
8
+ 'lg:top-31': $store.navIsVisible && !$store.subNavIsVisible,
9
+ 'lg:top-40': $store.navIsVisible && $store.subNavIsVisible,
10
+ 'top-4 lg:top-20': !$store.navIsVisible}">
11
+ {{> @partial-block }}
12
+ <button @click="closeVideo()" class="absolute top-0 right-0 flex items-center justify-center w-12 h-12 z-300 hover:scale-105"
13
+ :class="{'hidden': !shouldVideoBeFixed(),
14
+ 'flex': shouldVideoBeFixed()}">
15
+ <div class="flex items-center justify-center w-8 h-8 {{> components/button/utilities/button_base_classes}} {{> components/button/utilities/button_variation_classes _variant="primary"}}">
16
+ {{> components/button/components/button_icon _icon="close" _iconmap="icons" _css="" }}
17
+ </div>
18
+ </button>
19
+ </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
+ videoWasStopedByUser: false,
30
+ videoElement: null,
16
31
 
17
- </div>
18
- <script>
19
- var stickyPlayer = () => {
20
- return {
21
- eventListenerInitialized: false,
22
- inViewport: true,
23
- videoStarted: false,
24
- videoStoped: true,
25
- videoPlaying: false,
26
- videoWasStopedWhenSticky: false,
27
- videoElement: null,
28
- shouldVideoBeFixed: function () {
29
- return (!this.inViewport && this.videoPlaying) || (!this.inViewport && this.videoWasStopedWhenSticky)
30
- //return !this.inViewport;
31
- },
32
- setupVideoEventListeners: function () {
33
- console.log("setupVideoEventListeners");
34
- if(!this.eventListenerInitialized) {
35
- this.videoElement.addEventListener("play", () => {
36
- console.log("video:play");
37
- this.videoStarted = true;
38
- this.videoPlaying = true;
39
- this.videoStoped = false;
40
- });
41
- this.videoElement.addEventListener("pause", () => {
42
- console.log("video:pause");
43
- this.videoPlaying = false;
44
- this.videoStoped = true;
45
- if (!this.inViewport) {
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.videoWasStopedByUser){
50
+ this.videoWasStopedByUser = false
51
+ } else {
46
52
  this.videoWasStopedWhenSticky = true;
47
- }
48
- });
49
- this.eventListenerInitialized = true;
50
- }
51
- },
52
- init: function () {
53
- this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
54
- if(this.videoElement) {
55
- this.setupVideoEventListeners();
56
- } else {
57
- console.log("No video element found in sticky player.");
58
- const self = this; // Save a reference to the Alpine instance
59
- const observer = new MutationObserver(function() {
60
- console.log("MutationObserver: Mutation observed in sticky player.");
61
-
62
- // Re-check for the video element
63
- self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
64
- if (self.videoElement) {
65
- console.log(self.videoElement)
66
- self.setupVideoEventListeners();
67
- observer.disconnect(); // Stop observing after the video is found
68
- }
69
- });
53
+ }
54
+ }
55
+ });
56
+ this.eventListenerInitialized = true;
57
+ }
58
+ },
59
+ closeVideo: function () {
60
+ this.videoElement.pause();
61
+ this.videoWasStopedByUser = true;
62
+ },
63
+ init: function () {
64
+ this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
65
+ if(this.videoElement) {
66
+ this.setupVideoEventListeners();
67
+ } else {
68
+ console.log("No video element found in sticky player.");
69
+ const self = this; // Save a reference to the Alpine instance
70
+ const observer = new MutationObserver(function() {
71
+ console.log("MutationObserver: Mutation observed in sticky player.");
72
+
73
+ // Re-check for the video element
74
+ self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
75
+ if (self.videoElement) {
76
+ console.log(self.videoElement)
77
+ self.setupVideoEventListeners();
78
+ observer.disconnect(); // Stop observing after the video is found
79
+ }
80
+ });
70
81
 
71
- observer.observe(this.$refs.videoElementWrapper, {
72
- subtree: true,
73
- childList: true
74
- });
75
- }
76
-
77
- },
78
- }
79
- }
80
- </script>
81
-
82
- </div>
82
+ observer.observe(this.$refs.videoElementWrapper, {
83
+ subtree: true,
84
+ childList: true
85
+ });
86
+ }
87
+
88
+ },
89
+ }
90
+ }
91
+ </script>
92
+ </div>
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.67",
9
+ "version": "1.114.69",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "storybook dev -p 6006 public",
@@ -121,6 +121,7 @@
121
121
  "checkcss": "^2.0.9",
122
122
  "dialog-polyfill": "^0.5.6",
123
123
  "storybook-addon-pseudo-states": "^4.0.2",
124
+ "tailwindcss-animated": "^1.1.2",
124
125
  "tailwindcss-counter": "^1.1.3"
125
126
  },
126
127
  "prettier": {
@@ -1,82 +1,92 @@
1
1
 
2
- <div x-data="stickyPlayer" x-init="init()" class="relative ar-16-9 bg-slate-400" x-intersect:leave.threshold.15="inViewport = false" x-intersect:enter.threshold.15="inViewport = true; videoWasStopedWhenSticky = false">
3
- <div x-ref="videoElementWrapper"
4
- class=""
5
- :class="{ 'ar-16-9 w-96 fixed right-12 bottom-12 z-300 ': shouldVideoBeFixed() }">
6
- {{> @partial-block }}
7
- </div>
8
- <div class="absolute hidden bg-white -bottom-20 -right-80">
9
- shouldVideoBeFixed: <span x-text="shouldVideoBeFixed()"></span><br>
10
- inViewport: <span x-text="inViewport"></span><br>
11
- videoStarted: <span x-text="videoStarted"></span><br>
12
- videoStoped: <span x-text="videoStoped"></span><br>
13
- videoPlaying: <span x-text="videoPlaying"></span><br>
14
- videoWasStopedWhenSticky: <span x-text="videoWasStopedWhenSticky"></span><br>
15
-
2
+ <div x-data="stickyPlayer" class="relative ar-16-9 bg-slate-400" x-intersect:leave.threshold.45="inViewport = false" x-intersect:enter.threshold.45="inViewport = true; videoWasStopedWhenSticky = false">
3
+ <div x-ref="videoElementWrapper"
4
+ class="transition-all lg:transition-none right-4"
5
+ :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(),
6
+ 'animate-fade animate-duration-1000 animate-ease-in-out': !shouldVideoBeFixed(),
7
+ 'top-14 md:top-16': $store.navIsVisible,
8
+ 'lg:top-31': $store.navIsVisible && !$store.subNavIsVisible,
9
+ 'lg:top-40': $store.navIsVisible && $store.subNavIsVisible,
10
+ 'top-4 lg:top-20': !$store.navIsVisible}">
11
+ {{> @partial-block }}
12
+ <button @click="closeVideo()" class="absolute top-0 right-0 flex items-center justify-center w-12 h-12 z-300 hover:scale-105"
13
+ :class="{'hidden': !shouldVideoBeFixed(),
14
+ 'flex': shouldVideoBeFixed()}">
15
+ <div class="flex items-center justify-center w-8 h-8 {{> components/button/utilities/button_base_classes}} {{> components/button/utilities/button_variation_classes _variant="primary"}}">
16
+ {{> components/button/components/button_icon _icon="close" _iconmap="icons" _css="" }}
17
+ </div>
18
+ </button>
19
+ </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
+ videoWasStopedByUser: false,
30
+ videoElement: null,
16
31
 
17
- </div>
18
- <script>
19
- var stickyPlayer = () => {
20
- return {
21
- eventListenerInitialized: false,
22
- inViewport: true,
23
- videoStarted: false,
24
- videoStoped: true,
25
- videoPlaying: false,
26
- videoWasStopedWhenSticky: false,
27
- videoElement: null,
28
- shouldVideoBeFixed: function () {
29
- return (!this.inViewport && this.videoPlaying) || (!this.inViewport && this.videoWasStopedWhenSticky)
30
- //return !this.inViewport;
31
- },
32
- setupVideoEventListeners: function () {
33
- console.log("setupVideoEventListeners");
34
- if(!this.eventListenerInitialized) {
35
- this.videoElement.addEventListener("play", () => {
36
- console.log("video:play");
37
- this.videoStarted = true;
38
- this.videoPlaying = true;
39
- this.videoStoped = false;
40
- });
41
- this.videoElement.addEventListener("pause", () => {
42
- console.log("video:pause");
43
- this.videoPlaying = false;
44
- this.videoStoped = true;
45
- if (!this.inViewport) {
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.videoWasStopedByUser){
50
+ this.videoWasStopedByUser = false
51
+ } else {
46
52
  this.videoWasStopedWhenSticky = true;
47
- }
48
- });
49
- this.eventListenerInitialized = true;
50
- }
51
- },
52
- init: function () {
53
- this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
54
- if(this.videoElement) {
55
- this.setupVideoEventListeners();
56
- } else {
57
- console.log("No video element found in sticky player.");
58
- const self = this; // Save a reference to the Alpine instance
59
- const observer = new MutationObserver(function() {
60
- console.log("MutationObserver: Mutation observed in sticky player.");
61
-
62
- // Re-check for the video element
63
- self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
64
- if (self.videoElement) {
65
- console.log(self.videoElement)
66
- self.setupVideoEventListeners();
67
- observer.disconnect(); // Stop observing after the video is found
68
- }
69
- });
53
+ }
54
+ }
55
+ });
56
+ this.eventListenerInitialized = true;
57
+ }
58
+ },
59
+ closeVideo: function () {
60
+ this.videoElement.pause();
61
+ this.videoWasStopedByUser = true;
62
+ },
63
+ init: function () {
64
+ this.videoElement = this.$refs.videoElementWrapper.querySelector("video");
65
+ if(this.videoElement) {
66
+ this.setupVideoEventListeners();
67
+ } else {
68
+ console.log("No video element found in sticky player.");
69
+ const self = this; // Save a reference to the Alpine instance
70
+ const observer = new MutationObserver(function() {
71
+ console.log("MutationObserver: Mutation observed in sticky player.");
72
+
73
+ // Re-check for the video element
74
+ self.videoElement = self.$refs.videoElementWrapper.querySelector("video");
75
+ if (self.videoElement) {
76
+ console.log(self.videoElement)
77
+ self.setupVideoEventListeners();
78
+ observer.disconnect(); // Stop observing after the video is found
79
+ }
80
+ });
70
81
 
71
- observer.observe(this.$refs.videoElementWrapper, {
72
- subtree: true,
73
- childList: true
74
- });
75
- }
76
-
77
- },
78
- }
79
- }
80
- </script>
81
-
82
- </div>
82
+ observer.observe(this.$refs.videoElementWrapper, {
83
+ subtree: true,
84
+ childList: true
85
+ });
86
+ }
87
+
88
+ },
89
+ }
90
+ }
91
+ </script>
92
+ </div>
@@ -154,6 +154,7 @@ module.exports = {
154
154
  '22': '5.5rem',
155
155
  '26': '6.5rem',
156
156
  '30': '7.5rem',
157
+ '31': '7.75rem',
157
158
  '35': '8.75rem',
158
159
  '37': '9.25rem',
159
160
  '-37': '-9.25rem',
@@ -452,5 +453,6 @@ module.exports = {
452
453
  addUtilities(utilities, variants('borderColor'))
453
454
  },
454
455
  require('tailwindcss-counter')(),
456
+ require('tailwindcss-animated')
455
457
  ],
456
458
  }