Skip to content

Commit cb75a24

Browse files
committed
Update button editor
Added functionality for custom website button. Made button editor optional to use.
1 parent 845327a commit cb75a24

File tree

5 files changed

+61
-17
lines changed

5 files changed

+61
-17
lines changed

.env

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
#=REGISTER_AUTH either auth or verified. If auth is selected, no verification is required. Default is verified.
33
REGISTER_AUTH=verified
44

5-
#Internal notifications=Changes if certain messages should be displayed or not
5+
#Internal notifications=Changes if certain messages should be displayed or not.
66
#=NOTIFY_EVENTS notifies admins if an important event is happening, such as polls about the future of this project or security vulnerabilities.
77
NOTIFY_EVENTS=true
88
#=NOTIFY_UPDATES either all, major or false. All notifies about all updates, major only notifies about major or important updates, false does not notify about any updates.
99
NOTIFY_UPDATES=major
1010
DISPLAY_FOOTER=true
1111
DISPLAY_CREDIT=true
1212

13-
#Home URL=Changes if a user profile should be displayed as the homepage
13+
#Home URL=Changes if a user profile should be displayed as the homepage.
1414
#=Leave empty to use the default homepage. To set your profile as the homepage, enter a LittleLink name. You can find this on the user panel under the page setting, the name is what comes after the '@'.
1515
#=(e.g. 'admin' without the '@')
1616
HOME_URL=
@@ -22,18 +22,22 @@ APP_KEY=
2222
#=The APP_URL should be left empty under most circumstances. This setting is not required for LittleLink Custom, and you should only change this if required for your setup.
2323
APP_URL=
2424

25-
#Debug Settings=Changes if your page should display a full error description instead of a generic error 500
25+
#ENABLE_BUTTON_EDITOR=Determines if the custom button editor should be enabled or not, default is true.
26+
#=ENABLE_BUTTON_EDITOR either true or false.
27+
ENABLE_BUTTON_EDITOR=true
28+
29+
#Debug Settings=Changes if your page should display a full error description instead of a generic error 500.
2630
#=App_debug either true or false. You might want to change this to false after you're done installing, but it's very useful for troubleshooting.
2731
APP_DEBUG=true
28-
#=App_env either local or production. Change this to production if you set the value above to false
32+
#=App_env either local or production. Change this to production if you set the value above to false.
2933
APP_ENV=local
3034
LOG_CHANNEL=stack
3135
LOG_LEVEL=debug
3236

3337
#Database Settings=Should be left alone. If you wish to use mysql you'd have to seed the database again.
3438
DB_CONNECTION=sqlite
3539

36-
#Mail Settings=LittleLink Custom comes with a free to use built-in SMTP server for sending mail. You can leave this setting as is, if you wish to use this service please read our terms and conditions at llc-mail.tru.io. If you do not wish to use the built-in SMTP server, change the setting below
40+
#Mail Settings=LittleLink Custom comes with a free to use built-in SMTP server for sending mail. You can leave this setting as is, if you wish to use this service please read our terms and conditions at llc-mail.tru.io. If you do not wish to use the built-in SMTP server, change the setting below.
3741
#=MAIL_MAILER either smtp or built-in. Make sure to change this setting if you want to add a custom SMTP server.
3842
MAIL_MAILER=built-in
3943
MAIL_HOST=
@@ -44,7 +48,7 @@ MAIL_ENCRYPTION=
4448
MAIL_FROM_ADDRESS=
4549
MAIL_FROM_NAME="${APP_NAME}"
4650

47-
#Cache Settings=Completely optional
51+
#Cache Settings=Completely optional.
4852
MEMCACHED_HOST=127.0.0.1
4953
REDIS_HOST=127.0.0.1
5054
REDIS_PASSWORD=null

resources/views/studio/button-editor.blade.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@if(env('ENABLE_BUTTON_EDITOR') === true)
12
@extends('layouts.sidebar')
23

34
@section('content')
@@ -208,7 +209,11 @@
208209
</aside>
209210

210211
<section id="preview">
211-
<center><div id="sample" style="--delay: 1s; border-radius:8px !important; max-width: 400px; width: 80%; class="button-entrance"><div class="button-demo button hvr-grow hvr-icon-wobble-vertical"><img class="icon hvr-icon" src="{{ asset('\/littlelink/icons\/') . 'custom' }}.svg">Example</div></div></center>
212+
@if($buttonId == 1)
213+
<center><div id="sample" style="--delay: 1s; border-radius:8px !important; max-width: 400px; width: 80%; class="button-entrance"><div class="button-demo button hvr-grow hvr-icon-wobble-vertical"><img class="icon hvr-icon" src="{{ asset('\/littlelink/icons\/') . 'custom' }}.svg">{{ $title }}</div></div></center>
214+
@else
215+
<center><div id="sample" style="--delay: 1s; border-radius:8px !important; max-width: 400px; width: 80%; class="button-entrance"><div class="button-demo button hvr-grow hvr-icon-wobble-vertical"><img class="wicon hvr-icon" src="http://www.google.com/s2/favicons?domain={{$link}}">{{ $title }}</div></div></center>
216+
@endif
212217

213218
</section>
214219
</div>
@@ -245,14 +250,19 @@
245250
<br><br><div id="result" style="left: 1%; position: relative; background-color:#2c2d3a; border-radius: 25px; min-width:300px; max-width:950px; height:300px; box-shadow: 0 10px 20px -10px rgba(0,0,0, 0.6);">
246251
<div style="position: relative; top: 50%; transform: translateY(-50%);">
247252
<h2 align="center" style="color:white">Result:</h2>
248-
@if($custom_css === "")
249-
<center><div style="--delay: 1s" class="button-entrance"><div class="button-demo button-custom button hvr-grow hvr-icon-wobble-vertical" href=""><img class="icon hvr-icon fa {{$custom_icon}}">Example</div></div></center>
250-
@elseif($custom_css != "")
251-
<center><div style="--delay: 1s" class="button-entrance"><div style="{{ $custom_css }}" class="button-demo hvr-grow hvr-icon-wobble-vertical" href=""><i style="color: {{$custom_icon}}" class="icon hvr-icon fa {{$custom_icon}}"></i>Example</div></div></center>
253+
@if($custom_css === "" and $buttonId == 1)
254+
<center><div style="--delay: 1s" class="button-entrance"><div class="button-demo button-custom button hvr-grow hvr-icon-wobble-vertical"><img class="icon hvr-icon fa {{$custom_icon}}">{{ $title }}</div></div></center>
255+
@elseif($custom_css === "" and $buttonId == 2)
256+
<center><div style="--delay: 1s" class="button-entrance"><div class="button-custom_website button hvr-grow hvr-icon-wobble-vertical"><img class="wicon hvr-icon" src="http://www.google.com/s2/favicons?domain={{$link}}">{{ $title }}</div></div></center>
257+
@elseif($custom_css != "" and $buttonId == 2)
258+
<center><div style="--delay: 1s" class="button-entrance"><div style="{{ $custom_css }}" class="button-custom_website button hvr-grow hvr-icon-wobble-vertical"><img class="wicon hvr-icon" src="http://www.google.com/s2/favicons?domain={{$link}}">{{ $title }}</div></div></center>
259+
@else
260+
<center><div style="--delay: 1s" class="button-entrance"><div style="{{ $custom_css }}" class="button-demo hvr-grow hvr-icon-wobble-vertical"><i style="color: {{$custom_icon}}" class="icon hvr-icon fa {{$custom_icon}}"></i>{{ $title }}</div></div></center>
252261
@endif
253262
</div>
254263
</div>
255264
<br><br>
265+
@if($buttonId == 1)
256266
<form action="{{ route('editCSS', $id) }}" method="post">
257267
@csrf
258268
<div class="form-group col-lg-8">
@@ -315,14 +325,14 @@
315325
</details>
316326

317327
<div class="row">
318-
<button type="submit" class="mt-3 ml-3 btn btn-info">Submit</button>
328+
<button type="submit" class="mt-3 ml-3 btn btn-info">Update icon</button>
319329
<button class="mt-3 ml-3 btn btn-info"><a href="https://fontawesome.com/search?m=free" target="_blank">See all icons</a></button>
320330
</div>
321331
</form><br><br><br><br>
332+
@endif
322333

323334
</div>
324335

325336

326337
@endsection
327-
328-
338+
@endif

resources/views/studio/links.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<th scope="col">Order ⏶</th>
1414
<th scope="col">Pin Link ⏶</th>
1515
<th scope="col">Edit</th>
16-
<th scope="col">Button Editor<span style="color:tomato">&nbsp; beta</span></th>
16+
@if(env('ENABLE_BUTTON_EDITOR') === true)<th scope="col">Button Editor<span style="color:tomato">&nbsp; beta</span></th>@endif
1717
<th scope="col">Delete</th>
1818
</tr>
1919
</thead>
@@ -26,11 +26,13 @@
2626
<td class="text-right">{{ $link->order }}</td>
2727
<td><a href="{{ route('upLink', ['up' => $link->up_link, 'id' => $link->id]) }}" class="text-primary">{{ $link->up_link }}</a></td>
2828
<td><a href="{{ route('editLink', $link->id ) }}">Edit</a></td>
29+
@if(env('ENABLE_BUTTON_EDITOR') === true)
2930
@if($link->button_id == 1 or $link->button_id == 2)
3031
<td><a href="{{ route('editCSS', $link->id ) }}" class="text-success">Customize Button</a></td>
3132
@else
3233
<td><a> - </a></td>
3334
@endif
35+
@endif
3436
<td><a href="{{ route('deleteLink', $link->id ) }}" class="text-danger">Delete</a></td>
3537
</tr>
3638
@endforeach

storage/backups/default_settings

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ NOTIFY_UPDATES=major
1010
DISPLAY_FOOTER=true
1111
DISPLAY_CREDIT=true
1212

13-
#Home URL=Changes if a user profile should be displayed as the homepage
13+
#Home URL=Changes if a user profile should be displayed as the homepage.
1414
#=Leave empty to use the default homepage. To set your profile as the homepage, enter a LittleLink name. You can find this on the user panel under the page setting, the name is what comes after the '@'.
1515
#=(e.g. 'admin' without the '@')
1616
HOME_URL=
@@ -22,6 +22,10 @@ APP_KEY=base64:YOU+MUST+CHANGE+THIS+YUFukELiN6Bk9gQ19+9zwk=
2222
#=The APP_URL should be left empty under most circumstances. This setting is not required for LittleLink Custom, and you should only change this if required for your setup.
2323
APP_URL=
2424

25+
#ENABLE_BUTTON-EDITOR=Determines if the custom button editor should be enabled or not, default is true.
26+
#=ENABLE_BUTTON-EDITOR either true or false.
27+
ENABLE_BUTTON-EDITOR=true
28+
2529
#Debug Settings=Changes if your page should display a full error description instead of a generic error 500
2630
#=App_debug either true or false. You might want to change this to false after you're done installing, but it's very useful for troubleshooting.
2731
APP_DEBUG=true

studio/button-editor/css/style.css

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,12 @@ button-demo {
516516
width: 20px;
517517
height: 20px;
518518
}
519+
.wicon {
520+
padding: 0px 6px 0px 0px;
521+
vertical-align: middle;
522+
width: 26px;
523+
height: 20px;
524+
}
519525
.button.button-custom {
520526
color: #FFFFFF;
521527
background-color: #FFFFFF;
@@ -524,6 +530,24 @@ button-demo {
524530
.button.button-custom:focus {
525531
filter: brightness(90%) }
526532

533+
.button.button-custom_website {
534+
color: #ffffff;
535+
background-color: #000000;
536+
display: inline-block;
537+
text-decoration: none;
538+
height: 48px;
539+
text-align: center;
540+
vertical-align: middle;
541+
font-size: 18px;
542+
width: 300px;
543+
font-weight: 700;
544+
line-height: 48px;
545+
letter-spacing: 0.1px;
546+
white-space: wrap;
547+
border-radius: 8px;
548+
cursor: pointer;
549+
}
550+
527551
details {
528552
width: 64.7%;
529553
background: #282828;
@@ -579,4 +603,4 @@ details > ul {
579603
width: 80%;
580604
top: 10%;
581605
left: 10%;
582-
}
606+
}

0 commit comments

Comments
 (0)