77 @case (' icon' )
88 @break
99 @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 >
1111 @break
1212 @case (' default email' )
1313 @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 >
1515 @break
1616 @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 >
1818 @break
1919 @case (' space' )
2020 @php $title = $link -> title ; if (is_numeric ($title )) { echo str_repeat (" <br>" , $title < 10 ? $title : 10 ); } else { echo " <br><br><br>" ; } @endphp
2626 <div class =" fadein" ><span style =" " >@if (env (' ALLOW_USER_HTML' ) === true ){!! $link -> title ! !}@else {{ $link -> title } }@endif </span ></div >
2727 @break
2828 @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 >
3030 @break
3131 @case (' custom' )
3232 @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 >
3434 @break
3535 @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 >
3737 @break
3838 @endif
3939 @case (' custom_website' )
4040 @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 >
4242 @break
4343 @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 >
4545 @break
4646 @endif
4747 @default
4848 <?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 >
5050 @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