Skip to content

Commit

Permalink
feat: adds golf theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Dec 12, 2024
1 parent 3096dc5 commit f049ded
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 30 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# CHANGELOG

## v3.1.0 (2024-12-11)
## v3.1.0 (2024-12-12)

- Adds PHP 8.4 support
- Docker Swarm support (changes made to configuration and tooling)
- S3 file support for images
- Adds `golf` theme
- New auth view layouts
- Bumps Docker image with improved PHP-FPM throughput
- Bumps dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ lint-css-fix:

# Fix JS linting
lint-js-fix:
eslint resources/js/*.js --fix
npx eslint resources/js/*.js --fix

# Migrates the database
migrate:
Expand Down
9 changes: 7 additions & 2 deletions src/resources/sass/themes/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ input[type="email"],
input[type="password"],
textarea,
select {
background-color: $font-color !important;
color: $background-color-accent !important;
background-color: $background-color-accent !important;
color: $font-color !important;
}

input::placeholder,
textarea::placeholder {
color: rgba($font-color, 0.6) !important;
}

hr {
Expand Down
10 changes: 10 additions & 0 deletions src/resources/sass/themes/golf.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Golf Theme Colors
$background-color: #d1e7dd;
$background-color-accent: #e9ecef;
$accent-color: #479f76;
$interaction-color: #198754;
$font-color: #212529;
$danger-color: #dc3545;

// Import Theme Elements
@import 'theme';
39 changes: 21 additions & 18 deletions src/resources/views/admin.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@

<label for="title">Comments</label>
<select class="form-select" name="comments">
<option value="1" <?php if ($settings->comments == 1) {
echo 'selected';
} ?>>On</option>
<option value="0" <?php if ($settings->comments == 0) {
echo 'selected';
} ?>>Off</option>
<option value="1" @if ($settings->comments == 1) {{ 'selected' }} @endif>
On
</option>
<option value="0" @if ($settings->comments == 0) {{ 'selected' }} @endif>
Off
</option>
</select>

<label for="title">Blog Theme</label>
<select class="form-select" name="theme">
<option value="1" <?php if ($settings->theme == 1) {
echo 'selected';
} ?>>Light</option>
<option value="2" <?php if ($settings->theme == 2) {
echo 'selected';
} ?>>Dark</option>
<option value="3" <?php if ($settings->theme == 3) {
echo 'selected';
} ?>>Midnight</option>
<option value="4" <?php if ($settings->theme == 4) {
echo 'selected';
} ?>>Amethyst</option>
<option value="1" @if ($settings->theme == 1) {{ 'selected' }} @endif>
Light
</option>
<option value="2" @if ($settings->theme == 2) {{ 'selected' }} @endif>
Dark
</option>
<option value="3" @if ($settings->theme == 3) {{ 'selected' }} @endif>
Midnight
</option>
<option value="4" @if ($settings->theme == 4) {{ 'selected' }} @endif>
Amethyst
</option>
<option value="5" @if ($settings->theme == 5) {{ 'selected' }} @endif>
Golf
</option>
</select>

<input class="btn btn-primary mt-3"
Expand Down
31 changes: 24 additions & 7 deletions src/resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
@vite(['resources/sass/themes/midnight.scss'])
@elseif ($settings->theme == 4)
@vite(['resources/sass/themes/amethyst.scss'])
@elseif ($settings->theme == 5)
@vite(['resources/sass/themes/golf.scss'])
@endif
</head>

Expand All @@ -30,8 +32,13 @@
<a class="navbar-brand" href="/">
{{ $settings->title }}
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar"
aria-controls="navbar" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<button class="navbar-toggler"
data-bs-toggle="collapse"
data-bs-target="#navbar"
type="button"
aria-controls="navbar"
aria-expanded="false"
aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>

Expand Down Expand Up @@ -63,8 +70,14 @@
<a class="nav-link" href="/posts">Posts</a>

<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
<a class="nav-link dropdown-toggle"
id="navbarDropdown"
data-bs-toggle="dropdown"
href="#"
role="button"
aria-haspopup="true"
aria-expanded="false"
v-pre>
{{ Auth::user()->name }} <span class="caret"></span>
</a>

Expand All @@ -75,13 +88,17 @@
<a class="dropdown-item" href="/comments">Comments</a>
<a class="dropdown-item" href="/admin">Admin</a>
@endif
<a class="dropdown-item" href="/logout"
onclick="event.preventDefault();
<a class="dropdown-item"
href="/logout"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ __('Logout') }}
</a>

<form id="logout-form" action="/logout" method="POST" class="pa-display-none">
<form class="pa-display-none"
id="logout-form"
action="/logout"
method="POST">
@csrf
</form>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ export default defineConfig({
plugins: [
laravel({
input: [
"resources/js/app.js",
"resources/sass/app.scss",
"resources/sass/themes/amethyst.scss",
"resources/sass/themes/dark.scss",
"resources/sass/themes/golf.scss",
"resources/sass/themes/midnight.scss",
"resources/js/app.js",
],
refresh: true,
}),
Expand Down

0 comments on commit f049ded

Please sign in to comment.