Skip to content

Commit 2028862

Browse files
committed
Added themes v2 support to home page
1 parent 3c76063 commit 2028862

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

resources/views/home.blade.php

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
<head>
44
<meta charset="utf-8">
55

6+
@php $GLOBALS['themeName'] = config('advanced-config.home_theme'); @endphp
7+
8+
<?php
9+
// Theme Config
10+
function theme($key){
11+
$key = trim($key);
12+
$file = base_path('themes/' . $GLOBALS['themeName'] . '/config.php');
13+
if (file_exists($file)) {
14+
$config = include $file;
15+
if (isset($config[$key])) {
16+
return $config[$key];
17+
}}
18+
return null;}
19+
20+
// Theme Custom Asset
21+
function themeAsset($path){
22+
$path = url('themes/' . $GLOBALS['themeName'] . '/extra/custom-assets/' . $path);
23+
return $path;}
24+
?>
25+
26+
@if(theme('enable_custom_code') == "true" and theme('enable_custom_head') == "true")@include($GLOBALS['themeName'] . '.extra.custom-head')@endif
27+
628
@include('layouts.analytics')
729

830
@if(env('CUSTOM_META_TAGS') == 'true' and config('advanced-config.title') != '')
@@ -69,6 +91,8 @@
6991
</head>
7092
<body>
7193

94+
@if(theme('enable_custom_code') == "true" and theme('enable_custom_body') == "true")@include($GLOBALS['themeName'] . '.extra.custom-body')@endif
95+
7296
@if(config('advanced-config.home_theme') != '' and config('advanced-config.home_theme') != 'default')
7397
<!-- Enables parallax background animations -->
7498
<div class="background-container">
@@ -142,16 +166,16 @@
142166
<?php $array = config('advanced-config.buttons'); ?>
143167
@foreach($array as $button)
144168
@php $linkName = str_replace('default ','',$button['button']) @endphp
145-
@if($button['button'] === "custom" and $button['custom_css'] === "" or $button['custom_css'] === "NULL")
146-
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-{{ $button['button'] }} button button-hover icon-hover" @if($button['link'] != '') href="{{ $button['link'] }}" target="_blank"@endif>@if($button['icon'] == 'llc')<img alt="button-icon" class="icon hvr-icon" src="{{ asset('\/littlelink/icons\/')}}llc.svg">@else<i style="color: {{ $button['icon'] }}" class="icon hvr-icon fa {{ $button['icon'] }}"></i>@endif{{ $button['title'] }}</a></div>
169+
@if($button['button'] === "custom" and ($button['custom_css'] === "" or $button['custom_css'] === "NULL") or (theme('allow_custom_buttons') != "true" and $button['button'] === "custom"))
170+
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-{{ $button['button'] }} button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ $button['link'] }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif >@if($button['icon'] == 'llc')<img alt="button-icon" class="icon hvr-icon" src="{{ asset('\/littlelink/icons\/')}}llc.svg">@else<i style="color: {{$button['icon']}}" class="icon hvr-icon fa {{$button['icon']}}"></i>@endif {{ $button['title'] }}</a></div>
147171
@elseif($button['button'] === "custom" and $button['custom_css'] != "")
148-
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-hover icon-hover" style="{{ $button['custom_css'] }}" @if($button['link'] != '') href="{{ $button['link'] }}" target="_blank"@endif>@if($button['icon'] == 'llc')<img alt="button-icon" class="icon hvr-icon" src="{{ asset('\/littlelink/icons\/')}}llc.svg">@else<i style="color: {{ $button['icon'] }}" class="icon hvr-icon fa {{ $button['icon'] }}"></i>@endif{{ $button['title'] }}</a></div>
172+
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-hover icon-hover" style="{{ $button['custom_css'] }}" rel="noopener noreferrer nofollow" href="{{ $button['link'] }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif >@if($button['icon'] == 'llc')<img alt="button-icon" class="icon hvr-icon" src="{{ asset('\/littlelink/icons\/')}}llc.svg">@else<i style="color: {{$button['icon']}}" class="icon hvr-icon fa {{$button['icon']}}"></i>@endif{{ $button['title'] }}</a></div>
149173
@elseif($button['button'] === "buy me a coffee")
150-
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-coffee button button-hover icon-hover" @if($button['link'] != '') href="{{ $button['link'] }}" target="_blank"@endif><img alt="button-icon" class="icon hvr-icon" src="{{ asset('\/littlelink/icons\/')}}coffee.svg">Buy me a Coffee</a></div>
151-
@elseif($button['button'] === "custom_website"and $button['custom_css'] === "" or $button['custom_css'] === "NULL")
152-
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-custom_website button button-hover icon-hover" @if($button['link'] != '') href="{{ $button['link'] }}" target="_blank"@endif><img alt="button-icon" class="icon hvr-icon" src="https://icons.duckduckgo.com/ip3/{{strp($link->link)}}.ico">{{ $button['title'] }}</a></div>
174+
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-coffee button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ $button['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')}}/coffee{{theme('custom_icon_extension')}} @else{{ asset('\/littlelink/icons\/')}}coffee.svg @endif">Buy me a Coffee</a></div>
175+
@elseif($button['button'] === "custom_website" and ($button['custom_css'] === "" or $button['custom_css'] === "NULL") or (theme('allow_custom_buttons') != "true" and $button['button'] === "custom_website"))
176+
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-custom_website button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ $button['link'] }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif ><img alt="button-icon" class="icon hvr-icon" src="https://icons.duckduckgo.com/ip3/{{strp($button['link'])}}.ico">{{ $button['title'] }}</a></div>
153177
@elseif($button['button'] === "custom_website" and $button['custom_css'] != "")
154-
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-hover icon-hover" style="{{ $button['custom_css'] }}" @if($button['link'] != '') href="{{ $button['link'] }}" target="_blank"@endif><img alt="button-icon" class="icon hvr-icon" src="https://icons.duckduckgo.com/ip3/{{strp($link->link)}}.ico">{{ $button['title'] }}</a></div>
178+
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-hover icon-hover" style="{{ $button['custom_css'] }}" rel="noopener noreferrer nofollow" href="{{ $button['link'] }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif ><img alt="button-icon" class="icon hvr-icon" src="https://icons.duckduckgo.com/ip3/{{strp($button['link'])}}.ico">{{ $button['title'] }}</a></div>
155179
@elseif($button['button'] === "space")
156180
<?php
157181
if (is_numeric($button['title']) and $button['title'] < 10)
@@ -209,4 +233,7 @@
209233
</div>
210234
</div>
211235
</body>
236+
237+
@if(theme('enable_custom_code') == "true" and theme('enable_custom_body_end') == "true")@include($GLOBALS['themeName'] . '.extra.custom-body-end')@endif
238+
212239
</html>

0 commit comments

Comments
 (0)