hr-design-system-handlebars 1.66.1 → 1.67.0

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.
Files changed (23) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/assets/index.css +26 -39
  3. package/dist/assets/js/alpine.js +4 -2
  4. package/dist/assets/js/components/site_header/mainNavigationHandler.alpine.js +10 -2
  5. package/dist/views/components/page/components/comments.hbs +1 -1
  6. package/dist/views/components/page/index/page_test_story.hbs +1 -0
  7. package/dist/views/components/page/story/story_article.hbs +3 -1
  8. package/dist/views/components/social_sharing/social_sharing_compact.hbs +54 -61
  9. package/dist/views/components/social_sharing/social_sharing_copytext.hbs +12 -0
  10. package/dist/views_static/components/page/components/comments.hbs +1 -1
  11. package/dist/views_static/components/page/index/page_test_story.hbs +1 -0
  12. package/dist/views_static/components/page/story/story_article.hbs +3 -1
  13. package/dist/views_static/components/social_sharing/social_sharing_compact.hbs +54 -61
  14. package/dist/views_static/components/social_sharing/social_sharing_copytext.hbs +12 -0
  15. package/package.json +1 -1
  16. package/src/assets/css/custom-utilities.css +2 -1
  17. package/src/assets/js/alpine.js +4 -2
  18. package/src/stories/views/components/page/components/comments.hbs +1 -1
  19. package/src/stories/views/components/page/index/page_test_story.hbs +1 -0
  20. package/src/stories/views/components/page/story/story_article.hbs +3 -1
  21. package/src/stories/views/components/site_header/mainNavigationHandler.alpine.js +10 -2
  22. package/src/stories/views/components/social_sharing/social_sharing_compact.hbs +54 -61
  23. package/src/stories/views/components/social_sharing/social_sharing_copytext.hbs +12 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # v1.67.0 (Thu Apr 25 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Social sharing code impovements [#915](https://github.com/mumprod/hr-design-system-handlebars/pull/915) ([@vascoeduardo](https://github.com/vascoeduardo) [@StefanVesper](https://github.com/StefanVesper))
6
+
7
+ #### Authors: 2
8
+
9
+ - SonicSoulSurfer ([@StefanVesper](https://github.com/StefanVesper))
10
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
11
+
12
+ ---
13
+
1
14
  # v1.66.1 (Thu Apr 25 2024)
2
15
 
3
16
  #### 🐛 Bug Fix
@@ -1056,9 +1056,6 @@ article.indexTextDS .indexTextHighlighted .link {
1056
1056
  .left-0 {
1057
1057
  left: 0px;
1058
1058
  }
1059
- .left-1 {
1060
- left: 0.25rem;
1061
- }
1062
1059
  .left-1\/2 {
1063
1060
  left: 50%;
1064
1061
  }
@@ -1074,8 +1071,8 @@ article.indexTextDS .indexTextHighlighted .link {
1074
1071
  .right-0 {
1075
1072
  right: 0px;
1076
1073
  }
1077
- .right-\[60px\] {
1078
- right: 60px;
1074
+ .right-\[68px\] {
1075
+ right: 68px;
1079
1076
  }
1080
1077
  .right-auto {
1081
1078
  right: auto;
@@ -1104,21 +1101,27 @@ article.indexTextDS .indexTextHighlighted .link {
1104
1101
  .top-10 {
1105
1102
  top: 2.5rem;
1106
1103
  }
1107
- .top-40 {
1108
- top: 10rem;
1109
- }
1110
1104
  .top-8 {
1111
1105
  top: 2rem;
1112
1106
  }
1113
1107
  .top-9 {
1114
1108
  top: 2.25rem;
1115
1109
  }
1110
+ .top-\[130px\] {
1111
+ top: 130px;
1112
+ }
1113
+ .top-\[166px\] {
1114
+ top: 166px;
1115
+ }
1116
1116
  .top-\[3px\] {
1117
1117
  top: 3px;
1118
1118
  }
1119
1119
  .top-\[41px\] {
1120
1120
  top: 41px;
1121
1121
  }
1122
+ .top-\[85px\] {
1123
+ top: 85px;
1124
+ }
1122
1125
  .top-feature-box-height {
1123
1126
  top: 0;
1124
1127
  top: var(--feature-box-height);
@@ -1183,6 +1186,9 @@ article.indexTextDS .indexTextHighlighted .link {
1183
1186
  .col-span-full {
1184
1187
  grid-column: 1 / -1;
1185
1188
  }
1189
+ .col-start-2 {
1190
+ grid-column-start: 2;
1191
+ }
1186
1192
  .float-right {
1187
1193
  float: right;
1188
1194
  }
@@ -1253,10 +1259,6 @@ article.indexTextDS .indexTextHighlighted .link {
1253
1259
  margin-top: 3rem;
1254
1260
  margin-bottom: 3rem;
1255
1261
  }
1256
- .my-14 {
1257
- margin-top: 3.5rem;
1258
- margin-bottom: 3.5rem;
1259
- }
1260
1262
  .my-2 {
1261
1263
  margin-top: 0.5rem;
1262
1264
  margin-bottom: 0.5rem;
@@ -1615,6 +1617,11 @@ article.indexTextDS .indexTextHighlighted .link {
1615
1617
  .h-auto {
1616
1618
  height: auto;
1617
1619
  }
1620
+ .h-fit {
1621
+ height: -webkit-fit-content;
1622
+ height: -moz-fit-content;
1623
+ height: fit-content;
1624
+ }
1618
1625
  .h-full {
1619
1626
  height: 100%;
1620
1627
  }
@@ -2118,6 +2125,9 @@ article.indexTextDS .indexTextHighlighted .link {
2118
2125
  .rounded-lg {
2119
2126
  border-radius: 0.5rem;
2120
2127
  }
2128
+ .rounded-md {
2129
+ border-radius: 0.375rem;
2130
+ }
2121
2131
  .rounded-xl {
2122
2132
  border-radius: 0.75rem;
2123
2133
  }
@@ -3289,11 +3299,6 @@ article.indexTextDS .indexTextHighlighted .link {
3289
3299
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
3290
3300
  transition-duration: 150ms;
3291
3301
  }
3292
- .transition-\[top\] {
3293
- transition-property: top;
3294
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
3295
- transition-duration: 150ms;
3296
- }
3297
3302
  .transition-all {
3298
3303
  transition-property: all;
3299
3304
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
@@ -3348,7 +3353,7 @@ article.indexTextDS .indexTextHighlighted .link {
3348
3353
  border-bottom-color: var(--color-secondary-ds);
3349
3354
  }
3350
3355
  .counter-reset {
3351
- counter-reset: cnt1714048163428;
3356
+ counter-reset: cnt1714051151895;
3352
3357
  }
3353
3358
  .hyphens-auto {
3354
3359
  -webkit-hyphens: auto;
@@ -3529,7 +3534,7 @@ article.indexTextDS .indexTextHighlighted .link {
3529
3534
  minmax(var(--mobile-padding), var(--desktop-padding)) [full-width-end];
3530
3535
  grid-column: main;
3531
3536
  }
3532
- .grid-article > :not(.article-breakout):not(.article-full-width){
3537
+ .grid-article > :not(.article-breakout):not(.article-full-width):not(.sticky){
3533
3538
  grid-column: narrow;
3534
3539
  }
3535
3540
  .article-full-width {
@@ -3727,7 +3732,7 @@ article.indexTextDS .indexTextHighlighted .link {
3727
3732
  --tw-ring-color: rgba(255, 255, 255, 0.5);
3728
3733
  }
3729
3734
  .-ordered {
3730
- counter-increment: cnt1714048163428 1;
3735
+ counter-increment: cnt1714051151895 1;
3731
3736
  }
3732
3737
  .-ordered::before {
3733
3738
  position: absolute;
@@ -3743,7 +3748,7 @@ article.indexTextDS .indexTextHighlighted .link {
3743
3748
  letter-spacing: .0125em;
3744
3749
  --tw-text-opacity: 1;
3745
3750
  color: rgba(0, 0, 0, var(--tw-text-opacity));
3746
- content: counter(cnt1714048163428);
3751
+ content: counter(cnt1714051151895);
3747
3752
  }
3748
3753
  /*! ****************************/
3749
3754
  /*! DataPolicy stuff */
@@ -7365,24 +7370,6 @@ article.indexTextDS .indexTextHighlighted .link {
7365
7370
  border-left-width: 1px;
7366
7371
  }
7367
7372
  }
7368
- @media (min-width: 1040px) {
7369
-
7370
- .socialShareDesktop\:-left-2 {
7371
- left: -0.5rem;
7372
- }
7373
-
7374
- .socialShareDesktop\:bottom-auto {
7375
- bottom: auto;
7376
- }
7377
-
7378
- .socialShareDesktop\:top-0 {
7379
- top: 0px;
7380
- }
7381
-
7382
- .socialShareDesktop\:top-\[78px\] {
7383
- top: 78px;
7384
- }
7385
- }
7386
7373
  .\[\&\:has\(\+\.-hideOnMobile\)\]\:order-1[\:has\(\%2B.-hideOnMobile\)] {
7387
7374
  order: 1;
7388
7375
  }
@@ -39,10 +39,12 @@ Alpine.store('serviceID', {
39
39
  Alpine.store('navIsVisible', true)
40
40
  Alpine.store('subNavIsVisible', false)
41
41
  Alpine.store('footerIsVisible', false)
42
- Alpine.store('globalPercent', {
42
+ Alpine.store('sectionNavIsVisible', false)
43
+ Alpine.store('sharingIsVisible', true)
44
+ Alpine.store('sharingIsOpen', false)
45
+ Alpine.store('sharingBottomPos', {
43
46
  current: '0'
44
47
  })
45
-
46
48
  // Initialization of data handlers
47
49
  Alpine.data('mainNavigationHandler', mainNavigationHandler)
48
50
  Alpine.data('overlayHandler', overlayHandler)
@@ -29,15 +29,18 @@ export default () => ({
29
29
  const mouseDownHandler = (e) => {
30
30
  clickedOnScrollbar(e.clientX) ? mouseEvent() : null
31
31
  }
32
- // main scroll handler, defines scroll direction, percent of viewport scrolled, visibility of navigation and subnavigation
32
+ // main scroll handler, defines scroll direction, percent of viewport scrolled, visibility of navigation and subnavigation, checks footer top position in desktop viewport for positioning sticky sharing
33
33
  const scrollHandler = () => {
34
34
  let winScroll = document.body.scrollTop || document.documentElement.scrollTop
35
35
  winScroll > lastScrollTop ? (this.scrollingDown = true) : (this.scrollingDown = false)
36
36
  this.percent = Math.round((winScroll / height) * 100)
37
- this.$store.globalPercent.current = this.percent
38
37
  lastScrollTop = winScroll
38
+
39
+ this.checkFooterTopForSharingBottomPos()
40
+
39
41
  this.$store.navIsVisible = !this.isNavHidden()
40
42
  this.$store.subNavIsVisible = !this.isSubNavHidden()
43
+ this.$store.sectionNavIsVisible = !this.shouldSectionNavBeHidden()
41
44
  //console.log('winscroll: '+winScroll+' screen height: '+height + ' percent scrolled: '+ this.percent)
42
45
  //console.log('Scroll initiated by ' + (window.userScroll == true ? "user" : "browser"));
43
46
  }
@@ -47,6 +50,11 @@ export default () => ({
47
50
  window.addEventListener('touchmove', mouseEvent, {passive: true})
48
51
  window.addEventListener('scroll', scrollHandler, { passive: true })
49
52
  },
53
+
54
+ checkFooterTopForSharingBottomPos(){
55
+ this.$store.footerIsVisible ? this.$store.sharingBottomPos.current = window.innerHeight - document.querySelector('.js-pageFooter').getBoundingClientRect().top + 16 +'px' : null
56
+ },
57
+
50
58
  //Holds the percentage of scrolled viewport
51
59
  percent: 0,
52
60
 
@@ -1,5 +1,5 @@
1
1
  {{~#if (isStorybook)~}}
2
- <div id="commentList" class="my-14 bg-highlight-1 h-96">
2
+ <div id="commentList" class="mt-14 bg-highlight-1 h-96">
3
3
  <h2 class="m-8">
4
4
  {{> components/base/image/icon _icon="kommentar" _iconmap="icons" _addClass="mr-0.5 inline w-5 h-5 fill-current"}}
5
5
  <span class="text-base font-headingSerif">Ihre Kommentare</span>
@@ -38,6 +38,7 @@
38
38
 
39
39
  {{> components/page/story/story_article }}
40
40
  {{> components/top_button/top_button }}
41
+ {{> components/footer/page_footer }}
41
42
  </main>
42
43
 
43
44
  </div>
@@ -20,7 +20,9 @@
20
20
  {{/if}}
21
21
  {{/with}}
22
22
  {{/unless}}
23
-
23
+
24
+ {{> components/social_sharing/social_sharing_copytext}}
25
+
24
26
  {{~> components/content/copytext/copytext _isWebview=_webview ~}}
25
27
 
26
28
  {{> components/page/components/comments }}
@@ -1,5 +1,52 @@
1
- <div x-data="{
2
- open: false,
1
+ <div x-data="stickySharingHandler"
2
+ x-on:keydown.escape.prevent.stop="close($refs.button)"
3
+ x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
4
+ x-id="['dropdown-button']"
5
+ class="flex self-center justify-end ml-3 grow"
6
+ x-intersect:leave="$store.sharingIsVisible=false"
7
+ x-intersect:enter="$store.sharingIsVisible=true"
8
+ >
9
+ <div :class="{ 'grid grid-page z-110 fixed bottom-feature-box-height left-0 w-full': $store.sharingIsVisible == false}">
10
+ <div :class="{ 'flex justify-start col-full sm:col-main relative': $store.sharingIsVisible == false }">
11
+ <div :style="($store.footerIsVisible && !$screen('lg')) && {bottom:$store.sharingBottomPos.current}"
12
+ :class="{ 'bottom-5 flex-col absolute mt-3 rounded-md': $store.sharingIsVisible == false && $store.footerIsVisible == false,
13
+ 'flex-col absolute mt-3' : $store.footerIsVisible == true
14
+ }"
15
+ class="flex self-center gap-3 bg-white left-5"
16
+ >
17
+ <button
18
+ class="order-2 p-2 text-white border border-button bg-button ds-button font-heading hover:bg-button--dark hover:border-button--dark active:bg-button--dark group"
19
+ x-show="!$screen('lg')"
20
+ x-ref="button"
21
+ x-on:click="toggle()"
22
+ :aria-expanded="open"
23
+ :aria-controls="$id('dropdown-button')">
24
+ {{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
25
+ </button>
26
+
27
+ <!-- Panel -->
28
+ <div
29
+ x-ref="panel"
30
+ x-show="open || $screen('lg') && $store.sharingIsOpen == true || $screen('lg') && $store.sharingIsVisible == true"
31
+ x-transition.origin.bottom.right
32
+ x-on:click.outside="close($refs.button)"
33
+ :id="$id('dropdown-button')"
34
+ class="self-center bg-white"
35
+ :class="$store.sharingIsVisible == true ? 'h-8 absolute right-[68px] md:relative md:right-0 md:h-auto' : 'relative right-0 md:h-auto lg:hidden '"
36
+ >
37
+ <ul class="flex gap-3" :class="{ 'flex-col': $store.sharingIsVisible == false }">
38
+
39
+ {{> components/social_sharing/social_sharing_compact_icons }}
40
+ </ul>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ <script>
47
+ function stickySharingHandler(){
48
+ return {
49
+ open: this.$store.sharingIsOpen,
3
50
  sharingIsVisible: true,
4
51
  isDesktop: true,
5
52
  toggle() {
@@ -20,6 +67,7 @@
20
67
  }
21
68
  this.$refs.button.focus()
22
69
  this.open = true
70
+ this.$store.sharingIsOpen = true
23
71
  }
24
72
 
25
73
  },
@@ -27,64 +75,9 @@
27
75
  if (! this.open) return
28
76
 
29
77
  this.open = false
30
-
78
+ this.$store.sharingIsOpen = false
31
79
  focusAfter && focusAfter.focus()
32
- },
33
- checkIfDesktop() {
34
- this.isDesktop = (window.innerWidth >= 1040) ? true : false
35
- },
36
- checkNaviHeight() {
37
- let naviHeight = document.querySelector('#headerWrapper').offsetHeight -20
38
- if(!this.sharingIsVisible && window.innerWidth >= 1040 ) this.$refs.sharingWrapper.style.top = naviHeight+'px'
39
80
  }
40
- }"
41
- x-init = "checkIfDesktop()"
42
- x-on:resize.window = "checkIfDesktop()"
43
- x-on:scroll.window.debounce = "checkNaviHeight()"
44
- x-on:keydown.escape.prevent.stop="close($refs.button)"
45
- x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
46
- x-id="['dropdown-button']"
47
- class="flex self-center justify-end grow "
48
- x-intersect:leave="sharingIsVisible = false"
49
- x-intersect:enter="sharingIsVisible = true"
50
-
51
- >
52
- {{!-- <div class="fixed left-1 top-40">
53
- sharingIsVisible:<span x-text="sharingIsVisible" ></span><br>
54
- open:<span x-text="open" ></span><br>
55
- isDesktop:<span x-text="isDesktop" ></span><br>
56
- PercentScrolled:<span x-text="$store.globalPercent.current"></span>
57
- </div> --}}
58
-
59
- <div :class="{ 'grid grid-page z-100 fixed bottom-feature-box-height socialShareDesktop:bottom-auto socialShareDesktop:top-0 left-0 w-full': !sharingIsVisible }">
60
- <div class="" :class="{ 'flex justify-start col-full sm:col-main relative': !sharingIsVisible }">
61
- <div x-ref="sharingWrapper" class="flex gap-3 transition-[top]" :class="{ 'bg-white w-10 bottom-5 socialShareDesktop:top-[78px] left-5 shadow-xl socialShareDesktop:-left-2 flex-col absolute': !sharingIsVisible }">
62
- <button
63
- class="order-2 h-10 p-2 text-white border bg-button ds-button font-heading hover:bg-button--dark hover:border-button--dark active:bg-button--dark group"
64
- x-show="!isDesktop"
65
- x-ref="button"
66
- x-on:click="toggle()"
67
- :aria-expanded="open"
68
- :aria-controls="$id('dropdown-button')">
69
- {{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
70
- </button>
71
-
72
- <!-- Panel -->
73
- <div
74
- x-ref="panel"
75
- x-show="open || isDesktop"
76
- x-transition.origin.right
77
- x-on:click.outside="close($refs.button)"
78
- :id="$id('dropdown-button')"
79
- class="p-1 bg-white "
80
- :class="sharingIsVisible ? 'h-8 absolute right-[60px] md:relative md:right-0 md:h-auto' : 'relative right-0 w-8 md:h-auto '"
81
- >
82
- <ul class="flex gap-3" :class="{ 'flex-col': ! sharingIsVisible }">
83
-
84
- {{> components/social_sharing/social_sharing_compact_icons }}
85
- </ul>
86
- </div>
87
- </div>
88
- </div>
89
- </div>
90
- </div>
81
+ }
82
+ }
83
+ </script>
@@ -0,0 +1,12 @@
1
+ <div x-show="$screen('lg') && $store.sharingIsVisible == false" x-init="$store.sharingIsOpen = false" class="sticky w-10 col-start-2 mt-6 h-fit"
2
+ :class="{'top-[166px]': $store.sectionNavIsVisible && $store.subNavIsVisible && $screen('lg') ,
3
+ 'top-[130px]': $store.sectionNavIsVisible && !$store.subNavIsVisible && $screen('lg') ,
4
+ 'top-[85px]' : !$store.sectionNavIsVisible && $screen('lg')}"
5
+ >
6
+ <div
7
+ class="relative right-0 p-1 bg-white md:h-auto">
8
+ <ul class="flex flex-col gap-3">
9
+ {{> components/social_sharing/social_sharing_compact_icons }}
10
+ </ul>
11
+ </div>
12
+ </div>
@@ -1,5 +1,5 @@
1
1
  {{~#if (isStorybook)~}}
2
- <div id="commentList" class="my-14 bg-highlight-1 h-96">
2
+ <div id="commentList" class="mt-14 bg-highlight-1 h-96">
3
3
  <h2 class="m-8">
4
4
  {{> components/base/image/icon _icon="kommentar" _iconmap="icons" _addClass="mr-0.5 inline w-5 h-5 fill-current"}}
5
5
  <span class="text-base font-headingSerif">Ihre Kommentare</span>
@@ -38,6 +38,7 @@
38
38
 
39
39
  {{> components/page/story/story_article }}
40
40
  {{> components/top_button/top_button }}
41
+ {{> components/footer/page_footer }}
41
42
  </main>
42
43
 
43
44
  </div>
@@ -20,7 +20,9 @@
20
20
  {{/if}}
21
21
  {{/with}}
22
22
  {{/unless}}
23
-
23
+
24
+ {{> components/social_sharing/social_sharing_copytext}}
25
+
24
26
  {{~> components/content/copytext/copytext _isWebview=_webview ~}}
25
27
 
26
28
  {{> components/page/components/comments }}
@@ -1,5 +1,52 @@
1
- <div x-data="{
2
- open: false,
1
+ <div x-data="stickySharingHandler"
2
+ x-on:keydown.escape.prevent.stop="close($refs.button)"
3
+ x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
4
+ x-id="['dropdown-button']"
5
+ class="flex self-center justify-end ml-3 grow"
6
+ x-intersect:leave="$store.sharingIsVisible=false"
7
+ x-intersect:enter="$store.sharingIsVisible=true"
8
+ >
9
+ <div :class="{ 'grid grid-page z-110 fixed bottom-feature-box-height left-0 w-full': $store.sharingIsVisible == false}">
10
+ <div :class="{ 'flex justify-start col-full sm:col-main relative': $store.sharingIsVisible == false }">
11
+ <div :style="($store.footerIsVisible && !$screen('lg')) && {bottom:$store.sharingBottomPos.current}"
12
+ :class="{ 'bottom-5 flex-col absolute mt-3 rounded-md': $store.sharingIsVisible == false && $store.footerIsVisible == false,
13
+ 'flex-col absolute mt-3' : $store.footerIsVisible == true
14
+ }"
15
+ class="flex self-center gap-3 bg-white left-5"
16
+ >
17
+ <button
18
+ class="order-2 p-2 text-white border border-button bg-button ds-button font-heading hover:bg-button--dark hover:border-button--dark active:bg-button--dark group"
19
+ x-show="!$screen('lg')"
20
+ x-ref="button"
21
+ x-on:click="toggle()"
22
+ :aria-expanded="open"
23
+ :aria-controls="$id('dropdown-button')">
24
+ {{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
25
+ </button>
26
+
27
+ <!-- Panel -->
28
+ <div
29
+ x-ref="panel"
30
+ x-show="open || $screen('lg') && $store.sharingIsOpen == true || $screen('lg') && $store.sharingIsVisible == true"
31
+ x-transition.origin.bottom.right
32
+ x-on:click.outside="close($refs.button)"
33
+ :id="$id('dropdown-button')"
34
+ class="self-center bg-white"
35
+ :class="$store.sharingIsVisible == true ? 'h-8 absolute right-[68px] md:relative md:right-0 md:h-auto' : 'relative right-0 md:h-auto lg:hidden '"
36
+ >
37
+ <ul class="flex gap-3" :class="{ 'flex-col': $store.sharingIsVisible == false }">
38
+
39
+ {{> components/social_sharing/social_sharing_compact_icons }}
40
+ </ul>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ <script>
47
+ function stickySharingHandler(){
48
+ return {
49
+ open: this.$store.sharingIsOpen,
3
50
  sharingIsVisible: true,
4
51
  isDesktop: true,
5
52
  toggle() {
@@ -20,6 +67,7 @@
20
67
  }
21
68
  this.$refs.button.focus()
22
69
  this.open = true
70
+ this.$store.sharingIsOpen = true
23
71
  }
24
72
 
25
73
  },
@@ -27,64 +75,9 @@
27
75
  if (! this.open) return
28
76
 
29
77
  this.open = false
30
-
78
+ this.$store.sharingIsOpen = false
31
79
  focusAfter && focusAfter.focus()
32
- },
33
- checkIfDesktop() {
34
- this.isDesktop = (window.innerWidth >= 1040) ? true : false
35
- },
36
- checkNaviHeight() {
37
- let naviHeight = document.querySelector('#headerWrapper').offsetHeight -20
38
- if(!this.sharingIsVisible && window.innerWidth >= 1040 ) this.$refs.sharingWrapper.style.top = naviHeight+'px'
39
80
  }
40
- }"
41
- x-init = "checkIfDesktop()"
42
- x-on:resize.window = "checkIfDesktop()"
43
- x-on:scroll.window.debounce = "checkNaviHeight()"
44
- x-on:keydown.escape.prevent.stop="close($refs.button)"
45
- x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
46
- x-id="['dropdown-button']"
47
- class="flex self-center justify-end grow "
48
- x-intersect:leave="sharingIsVisible = false"
49
- x-intersect:enter="sharingIsVisible = true"
50
-
51
- >
52
- {{!-- <div class="fixed left-1 top-40">
53
- sharingIsVisible:<span x-text="sharingIsVisible" ></span><br>
54
- open:<span x-text="open" ></span><br>
55
- isDesktop:<span x-text="isDesktop" ></span><br>
56
- PercentScrolled:<span x-text="$store.globalPercent.current"></span>
57
- </div> --}}
58
-
59
- <div :class="{ 'grid grid-page z-100 fixed bottom-feature-box-height socialShareDesktop:bottom-auto socialShareDesktop:top-0 left-0 w-full': !sharingIsVisible }">
60
- <div class="" :class="{ 'flex justify-start col-full sm:col-main relative': !sharingIsVisible }">
61
- <div x-ref="sharingWrapper" class="flex gap-3 transition-[top]" :class="{ 'bg-white w-10 bottom-5 socialShareDesktop:top-[78px] left-5 shadow-xl socialShareDesktop:-left-2 flex-col absolute': !sharingIsVisible }">
62
- <button
63
- class="order-2 h-10 p-2 text-white border bg-button ds-button font-heading hover:bg-button--dark hover:border-button--dark active:bg-button--dark group"
64
- x-show="!isDesktop"
65
- x-ref="button"
66
- x-on:click="toggle()"
67
- :aria-expanded="open"
68
- :aria-controls="$id('dropdown-button')">
69
- {{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
70
- </button>
71
-
72
- <!-- Panel -->
73
- <div
74
- x-ref="panel"
75
- x-show="open || isDesktop"
76
- x-transition.origin.right
77
- x-on:click.outside="close($refs.button)"
78
- :id="$id('dropdown-button')"
79
- class="p-1 bg-white "
80
- :class="sharingIsVisible ? 'h-8 absolute right-[60px] md:relative md:right-0 md:h-auto' : 'relative right-0 w-8 md:h-auto '"
81
- >
82
- <ul class="flex gap-3" :class="{ 'flex-col': ! sharingIsVisible }">
83
-
84
- {{> components/social_sharing/social_sharing_compact_icons }}
85
- </ul>
86
- </div>
87
- </div>
88
- </div>
89
- </div>
90
- </div>
81
+ }
82
+ }
83
+ </script>
@@ -0,0 +1,12 @@
1
+ <div x-show="$screen('lg') && $store.sharingIsVisible == false" x-init="$store.sharingIsOpen = false" class="sticky w-10 col-start-2 mt-6 h-fit"
2
+ :class="{'top-[166px]': $store.sectionNavIsVisible && $store.subNavIsVisible && $screen('lg') ,
3
+ 'top-[130px]': $store.sectionNavIsVisible && !$store.subNavIsVisible && $screen('lg') ,
4
+ 'top-[85px]' : !$store.sectionNavIsVisible && $screen('lg')}"
5
+ >
6
+ <div
7
+ class="relative right-0 p-1 bg-white md:h-auto">
8
+ <ul class="flex flex-col gap-3">
9
+ {{> components/social_sharing/social_sharing_compact_icons }}
10
+ </ul>
11
+ </div>
12
+ </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.66.1",
9
+ "version": "1.67.0",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "storybook dev -p 6006 public",
@@ -188,7 +188,7 @@
188
188
  minmax(var(--mobile-padding), var(--desktop-padding)) [full-width-end];
189
189
  grid-column: main;
190
190
  }
191
- .grid-article > :not(.article-breakout, .article-full-width){
191
+ .grid-article > :not(.article-breakout, .article-full-width, .sticky){
192
192
  grid-column: narrow;
193
193
  }
194
194
  .article-breakout {
@@ -203,6 +203,7 @@
203
203
  .copytextWrapper > :not(.article-breakout, .article-full-width){
204
204
  grid-column: narrow;
205
205
  }
206
+
206
207
  .grid-content {
207
208
  grid-template-areas:
208
209
  "head"
@@ -39,10 +39,12 @@ Alpine.store('serviceID', {
39
39
  Alpine.store('navIsVisible', true)
40
40
  Alpine.store('subNavIsVisible', false)
41
41
  Alpine.store('footerIsVisible', false)
42
- Alpine.store('globalPercent', {
42
+ Alpine.store('sectionNavIsVisible', false)
43
+ Alpine.store('sharingIsVisible', true)
44
+ Alpine.store('sharingIsOpen', false)
45
+ Alpine.store('sharingBottomPos', {
43
46
  current: '0'
44
47
  })
45
-
46
48
  // Initialization of data handlers
47
49
  Alpine.data('mainNavigationHandler', mainNavigationHandler)
48
50
  Alpine.data('overlayHandler', overlayHandler)
@@ -1,5 +1,5 @@
1
1
  {{~#if (isStorybook)~}}
2
- <div id="commentList" class="my-14 bg-highlight-1 h-96">
2
+ <div id="commentList" class="mt-14 bg-highlight-1 h-96">
3
3
  <h2 class="m-8">
4
4
  {{> components/base/image/icon _icon="kommentar" _iconmap="icons" _addClass="mr-0.5 inline w-5 h-5 fill-current"}}
5
5
  <span class="text-base font-headingSerif">Ihre Kommentare</span>
@@ -38,6 +38,7 @@
38
38
 
39
39
  {{> components/page/story/story_article }}
40
40
  {{> components/top_button/top_button }}
41
+ {{> components/footer/page_footer }}
41
42
  </main>
42
43
 
43
44
  </div>
@@ -20,7 +20,9 @@
20
20
  {{/if}}
21
21
  {{/with}}
22
22
  {{/unless}}
23
-
23
+
24
+ {{> components/social_sharing/social_sharing_copytext}}
25
+
24
26
  {{~> components/content/copytext/copytext _isWebview=_webview ~}}
25
27
 
26
28
  {{> components/page/components/comments }}
@@ -29,15 +29,18 @@ export default () => ({
29
29
  const mouseDownHandler = (e) => {
30
30
  clickedOnScrollbar(e.clientX) ? mouseEvent() : null
31
31
  }
32
- // main scroll handler, defines scroll direction, percent of viewport scrolled, visibility of navigation and subnavigation
32
+ // main scroll handler, defines scroll direction, percent of viewport scrolled, visibility of navigation and subnavigation, checks footer top position in desktop viewport for positioning sticky sharing
33
33
  const scrollHandler = () => {
34
34
  let winScroll = document.body.scrollTop || document.documentElement.scrollTop
35
35
  winScroll > lastScrollTop ? (this.scrollingDown = true) : (this.scrollingDown = false)
36
36
  this.percent = Math.round((winScroll / height) * 100)
37
- this.$store.globalPercent.current = this.percent
38
37
  lastScrollTop = winScroll
38
+
39
+ this.checkFooterTopForSharingBottomPos()
40
+
39
41
  this.$store.navIsVisible = !this.isNavHidden()
40
42
  this.$store.subNavIsVisible = !this.isSubNavHidden()
43
+ this.$store.sectionNavIsVisible = !this.shouldSectionNavBeHidden()
41
44
  //console.log('winscroll: '+winScroll+' screen height: '+height + ' percent scrolled: '+ this.percent)
42
45
  //console.log('Scroll initiated by ' + (window.userScroll == true ? "user" : "browser"));
43
46
  }
@@ -47,6 +50,11 @@ export default () => ({
47
50
  window.addEventListener('touchmove', mouseEvent, {passive: true})
48
51
  window.addEventListener('scroll', scrollHandler, { passive: true })
49
52
  },
53
+
54
+ checkFooterTopForSharingBottomPos(){
55
+ this.$store.footerIsVisible ? this.$store.sharingBottomPos.current = window.innerHeight - document.querySelector('.js-pageFooter').getBoundingClientRect().top + 16 +'px' : null
56
+ },
57
+
50
58
  //Holds the percentage of scrolled viewport
51
59
  percent: 0,
52
60
 
@@ -1,5 +1,52 @@
1
- <div x-data="{
2
- open: false,
1
+ <div x-data="stickySharingHandler"
2
+ x-on:keydown.escape.prevent.stop="close($refs.button)"
3
+ x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
4
+ x-id="['dropdown-button']"
5
+ class="flex self-center justify-end ml-3 grow"
6
+ x-intersect:leave="$store.sharingIsVisible=false"
7
+ x-intersect:enter="$store.sharingIsVisible=true"
8
+ >
9
+ <div :class="{ 'grid grid-page z-110 fixed bottom-feature-box-height left-0 w-full': $store.sharingIsVisible == false}">
10
+ <div :class="{ 'flex justify-start col-full sm:col-main relative': $store.sharingIsVisible == false }">
11
+ <div :style="($store.footerIsVisible && !$screen('lg')) && {bottom:$store.sharingBottomPos.current}"
12
+ :class="{ 'bottom-5 flex-col absolute mt-3 rounded-md': $store.sharingIsVisible == false && $store.footerIsVisible == false,
13
+ 'flex-col absolute mt-3' : $store.footerIsVisible == true
14
+ }"
15
+ class="flex self-center gap-3 bg-white left-5"
16
+ >
17
+ <button
18
+ class="order-2 p-2 text-white border border-button bg-button ds-button font-heading hover:bg-button--dark hover:border-button--dark active:bg-button--dark group"
19
+ x-show="!$screen('lg')"
20
+ x-ref="button"
21
+ x-on:click="toggle()"
22
+ :aria-expanded="open"
23
+ :aria-controls="$id('dropdown-button')">
24
+ {{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
25
+ </button>
26
+
27
+ <!-- Panel -->
28
+ <div
29
+ x-ref="panel"
30
+ x-show="open || $screen('lg') && $store.sharingIsOpen == true || $screen('lg') && $store.sharingIsVisible == true"
31
+ x-transition.origin.bottom.right
32
+ x-on:click.outside="close($refs.button)"
33
+ :id="$id('dropdown-button')"
34
+ class="self-center bg-white"
35
+ :class="$store.sharingIsVisible == true ? 'h-8 absolute right-[68px] md:relative md:right-0 md:h-auto' : 'relative right-0 md:h-auto lg:hidden '"
36
+ >
37
+ <ul class="flex gap-3" :class="{ 'flex-col': $store.sharingIsVisible == false }">
38
+
39
+ {{> components/social_sharing/social_sharing_compact_icons }}
40
+ </ul>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ <script>
47
+ function stickySharingHandler(){
48
+ return {
49
+ open: this.$store.sharingIsOpen,
3
50
  sharingIsVisible: true,
4
51
  isDesktop: true,
5
52
  toggle() {
@@ -20,6 +67,7 @@
20
67
  }
21
68
  this.$refs.button.focus()
22
69
  this.open = true
70
+ this.$store.sharingIsOpen = true
23
71
  }
24
72
 
25
73
  },
@@ -27,64 +75,9 @@
27
75
  if (! this.open) return
28
76
 
29
77
  this.open = false
30
-
78
+ this.$store.sharingIsOpen = false
31
79
  focusAfter && focusAfter.focus()
32
- },
33
- checkIfDesktop() {
34
- this.isDesktop = (window.innerWidth >= 1040) ? true : false
35
- },
36
- checkNaviHeight() {
37
- let naviHeight = document.querySelector('#headerWrapper').offsetHeight -20
38
- if(!this.sharingIsVisible && window.innerWidth >= 1040 ) this.$refs.sharingWrapper.style.top = naviHeight+'px'
39
80
  }
40
- }"
41
- x-init = "checkIfDesktop()"
42
- x-on:resize.window = "checkIfDesktop()"
43
- x-on:scroll.window.debounce = "checkNaviHeight()"
44
- x-on:keydown.escape.prevent.stop="close($refs.button)"
45
- x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
46
- x-id="['dropdown-button']"
47
- class="flex self-center justify-end grow "
48
- x-intersect:leave="sharingIsVisible = false"
49
- x-intersect:enter="sharingIsVisible = true"
50
-
51
- >
52
- {{!-- <div class="fixed left-1 top-40">
53
- sharingIsVisible:<span x-text="sharingIsVisible" ></span><br>
54
- open:<span x-text="open" ></span><br>
55
- isDesktop:<span x-text="isDesktop" ></span><br>
56
- PercentScrolled:<span x-text="$store.globalPercent.current"></span>
57
- </div> --}}
58
-
59
- <div :class="{ 'grid grid-page z-100 fixed bottom-feature-box-height socialShareDesktop:bottom-auto socialShareDesktop:top-0 left-0 w-full': !sharingIsVisible }">
60
- <div class="" :class="{ 'flex justify-start col-full sm:col-main relative': !sharingIsVisible }">
61
- <div x-ref="sharingWrapper" class="flex gap-3 transition-[top]" :class="{ 'bg-white w-10 bottom-5 socialShareDesktop:top-[78px] left-5 shadow-xl socialShareDesktop:-left-2 flex-col absolute': !sharingIsVisible }">
62
- <button
63
- class="order-2 h-10 p-2 text-white border bg-button ds-button font-heading hover:bg-button--dark hover:border-button--dark active:bg-button--dark group"
64
- x-show="!isDesktop"
65
- x-ref="button"
66
- x-on:click="toggle()"
67
- :aria-expanded="open"
68
- :aria-controls="$id('dropdown-button')">
69
- {{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
70
- </button>
71
-
72
- <!-- Panel -->
73
- <div
74
- x-ref="panel"
75
- x-show="open || isDesktop"
76
- x-transition.origin.right
77
- x-on:click.outside="close($refs.button)"
78
- :id="$id('dropdown-button')"
79
- class="p-1 bg-white "
80
- :class="sharingIsVisible ? 'h-8 absolute right-[60px] md:relative md:right-0 md:h-auto' : 'relative right-0 w-8 md:h-auto '"
81
- >
82
- <ul class="flex gap-3" :class="{ 'flex-col': ! sharingIsVisible }">
83
-
84
- {{> components/social_sharing/social_sharing_compact_icons }}
85
- </ul>
86
- </div>
87
- </div>
88
- </div>
89
- </div>
90
- </div>
81
+ }
82
+ }
83
+ </script>
@@ -0,0 +1,12 @@
1
+ <div x-show="$screen('lg') && $store.sharingIsVisible == false" x-init="$store.sharingIsOpen = false" class="sticky w-10 col-start-2 mt-6 h-fit"
2
+ :class="{'top-[166px]': $store.sectionNavIsVisible && $store.subNavIsVisible && $screen('lg') ,
3
+ 'top-[130px]': $store.sectionNavIsVisible && !$store.subNavIsVisible && $screen('lg') ,
4
+ 'top-[85px]' : !$store.sectionNavIsVisible && $screen('lg')}"
5
+ >
6
+ <div
7
+ class="relative right-0 p-1 bg-white md:h-auto">
8
+ <ul class="flex flex-col gap-3">
9
+ {{> components/social_sharing/social_sharing_compact_icons }}
10
+ </ul>
11
+ </div>
12
+ </div>