Added capitalization to buttons

Buttons now support full capitalization of the default button names. For example, Previously, GitHub would be displayed as Github. Now, the proper capitalization is uses.
This commit is contained in:
Julian Prieber 2022-10-26 11:20:11 +02:00
parent c8ee3f1c26
commit 4a6ddc3639
2 changed files with 16 additions and 2 deletions

13
config/button-names.php Normal file
View File

@ -0,0 +1,13 @@
<?php
$buttonNames = array(
'github' => 'GitHub',
'gitlab' => 'GitLab',
'linkedin' => 'linkedIn',
'paypal' => 'PayPal',
'soundcloud' => 'SoundCloud',
'tiktok' => 'TikTok',
'whatsapp' => 'WhatsApp',
'wordpress' => 'WordPress',
'youtube' => 'YouTube',
);

View File

@ -284,7 +284,8 @@ function get_operating_system() {
@elseif($link->name === "heading")
<h2>{{ $link->title }}</h2>
@else
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-{{ $link->name }} button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ route('clickNumber') . '/' . $link->id . '/' . $link->link}}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif ><img alt="button-icon" class="icon hvr-icon" src="@if(theme('use_custom_icons') == "true"){{ url('themes/' . $GLOBALS['themeName'] . '/extra/custom-icons')}}/{{$linkName}}{{theme('custom_icon_extension')}} @else{{ asset('\/littlelink/icons\/') . $linkName }}.svg @endif">{{ ucfirst($linkName) }}</a></div>
<?php include base_path('config/button-names.php'); $newLinkName = $linkName; foreach($buttonNames as $key => $value) { if($newLinkName == $key) { $newLinkName = $value; } } ?>
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-{{ $link->name }} button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ route('clickNumber') . '/' . $link->id . '/' . $link->link}}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif ><img alt="button-icon" class="icon hvr-icon" src="@if(theme('use_custom_icons') == "true"){{ url('themes/' . $GLOBALS['themeName'] . '/extra/custom-icons')}}/{{$linkName}}{{theme('custom_icon_extension')}} @else{{ asset('\/littlelink/icons\/') . $linkName }}.svg @endif">{{ ucfirst($newLinkName) }}</a></div>
@endif
@endforeach
@ -297,4 +298,4 @@ function get_operating_system() {
@if(theme('enable_custom_code') == "true" and theme('enable_custom_body_end') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-body-end')@endif
</body>
</html>
</html>