7
7
@case (' icon' )
8
8
@break
9
9
@case (' phone' )
10
- <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a class =" button button-default button button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ route ( ' clickNumber ' ) . ' / ' . $link -> id . " ? " . $link -> link } }" ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /phone{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) } } phone.svg @endif " ></i >{{ $link -> title } } </a ></div >
10
+ <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a id = " {{ $link -> id } } " class =" button button-default button-click button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ $link -> link } }" ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /phone{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) } } phone.svg @endif " ></i >{{ $link -> title } } </a ></div >
11
11
@break
12
12
@case (' default email' )
13
13
@case (' default email_alt' )
14
- <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a class =" button button-default button button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ route ( ' clickNumber ' ) . ' / ' . $link -> id . " ? " . $link -> link } }" ><img alt =" email" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /email{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) } } email.svg @endif " ></i >{{ $link -> title } } </a ></div >
14
+ <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a id = " {{ $link -> id } } " class =" button button-default button-click button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ $link -> link } }" ><img alt =" email" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /email{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) } } email.svg @endif " ></i >{{ $link -> title } } </a ></div >
15
15
@break
16
16
@case (' buy me a coffee' )
17
- <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a class =" button button-coffee button button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ route ( ' clickNumber ' ) . ' / ' . $link -> id . " ? " . $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /coffee{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) } } coffee.svg @endif " >Buy me a Coffee</a ></div >
17
+ <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a id = " {{ $link -> id } } " class =" button button-coffee button-click button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /coffee{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) } } coffee.svg @endif " >Buy me a Coffee</a ></div >
18
18
@break
19
19
@case (' space' )
20
20
@php $title = $link -> title ; if (is_numeric ($title )) { echo str_repeat (" <br>" , $title < 10 ? $title : 10 ); } else { echo " <br><br><br>" ; } @endphp
26
26
<div class =" fadein" ><span style =" " >@if (env (' ALLOW_USER_HTML' ) === true ){!! $link -> title ! !}@else {{ $link -> title } }@endif </span ></div >
27
27
@break
28
28
@case (' vcard' )
29
- <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a class =" button button-default button button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ route (' vcard' ) . ' /' . $link -> id } }" ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /vcard{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) } } vcard.svg @endif " ></i >{{ $link -> title } } </a ></div >
29
+ <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a id = " {{ $link -> id } } " class =" button button-default button-click button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ route (' vcard' ) . ' /' . $link -> id } }" ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /vcard{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) } } vcard.svg @endif " ></i >{{ $link -> title } } </a ></div >
30
30
@break
31
31
@case (' custom' )
32
32
@if ($link -> custom_css === " " or $link -> custom_css === " NULL" or (theme (' allow_custom_buttons' ) == " false" ) )
33
- <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a class =" button button-{{ $link -> name } } button button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ route ( ' clickNumber ' ) . ' / ' . $link -> id . " ? " . $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><i style =" color : {{$link->custom_icon}}" class =" icon hvr-icon fa {{ $link -> custom_icon } }" ></i >{{ $link -> title } } </a ></div >
33
+ <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a id = " {{ $link -> id } } " class =" button button-{{ $link -> name } } button-click button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><i style =" color : {{$link->custom_icon}}" class =" icon hvr-icon fa {{ $link -> custom_icon } }" ></i >{{ $link -> title } } </a ></div >
34
34
@break
35
35
@elseif ($link -> custom_css != " " )
36
- <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a class =" button button-hover icon-hover" style =" {{ $link -> custom_css } }" rel =" noopener noreferrer nofollow noindex" href =" {{ route ( ' clickNumber ' ) . ' / ' . $link -> id . " ? " . $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><i style =" color : {{$link->custom_icon}}" class =" icon hvr-icon fa {{ $link -> custom_icon } }" ></i >{{ $link -> title } } </a ></div >
36
+ <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a id = " {{ $link -> id } } " class =" button-click button-hover icon-hover" style =" {{ $link -> custom_css } }" rel =" noopener noreferrer nofollow noindex" href =" {{ $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><i style =" color : {{$link->custom_icon}}" class =" icon hvr-icon fa {{ $link -> custom_icon } }" ></i >{{ $link -> title } } </a ></div >
37
37
@break
38
38
@endif
39
39
@case (' custom_website' )
40
40
@if ($link -> custom_css === " " or $link -> custom_css === " NULL" or (theme (' allow_custom_buttons' ) == " false" ) )
41
- <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a class =" button button-custom_website button button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ route ( ' clickNumber ' ) . ' / ' . $link -> id . " ? " . $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (file_exists (base_path (" assets/favicon/icons/" ). localIcon ($link -> id )) ){{ url (' assets/favicon/icons/' . localIcon ($link -> id ))} }@else {{ getFavIcon ($link -> id )} }@endif " onerror =" this.onerror=null; this.src='{{ asset (' assets/linkstack/icons/website.svg' )} } ';" >{{ $link -> title } } </a ></div >
41
+ <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a id = " {{ $link -> id } } " class =" button button-custom_website button-click button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (file_exists (base_path (" assets/favicon/icons/" ). localIcon ($link -> id )) ){{ url (' assets/favicon/icons/' . localIcon ($link -> id ))} }@else {{ getFavIcon ($link -> id )} }@endif " onerror =" this.onerror=null; this.src='{{ asset (' assets/linkstack/icons/website.svg' )} } ';" >{{ $link -> title } } </a ></div >
42
42
@break
43
43
@elseif ($link -> custom_css != " " )
44
- <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a class =" button button-hover icon-hover" style =" {{ $link -> custom_css } }" rel =" noopener noreferrer nofollow noindex" href =" {{ route ( ' clickNumber ' ) . ' / ' . $link -> id . " ? " . $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (file_exists (base_path (" assets/favicon/icons/" ). localIcon ($link -> id )) ){{ url (' assets/favicon/icons/' . localIcon ($link -> id ))} }@else {{ getFavIcon ($link -> id )} }@endif " onerror =" this.onerror=null; this.src='{{ asset (' assets/linkstack/icons/website.svg' )} } ';" >{{ $link -> title } } </a ></div >
44
+ <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a id = " {{ $link -> id } } " class =" button-click button-hover icon-hover" style =" {{ $link -> custom_css } }" rel =" noopener noreferrer nofollow noindex" href =" {{ $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (file_exists (base_path (" assets/favicon/icons/" ). localIcon ($link -> id )) ){{ url (' assets/favicon/icons/' . localIcon ($link -> id ))} }@else {{ getFavIcon ($link -> id )} }@endif " onerror =" this.onerror=null; this.src='{{ asset (' assets/linkstack/icons/website.svg' )} } ';" >{{ $link -> title } } </a ></div >
45
45
@break
46
46
@endif
47
47
@default
48
48
<?php include base_path (' config/button-names.php' ); $newLinkName = $linkName ; $isNewName = " false" ; foreach ($buttonNames as $key => $value ) { if ($newLinkName == $key ) { $newLinkName = $value ; $isNewName = " true" ; }} ? >
49
- <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a class =" button button-{{ $link -> name } } button button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ route ( ' clickNumber ' ) . ' / ' . $link -> id . " ? " . $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /{{ $link -> name } }{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) . $link -> name } } .svg @endif " >@if ($isNewName == " true" ){{ ucfirst ($newLinkName ) } }@else {{ ucfirst ($newLinkName ) } }@endif </a ></div >
49
+ <div style =" --delay : {{ $initial ++ }}s " class =" button-entrance" ><a id = " {{ $link -> id } } " class =" button button-{{ $link -> name } } button-click button-hover icon-hover" rel =" noopener noreferrer nofollow noindex" href =" {{ $link -> link } }" @if (theme (' open_links_in_same_tab' ) != " true" )target =" _blank" @endif ><img alt =" {{ $link -> name } }" class =" icon hvr-icon" src =" @if (theme (' use_custom_icons' ) == " true" ){{ url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-icons' ) } } /{{ $link -> name } }{{ theme (' custom_icon_extension' )} } @else {{ asset (' \/assets/linkstack/icons\/' ) . $link -> name } } .svg @endif " >@if ($isNewName == " true" ){{ ucfirst ($newLinkName ) } }@else {{ ucfirst ($newLinkName ) } }@endif </a ></div >
50
50
@endswitch
51
- @endforeach
51
+ @endforeach
52
+
53
+ <script >
54
+ document .addEventListener (' DOMContentLoaded' , function () {
55
+ function handleClickOrTouch (event ) {
56
+ if (event .target .classList .contains (' button-click' )) {
57
+ var id = event .target .id ;
58
+ if (! sessionStorage .getItem (' clicked-' + id)) {
59
+ var url = ' {{ route (" clickNumber" ) } } /' + id;
60
+ fetch (url, {
61
+ method: ' GET' ,
62
+ headers: {
63
+ ' Content-Type' : ' application/json' ,
64
+ },
65
+ });
66
+ sessionStorage .setItem (' clicked-' + id, ' true' );
67
+ }
68
+ }
69
+ }
70
+
71
+ document .addEventListener (' mousedown' , function (event ) {
72
+ if (event .button === 0 || event .button === 1 ) {
73
+ handleClickOrTouch (event );
74
+ }
75
+ });
76
+
77
+ document .addEventListener (' touchstart' , handleClickOrTouch);
78
+ });
79
+ </script >
0 commit comments