hr-design-system-handlebars 1.75.1 → 1.75.2
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 +12 -0
- package/dist/assets/icons/icons/svgmap/copy-ds.svg +5 -21
- package/dist/assets/icons/icons/svgmap.min.svg +1 -1
- package/dist/assets/index.css +31 -21
- package/dist/assets/js/alpine.js +3 -2
- package/dist/views/components/page/components/metadatabox.hbs +1 -1
- package/dist/views/components/social_sharing/social_sharing_copytext.hbs +1 -1
- package/dist/views/components/social_sharing/social_sharing_horizontal.hbs +72 -0
- package/{src/stories/views/components/social_sharing/social_sharing_compact_icons.hbs → dist/views/components/social_sharing/social_sharing_icons.hbs} +46 -43
- package/dist/views/components/social_sharing/social_sharing_mobile.hbs +71 -0
- package/dist/views/components/top_button/top_button.hbs +19 -13
- package/dist/views_static/components/page/components/metadatabox.hbs +1 -1
- package/dist/views_static/components/social_sharing/social_sharing_copytext.hbs +1 -1
- package/dist/views_static/components/social_sharing/social_sharing_horizontal.hbs +72 -0
- package/dist/{views/components/social_sharing/social_sharing_compact_icons.hbs → views_static/components/social_sharing/social_sharing_icons.hbs} +46 -43
- package/dist/views_static/components/social_sharing/social_sharing_mobile.hbs +71 -0
- package/dist/views_static/components/top_button/top_button.hbs +19 -13
- package/package.json +1 -1
- package/src/assets/fixtures/page/metadatabox.json +2 -1
- package/src/assets/fixtures/page/metadatabox_comments.json +2 -1
- package/src/assets/fixtures/page/metadatabox_more_authors.json +2 -1
- package/src/assets/fixtures/page/metadatabox_more_authors_comments.json +2 -1
- package/src/assets/fixtures/page/metadatabox_one_author.json +2 -1
- package/src/assets/fixtures/page/metadatabox_one_author_comments.json +2 -1
- package/src/assets/fixtures/page/metadatabox_one_author_without_picture.json +2 -1
- package/src/assets/fixtures/page/story/story.inc.json +2 -1
- package/src/assets/fixtures/socialsharing/socialsharing.inc.json +2 -1
- package/src/assets/icons/icons/svgmap/copy-ds.svg +5 -21
- package/src/assets/icons/icons/svgmap.min.svg +1 -1
- package/src/assets/js/alpine.js +3 -2
- package/src/stories/views/components/page/components/metadatabox.hbs +1 -1
- package/src/stories/views/components/page/fixtures/metadatabox.json +1 -1
- package/src/stories/views/components/page/fixtures/metadatabox_comments.json +1 -1
- package/src/stories/views/components/page/fixtures/metadatabox_more_authors.json +1 -1
- package/src/stories/views/components/page/fixtures/metadatabox_more_authors_comments.json +1 -1
- package/src/stories/views/components/page/fixtures/metadatabox_one_author.json +1 -1
- package/src/stories/views/components/page/fixtures/metadatabox_one_author_comments.json +1 -1
- package/src/stories/views/components/page/fixtures/metadatabox_one_author_without_picture.json +1 -1
- package/src/stories/views/components/page/story/fixtures/story.json +1 -1
- package/src/stories/views/components/page/story/fixtures/story_with_label.json +1 -1
- package/src/stories/views/components/page/story/fixtures/story_with_livestream.json +1 -1
- package/src/stories/views/components/page/story/fixtures/story_with_square_image.json +1 -1
- package/src/stories/views/components/page/story/fixtures/story_with_video.json +1 -1
- package/src/stories/views/components/social_sharing/{social_sharing_compact.mdx → social_sharing.mdx} +1 -1
- package/src/stories/views/components/social_sharing/social_sharing.stories.js +45 -0
- package/src/stories/views/components/social_sharing/social_sharing_copytext.hbs +1 -1
- package/src/stories/views/components/social_sharing/social_sharing_horizontal.hbs +72 -0
- package/{dist/views_static/components/social_sharing/social_sharing_compact_icons.hbs → src/stories/views/components/social_sharing/social_sharing_icons.hbs} +46 -43
- package/src/stories/views/components/social_sharing/social_sharing_mobile.hbs +71 -0
- package/src/stories/views/components/top_button/top_button.hbs +19 -13
- package/dist/views/components/social_sharing/social_sharing_compact.hbs +0 -87
- package/dist/views_static/components/social_sharing/social_sharing_compact.hbs +0 -87
- package/src/stories/views/components/social_sharing/social_sharing_compact.hbs +0 -87
- package/src/stories/views/components/social_sharing/social_sharing_compact.stories.js +0 -18
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
{{~#with this.copyToClipboardLink}}
|
|
2
|
+
<li x-data="copyHandler()" x-on:click="copyToClipboard" class="relative">
|
|
3
|
+
<button class="{{#with ../_trackingData}} js-load{{/with}} flex order-2 ds-button font-heading active:scale-95 w-8 h-8"
|
|
4
|
+
title="{{loca "share_copy_linktitle" }}"
|
|
5
|
+
data-url="{{this}}"
|
|
6
|
+
{{#with ../_trackingData}}
|
|
7
|
+
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::{{if ../_socialSharingType ../_socialSharingType "default" }}::copybutton"}]}'
|
|
8
|
+
{{/with}}
|
|
9
|
+
>
|
|
10
|
+
<span x-cloak class="flex items-center justify-center w-full h-full" x-show="!copySuccess">{{~> components/base/image/icon _addClass="w-full h-full fill-link hover:scale-105" _icon="copy-ds" _iconmap="icons" ~}}</span>
|
|
11
|
+
<span x-cloak class="flex items-center justify-center w-full h-full" x-show="copySuccess">{{~> components/base/image/icon _addClass="w-6 h-6 text-green-600" _icon="status-done" _iconmap="icons" ~}}</span>
|
|
12
|
+
</button>
|
|
13
|
+
<div x-cloak x-show="copySuccess" class="absolute left-8 flex flex-row items-center justify-start px-4 shadow w-auto h-8 top-0 ml-0.5 text-xs bg-white whitespace-nowrap sm480:text-sm font-headingSerif dark:text-text-dark">
|
|
14
|
+
{{loca "share_copy_message" }}
|
|
15
|
+
</div>
|
|
16
|
+
</li>
|
|
17
|
+
<script>
|
|
18
|
+
function copyHandler(){
|
|
19
|
+
return {
|
|
20
|
+
copySuccess: false,
|
|
21
|
+
copyToClipboard(event) {
|
|
22
|
+
const clickedContainer = event.currentTarget.parentNode
|
|
23
|
+
const url = clickedContainer.querySelector ("button:first-of-type").getAttribute('data-url');
|
|
24
|
+
//TODO: maby do this with a magical helper in alpine
|
|
25
|
+
navigator.clipboard
|
|
26
|
+
.writeText(url)
|
|
27
|
+
.then(() => {
|
|
28
|
+
console.log("successfully copied");
|
|
29
|
+
this.copySuccess = true
|
|
30
|
+
window.setTimeout(() => {
|
|
31
|
+
this.copySuccess = false
|
|
32
|
+
}, 2000)
|
|
33
|
+
})
|
|
34
|
+
.catch(() => {
|
|
35
|
+
console.log("something went wrong with copy");
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
{{/with}}
|
|
1
42
|
{{~#with this.twitterLink ~}}
|
|
2
43
|
<li>
|
|
3
44
|
<a class="{{if (isUserConsentNeeded this) 'js-user-consent-needed ' ''}}{{#with ../_trackingData}} js-load{{/with}} flex order-2 ds-button font-heading active:scale-95 w-8 h-8"
|
|
@@ -7,7 +48,7 @@
|
|
|
7
48
|
rel="noopener noreferrer"
|
|
8
49
|
title="{{loca "share_x_linktitle" }}"
|
|
9
50
|
{{#with ../_trackingData}}
|
|
10
|
-
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::X"}]}'
|
|
51
|
+
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::{{if ../_socialSharingType ../_socialSharingType "default" }}::X"}]}'
|
|
11
52
|
{{/with}}
|
|
12
53
|
>
|
|
13
54
|
{{~> components/base/image/icon _addClass="w-full h-full fill-link hover:scale-105 " _icon="x-ds" _iconmap="icons" ~}}
|
|
@@ -23,7 +64,7 @@
|
|
|
23
64
|
rel="noopener noreferrer"
|
|
24
65
|
title="{{loca "share_facebook_linktitle" }}"
|
|
25
66
|
{{#with ../_trackingData}}
|
|
26
|
-
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::facebook"}]}'
|
|
67
|
+
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::{{if ../_socialSharingType ../_socialSharingType "default" }}::facebook"}]}'
|
|
27
68
|
{{/with}}
|
|
28
69
|
>
|
|
29
70
|
{{~> components/base/image/icon _addClass="w-full h-full fill-link hover:scale-105" _icon="facebook-ds" _iconmap="icons" ~}}
|
|
@@ -39,7 +80,7 @@
|
|
|
39
80
|
rel="noopener noreferrer"
|
|
40
81
|
title="{{loca "share_whatsapp_linktitle" }}"
|
|
41
82
|
{{#with ../_trackingData}}
|
|
42
|
-
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::whatsapp"}]}'
|
|
83
|
+
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::{{if ../_socialSharingType ../_socialSharingType "default" }}::whatsapp"}]}'
|
|
43
84
|
{{/with}}
|
|
44
85
|
>
|
|
45
86
|
{{~> components/base/image/icon _addClass="w-full h-full fill-link hover:scale-105" _icon="whatsapp-ds" _iconmap="icons" ~}}
|
|
@@ -53,48 +94,10 @@
|
|
|
53
94
|
href="{{this}}"
|
|
54
95
|
title="{{loca "share_mail_linktitle" }}"
|
|
55
96
|
{{#with ../_trackingData}}
|
|
56
|
-
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::mailto"}]}'
|
|
97
|
+
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::{{if ../_socialSharingType ../_socialSharingType "default" }}::mailto"}]}'
|
|
57
98
|
{{/with}}
|
|
58
99
|
>
|
|
59
100
|
{{~> components/base/image/icon _addClass="w-full h-full fill-link hover:scale-105" _icon="kontakt-ds" _iconmap="icons" ~}}
|
|
60
101
|
</a>
|
|
61
102
|
</li>
|
|
62
|
-
{{/with}}
|
|
63
|
-
|
|
64
|
-
<li x-data="copyHandler()" x-on:click="copyToClipboard" class="">
|
|
65
|
-
<button class="{{#with ../_trackingData}} js-load{{/with}} flex order-2 ds-button font-heading active:scale-95 w-8 h-8"
|
|
66
|
-
title="{{loca "share_copy_linktitle" }}"
|
|
67
|
-
{{#with ../_trackingData}}
|
|
68
|
-
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::copybutton"}]}'
|
|
69
|
-
{{/with}}
|
|
70
|
-
>
|
|
71
|
-
{{~> components/base/image/icon _addClass="w-full h-full fill-link hover:scale-105" _icon="copy-ds" _iconmap="icons" ~}}
|
|
72
|
-
</button>
|
|
73
|
-
<div class="absolute flex flex-row items-center justify-start rounded pr-4 shadow hidden w-auto h-8 -mt-8 ml-0.5 text-xs bg-white whitespace-nowrap js-copyMessage sm480:text-sm font-headingSerif dark:text-text-dark">
|
|
74
|
-
{{~> components/base/image/icon _addClass="w-7 h-7 text-green-600 mr-4" _icon="status-done" _iconmap="icons" ~}}
|
|
75
|
-
{{loca "share_copy_message" }}
|
|
76
|
-
</div>
|
|
77
|
-
</li>
|
|
78
|
-
<script>
|
|
79
|
-
function copyHandler(){
|
|
80
|
-
return {
|
|
81
|
-
copyToClipboard(event) {
|
|
82
|
-
const clickedContainer = event.currentTarget.parentNode
|
|
83
|
-
const messageDiv = clickedContainer.querySelector('.js-copyMessage')
|
|
84
|
-
const el = document.createElement('textarea')
|
|
85
|
-
el.value = window.location.href
|
|
86
|
-
el.setAttribute('readonly', '')
|
|
87
|
-
el.style.position = 'absolute'
|
|
88
|
-
el.style.left = '-9999px'
|
|
89
|
-
document.body.appendChild(el)
|
|
90
|
-
el.select()
|
|
91
|
-
document.execCommand('copy')
|
|
92
|
-
document.body.removeChild(el)
|
|
93
|
-
messageDiv.classList.remove('hidden')
|
|
94
|
-
window.setTimeout(() => {
|
|
95
|
-
messageDiv.classList.add('hidden')
|
|
96
|
-
}, 2000)
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
</script>
|
|
103
|
+
{{/with}}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
|
|
2
|
+
{{~#with this.socialSharing ~}}
|
|
3
|
+
<div x-data="stickySharingHandlerMobile"
|
|
4
|
+
class=" relative ml-5 z-100 h-9.5 w-9.5"
|
|
5
|
+
:class="$store.footerIsVisible ? '-mt-6' : '-mt-12'"
|
|
6
|
+
x-on:resize.window="$store.sharingIsOpenMobile = false"
|
|
7
|
+
x-on:keydown.escape.prevent.stop="close($refs.button)"
|
|
8
|
+
@click.outside="close()"
|
|
9
|
+
>
|
|
10
|
+
<div class="absolute bottom-0 flex flex-col self-center gap-3 bg-white">
|
|
11
|
+
<button
|
|
12
|
+
class="{{#with ../this.trackingData}}js-load {{/with}}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 lg:hidden"
|
|
13
|
+
x-ref="button"
|
|
14
|
+
x-on:click="toggle()"
|
|
15
|
+
:aria-expanded="open"
|
|
16
|
+
:aria-controls="$id('dropdown-button')"
|
|
17
|
+
|
|
18
|
+
{{#with ../this.trackingData}}
|
|
19
|
+
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::sharingmenuopened"}]}'
|
|
20
|
+
{{/with}}
|
|
21
|
+
|
|
22
|
+
>
|
|
23
|
+
{{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
|
|
24
|
+
</button>
|
|
25
|
+
<div
|
|
26
|
+
x-ref="panel"
|
|
27
|
+
:class="$store.sharingIsOpenMobile ? 'flex' : 'hidden '"
|
|
28
|
+
:id="$id('dropdown-button')"
|
|
29
|
+
class="relative right-0 self-center bg-white md:h-auto lg:hidden"
|
|
30
|
+
>
|
|
31
|
+
<ul class="flex flex-col gap-3 mt-2">
|
|
32
|
+
{{> components/social_sharing/social_sharing_icons _socialSharingType="mobile-sticky"}}
|
|
33
|
+
</ul>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<script>
|
|
38
|
+
function stickySharingHandlerMobile(){
|
|
39
|
+
return {
|
|
40
|
+
open: false,
|
|
41
|
+
sharingIsVisible: true,
|
|
42
|
+
isDesktop: true,
|
|
43
|
+
toggle() {
|
|
44
|
+
var isMobileApple = /^iP/.test(navigator.platform) || /^Mac/.test(navigator.platform) && navigator.maxTouchPoints > 4;
|
|
45
|
+
var isMobileOther= navigator.userAgent.match(/(Android)|(webOS)|(Blackberry)|(Windows Phone)/i);
|
|
46
|
+
var isMobile= isMobileApple || isMobileOther;
|
|
47
|
+
if (navigator.share && isMobile) {
|
|
48
|
+
navigator.share({
|
|
49
|
+
title: document.title,
|
|
50
|
+
text: 'Schau mal was ich auf hessenschau.de gefunden habe!',
|
|
51
|
+
url: window.location.href,
|
|
52
|
+
})
|
|
53
|
+
.then(() => console.log('Shared successfully'))
|
|
54
|
+
.catch((error) => console.error('Sharing failed:', error));
|
|
55
|
+
} else {
|
|
56
|
+
if (this.$store.sharingIsOpenMobile) {
|
|
57
|
+
return this.close()
|
|
58
|
+
}
|
|
59
|
+
this.$refs.button.focus()
|
|
60
|
+
this.$store.sharingIsOpenMobile = true
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
},
|
|
64
|
+
close(focusAfter) {
|
|
65
|
+
if (!this.$store.sharingIsOpenMobile) return
|
|
66
|
+
this.$store.sharingIsOpenMobile = false
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
{{/with}}
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
<div class="
|
|
2
|
-
<div class="grid
|
|
3
|
-
<div class="flex justify-
|
|
4
|
-
:class="{ 'bg-white': $store.footerIsVisible }"
|
|
1
|
+
<div class="" x-data="{ isVisible: false }">
|
|
2
|
+
<div class="grid grid-page z-100" :class="{ 'fixed bottom-feature-box-height left-0 w-full': !$store.footerIsVisible }">
|
|
3
|
+
<div class="flex justify-between h-0 col-full sm:col-main"
|
|
4
|
+
:class="{ 'bg-white h-8': $store.footerIsVisible }"
|
|
5
|
+
x-show="!$store.sharingIsVisible && isVisible"
|
|
6
|
+
x-transition:enter="transition ease-[cubic-bezier(0.68,-0.3,0.32,1)] duration-500 transform order-first"
|
|
7
|
+
x-transition:enter-start="opacity-0 translate-y-8"
|
|
8
|
+
x-transition:enter-end="opacity-100 translate-y-0"
|
|
9
|
+
x-transition:leave="transition ease-[cubic-bezier(0.68,-0.3,0.32,1)] duration-300"
|
|
10
|
+
x-transition:leave-start="opacity-100 translate-y-0"
|
|
11
|
+
x-transition:leave-end="opacity-0 translate-y-12"
|
|
12
|
+
@scroll.window="isVisible = ((window.pageYOffset * 2) > (window.innerHeight || (document.documentElement || document.body).clientHeight))"
|
|
13
|
+
>
|
|
14
|
+
{{> components/social_sharing/social_sharing_mobile }}
|
|
15
|
+
|
|
5
16
|
<button
|
|
6
|
-
|
|
17
|
+
|
|
7
18
|
@click="window.scrollTo({top: 0, behavior: 'smooth'})"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
x-transition:enter-start="opacity-0 -translate-y-8"
|
|
11
|
-
x-transition:enter-end="opacity-100 translate-y-0"
|
|
12
|
-
x-transition:leave="transition ease-[cubic-bezier(0.68,-0.3,0.32,1)] duration-300 transform absolute"
|
|
13
|
-
x-transition:leave-start="opacity-100 translate-y-0"
|
|
14
|
-
x-transition:leave-end="opacity-0 translate-y-12"
|
|
15
|
-
class="{{> components/button/utilities/button_base_classes}} {{> components/button/utilities/button_variation_classes _variant="primary"}} -mt-6 z-100 p-2 h-max mr-5 hover:scale-105 [@media(min-width:1170px)]:-mr-14"
|
|
19
|
+
:class="$store.footerIsVisible ? '-mt-6' : '-mt-12'"
|
|
20
|
+
class="{{> components/button/utilities/button_base_classes}} {{> components/button/utilities/button_variation_classes _variant="primary"}} ml-auto z-100 p-2 h-max mr-5 hover:scale-105 [@media(min-width:1170px)]:-mr-14"
|
|
16
21
|
>
|
|
17
22
|
{{> components/base/image/icon _icon="arrow-up" _addClass="w-5 h-5 fill-current dark:fill-link-dark"}}
|
|
18
23
|
</button>
|
|
24
|
+
|
|
19
25
|
</div>
|
|
20
26
|
</div>
|
|
21
27
|
{{! Dieses DIV ist notwendig um bei Seiten mit einem Hintergrund zu vermeiden dass unten eine Lücke entsteht bei der das hintergrundbild durchscheint}}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
{{~#with this.socialSharing ~}}
|
|
2
|
-
<div x-data="stickySharingHandler"
|
|
3
|
-
x-on:keydown.escape.prevent.stop="close($refs.button)"
|
|
4
|
-
x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
|
|
5
|
-
x-id="['dropdown-button']"
|
|
6
|
-
class="flex self-center justify-end ml-3 grow"
|
|
7
|
-
x-intersect:leave="$store.sharingIsVisible=false"
|
|
8
|
-
x-intersect:enter="$store.sharingIsVisible=true"
|
|
9
|
-
>
|
|
10
|
-
<div :class="{ 'grid grid-page z-110 fixed bottom-feature-box-height left-0 w-full': $store.sharingIsVisible == false}">
|
|
11
|
-
<div :class="{ 'flex justify-start col-full sm:col-main relative': $store.sharingIsVisible == false }">
|
|
12
|
-
<div :style="($store.footerIsVisible && !$screen('lg')) && {bottom:$store.sharingBottomPos.current}"
|
|
13
|
-
:class="{ 'bottom-[19px] flex-col absolute mt-3 rounded-md': $store.sharingIsVisible == false && $store.footerIsVisible == false,
|
|
14
|
-
'flex-col absolute mt-3' : !$screen('lg') && $store.footerIsVisible == true && window.innerHeight > document.querySelector('#content').offsetHeight + document.querySelector('.sb-main-navigation').offsetHeight + (window.innerHeight - document.querySelector('footer').offsetTop) - document.querySelector('footer').offsetHeight}"
|
|
15
|
-
class="flex self-center gap-3 bg-white left-5">
|
|
16
|
-
<button
|
|
17
|
-
class="{{#with ../this.trackingData}}js-load {{/with}}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"
|
|
18
|
-
x-show="!$screen('lg')"
|
|
19
|
-
x-ref="button"
|
|
20
|
-
x-on:click="toggle()"
|
|
21
|
-
:aria-expanded="open"
|
|
22
|
-
:aria-controls="$id('dropdown-button')"
|
|
23
|
-
|
|
24
|
-
{{#with ../this.trackingData}}
|
|
25
|
-
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::sharingmenuopened"}]}'
|
|
26
|
-
{{/with}}
|
|
27
|
-
|
|
28
|
-
>
|
|
29
|
-
{{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
|
|
30
|
-
</button>
|
|
31
|
-
|
|
32
|
-
<!-- Panel -->
|
|
33
|
-
<div
|
|
34
|
-
x-ref="panel"
|
|
35
|
-
x-show="open || $screen('lg') && $store.sharingIsOpen == true || $screen('lg') && $store.sharingIsVisible == true"
|
|
36
|
-
x-transition.origin.bottom.right
|
|
37
|
-
x-on:click.outside="close($refs.button)"
|
|
38
|
-
:id="$id('dropdown-button')"
|
|
39
|
-
class="self-center bg-white"
|
|
40
|
-
: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 '"
|
|
41
|
-
>
|
|
42
|
-
<ul class="flex gap-3" :class="{ 'flex-col': $store.sharingIsVisible == false }">
|
|
43
|
-
{{> components/social_sharing/social_sharing_compact_icons _trackingData=../this.trackingData}}
|
|
44
|
-
</ul>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
{{/with}}
|
|
51
|
-
<script>
|
|
52
|
-
function stickySharingHandler(){
|
|
53
|
-
return {
|
|
54
|
-
open: this.$store.sharingIsOpen,
|
|
55
|
-
sharingIsVisible: true,
|
|
56
|
-
isDesktop: true,
|
|
57
|
-
toggle() {
|
|
58
|
-
var isMobileApple = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)/i);
|
|
59
|
-
var isMobileOther= navigator.userAgent.match(/(Android)|(webOS)|(Blackberry)|(Windows Phone)/i);
|
|
60
|
-
var isMobile= isMobileApple || isMobileOther;
|
|
61
|
-
if (navigator.share && isMobile) {
|
|
62
|
-
navigator.share({
|
|
63
|
-
title: document.title,
|
|
64
|
-
text: 'Schau mal was ich auf hessenschau.de gefunden habe!',
|
|
65
|
-
url: window.location.href,
|
|
66
|
-
})
|
|
67
|
-
.then(() => console.log('Shared successfully'))
|
|
68
|
-
.catch((error) => console.error('Sharing failed:', error));
|
|
69
|
-
} else {
|
|
70
|
-
if (this.open) {
|
|
71
|
-
return this.close()
|
|
72
|
-
}
|
|
73
|
-
this.$refs.button.focus()
|
|
74
|
-
this.open = true
|
|
75
|
-
this.$store.sharingIsOpen = true
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
close(focusAfter) {
|
|
80
|
-
if (! this.open) return
|
|
81
|
-
this.open = false
|
|
82
|
-
this.$store.sharingIsOpen = false
|
|
83
|
-
focusAfter && focusAfter.focus()
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
</script>
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
{{~#with this.socialSharing ~}}
|
|
2
|
-
<div x-data="stickySharingHandler"
|
|
3
|
-
x-on:keydown.escape.prevent.stop="close($refs.button)"
|
|
4
|
-
x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
|
|
5
|
-
x-id="['dropdown-button']"
|
|
6
|
-
class="flex self-center justify-end ml-3 grow"
|
|
7
|
-
x-intersect:leave="$store.sharingIsVisible=false"
|
|
8
|
-
x-intersect:enter="$store.sharingIsVisible=true"
|
|
9
|
-
>
|
|
10
|
-
<div :class="{ 'grid grid-page z-110 fixed bottom-feature-box-height left-0 w-full': $store.sharingIsVisible == false}">
|
|
11
|
-
<div :class="{ 'flex justify-start col-full sm:col-main relative': $store.sharingIsVisible == false }">
|
|
12
|
-
<div :style="($store.footerIsVisible && !$screen('lg')) && {bottom:$store.sharingBottomPos.current}"
|
|
13
|
-
:class="{ 'bottom-[19px] flex-col absolute mt-3 rounded-md': $store.sharingIsVisible == false && $store.footerIsVisible == false,
|
|
14
|
-
'flex-col absolute mt-3' : !$screen('lg') && $store.footerIsVisible == true && window.innerHeight > document.querySelector('#content').offsetHeight + document.querySelector('.sb-main-navigation').offsetHeight + (window.innerHeight - document.querySelector('footer').offsetTop) - document.querySelector('footer').offsetHeight}"
|
|
15
|
-
class="flex self-center gap-3 bg-white left-5">
|
|
16
|
-
<button
|
|
17
|
-
class="{{#with ../this.trackingData}}js-load {{/with}}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"
|
|
18
|
-
x-show="!$screen('lg')"
|
|
19
|
-
x-ref="button"
|
|
20
|
-
x-on:click="toggle()"
|
|
21
|
-
:aria-expanded="open"
|
|
22
|
-
:aria-controls="$id('dropdown-button')"
|
|
23
|
-
|
|
24
|
-
{{#with ../this.trackingData}}
|
|
25
|
-
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::sharingmenuopened"}]}'
|
|
26
|
-
{{/with}}
|
|
27
|
-
|
|
28
|
-
>
|
|
29
|
-
{{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
|
|
30
|
-
</button>
|
|
31
|
-
|
|
32
|
-
<!-- Panel -->
|
|
33
|
-
<div
|
|
34
|
-
x-ref="panel"
|
|
35
|
-
x-show="open || $screen('lg') && $store.sharingIsOpen == true || $screen('lg') && $store.sharingIsVisible == true"
|
|
36
|
-
x-transition.origin.bottom.right
|
|
37
|
-
x-on:click.outside="close($refs.button)"
|
|
38
|
-
:id="$id('dropdown-button')"
|
|
39
|
-
class="self-center bg-white"
|
|
40
|
-
: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 '"
|
|
41
|
-
>
|
|
42
|
-
<ul class="flex gap-3" :class="{ 'flex-col': $store.sharingIsVisible == false }">
|
|
43
|
-
{{> components/social_sharing/social_sharing_compact_icons _trackingData=../this.trackingData}}
|
|
44
|
-
</ul>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
{{/with}}
|
|
51
|
-
<script>
|
|
52
|
-
function stickySharingHandler(){
|
|
53
|
-
return {
|
|
54
|
-
open: this.$store.sharingIsOpen,
|
|
55
|
-
sharingIsVisible: true,
|
|
56
|
-
isDesktop: true,
|
|
57
|
-
toggle() {
|
|
58
|
-
var isMobileApple = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)/i);
|
|
59
|
-
var isMobileOther= navigator.userAgent.match(/(Android)|(webOS)|(Blackberry)|(Windows Phone)/i);
|
|
60
|
-
var isMobile= isMobileApple || isMobileOther;
|
|
61
|
-
if (navigator.share && isMobile) {
|
|
62
|
-
navigator.share({
|
|
63
|
-
title: document.title,
|
|
64
|
-
text: 'Schau mal was ich auf hessenschau.de gefunden habe!',
|
|
65
|
-
url: window.location.href,
|
|
66
|
-
})
|
|
67
|
-
.then(() => console.log('Shared successfully'))
|
|
68
|
-
.catch((error) => console.error('Sharing failed:', error));
|
|
69
|
-
} else {
|
|
70
|
-
if (this.open) {
|
|
71
|
-
return this.close()
|
|
72
|
-
}
|
|
73
|
-
this.$refs.button.focus()
|
|
74
|
-
this.open = true
|
|
75
|
-
this.$store.sharingIsOpen = true
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
close(focusAfter) {
|
|
80
|
-
if (! this.open) return
|
|
81
|
-
this.open = false
|
|
82
|
-
this.$store.sharingIsOpen = false
|
|
83
|
-
focusAfter && focusAfter.focus()
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
</script>
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
{{~#with this.socialSharing ~}}
|
|
2
|
-
<div x-data="stickySharingHandler"
|
|
3
|
-
x-on:keydown.escape.prevent.stop="close($refs.button)"
|
|
4
|
-
x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
|
|
5
|
-
x-id="['dropdown-button']"
|
|
6
|
-
class="flex self-center justify-end ml-3 grow"
|
|
7
|
-
x-intersect:leave="$store.sharingIsVisible=false"
|
|
8
|
-
x-intersect:enter="$store.sharingIsVisible=true"
|
|
9
|
-
>
|
|
10
|
-
<div :class="{ 'grid grid-page z-110 fixed bottom-feature-box-height left-0 w-full': $store.sharingIsVisible == false}">
|
|
11
|
-
<div :class="{ 'flex justify-start col-full sm:col-main relative': $store.sharingIsVisible == false }">
|
|
12
|
-
<div :style="($store.footerIsVisible && !$screen('lg')) && {bottom:$store.sharingBottomPos.current}"
|
|
13
|
-
:class="{ 'bottom-[19px] flex-col absolute mt-3 rounded-md': $store.sharingIsVisible == false && $store.footerIsVisible == false,
|
|
14
|
-
'flex-col absolute mt-3' : !$screen('lg') && $store.footerIsVisible == true && window.innerHeight > document.querySelector('#content').offsetHeight + document.querySelector('.sb-main-navigation').offsetHeight + (window.innerHeight - document.querySelector('footer').offsetTop) - document.querySelector('footer').offsetHeight}"
|
|
15
|
-
class="flex self-center gap-3 bg-white left-5">
|
|
16
|
-
<button
|
|
17
|
-
class="{{#with ../this.trackingData}}js-load {{/with}}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"
|
|
18
|
-
x-show="!$screen('lg')"
|
|
19
|
-
x-ref="button"
|
|
20
|
-
x-on:click="toggle()"
|
|
21
|
-
:aria-expanded="open"
|
|
22
|
-
:aria-controls="$id('dropdown-button')"
|
|
23
|
-
|
|
24
|
-
{{#with ../this.trackingData}}
|
|
25
|
-
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "socialShareClick::sharingmenuopened"}]}'
|
|
26
|
-
{{/with}}
|
|
27
|
-
|
|
28
|
-
>
|
|
29
|
-
{{> components/base/image/icon _addClass="w-5 h-5 fill-current group-hover:fill-link--dark" _icon="sharing" _iconmap="icons" }}
|
|
30
|
-
</button>
|
|
31
|
-
|
|
32
|
-
<!-- Panel -->
|
|
33
|
-
<div
|
|
34
|
-
x-ref="panel"
|
|
35
|
-
x-show="open || $screen('lg') && $store.sharingIsOpen == true || $screen('lg') && $store.sharingIsVisible == true"
|
|
36
|
-
x-transition.origin.bottom.right
|
|
37
|
-
x-on:click.outside="close($refs.button)"
|
|
38
|
-
:id="$id('dropdown-button')"
|
|
39
|
-
class="self-center bg-white"
|
|
40
|
-
: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 '"
|
|
41
|
-
>
|
|
42
|
-
<ul class="flex gap-3" :class="{ 'flex-col': $store.sharingIsVisible == false }">
|
|
43
|
-
{{> components/social_sharing/social_sharing_compact_icons _trackingData=../this.trackingData}}
|
|
44
|
-
</ul>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
{{/with}}
|
|
51
|
-
<script>
|
|
52
|
-
function stickySharingHandler(){
|
|
53
|
-
return {
|
|
54
|
-
open: this.$store.sharingIsOpen,
|
|
55
|
-
sharingIsVisible: true,
|
|
56
|
-
isDesktop: true,
|
|
57
|
-
toggle() {
|
|
58
|
-
var isMobileApple = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)/i);
|
|
59
|
-
var isMobileOther= navigator.userAgent.match(/(Android)|(webOS)|(Blackberry)|(Windows Phone)/i);
|
|
60
|
-
var isMobile= isMobileApple || isMobileOther;
|
|
61
|
-
if (navigator.share && isMobile) {
|
|
62
|
-
navigator.share({
|
|
63
|
-
title: document.title,
|
|
64
|
-
text: 'Schau mal was ich auf hessenschau.de gefunden habe!',
|
|
65
|
-
url: window.location.href,
|
|
66
|
-
})
|
|
67
|
-
.then(() => console.log('Shared successfully'))
|
|
68
|
-
.catch((error) => console.error('Sharing failed:', error));
|
|
69
|
-
} else {
|
|
70
|
-
if (this.open) {
|
|
71
|
-
return this.close()
|
|
72
|
-
}
|
|
73
|
-
this.$refs.button.focus()
|
|
74
|
-
this.open = true
|
|
75
|
-
this.$store.sharingIsOpen = true
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
close(focusAfter) {
|
|
80
|
-
if (! this.open) return
|
|
81
|
-
this.open = false
|
|
82
|
-
this.$store.sharingIsOpen = false
|
|
83
|
-
focusAfter && focusAfter.focus()
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
</script>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import story_template from './social_sharing_compact.hbs'
|
|
2
|
-
import socialSharing from '../page/story/fixtures/story.json'
|
|
3
|
-
|
|
4
|
-
console.log(socialSharing)
|
|
5
|
-
const Template = ({ ...args }) => {
|
|
6
|
-
return story_template({ ...args })
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Komponenten/Social Sharing',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const Default = {
|
|
14
|
-
render: Template.bind({}),
|
|
15
|
-
name: 'Social Sharing Kompakt',
|
|
16
|
-
args: socialSharing
|
|
17
|
-
|
|
18
|
-
}
|