Added OpenDyslexic as a font option

This commit is contained in:
snipe
2026-05-09 13:36:58 +01:00
parent da6e837578
commit cc353153d2
11 changed files with 84 additions and 0 deletions
@@ -63,6 +63,7 @@ class ProfileController extends Controller
$user->enable_sounds = $request->input('enable_sounds', false);
$user->enable_confetti = $request->input('enable_confetti', false);
$user->accessible_font = $request->input('accessible_font') ?: null;
$user->link_light_color = $request->input('link_light_color', '#296282');
$user->link_dark_color = $request->input('link_dark_color', '#296282');
$user->nav_link_color = $request->input('nav_link_color', '#FFFFFF');
+1
View File
@@ -92,6 +92,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
'vip',
'autoassign_licenses',
'website',
'accessible_font',
];
protected $casts = [
@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->text('accessible_font')->nullable()->default(null)->after('website');
});
}
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('accessible_font');
});
}
};
Binary file not shown.
@@ -0,0 +1,27 @@
@font-face {
font-family: 'OpenDyslexic';
src: url('OpenDyslexic-Regular.otf') format('opentype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'OpenDyslexic !important';
src: url('OpenDyslexic-Bold.otf') format('opentype');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'OpenDyslexic';
src: url('OpenDyslexic-Italic.otf') format('opentype');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'OpenDyslexic';
src: url('OpenDyslexic-BoldItalic.otf') format('opentype');
font-weight: bold;
font-style: italic;
}
+1
View File
@@ -3,6 +3,7 @@
return [
'show_all' => 'Show All',
'2FA_reset' => '2FA reset',
'accessible_font' => 'Accessible Font',
'accessories' => 'Accessories',
'activated' => 'Activated',
'login_status' => 'Login Status',
+12
View File
@@ -37,6 +37,18 @@
</div>
</div>
<!-- Accessible Font -->
<div class="form-group {{ $errors->has('accessible_font') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="accessible_font">{{ trans('general.accessible_font') }}</label>
<div class="col-md-6">
<select name="accessible_font" id="accessible_font" class="select2" style="width: 100%">
<option value="">{{ trans('general.system_default') }}</option>
<option value="opendyslexic" {{ old('accessible_font', $user->accessible_font) === 'opendyslexic' ? 'selected' : '' }}>OpenDyslexic</option>
</select>
{!! $errors->first('accessible_font', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
<!-- Nav Link color -->
<div class="form-group {{ $errors->has('nav_link_color') ? 'error' : '' }}">
<label for="nav_link_color" class="col-md-3 control-label">{{ trans('admin/settings/general.nav_link_color') }}</label>
+20
View File
@@ -1154,6 +1154,26 @@
<script src="{{ url(asset('js/html5shiv.js')) }}" nonce="{{ csrf_token() }}"></script>
<script src="{{ url(asset('js/respond.js')) }}" nonce="{{ csrf_token() }}"></script>
@auth
@if(auth()->user()->accessible_font === 'opendyslexic')
<link rel="stylesheet" href="{{ asset('css/fonts/opendyslexic/opendyslexic.css') }}">
<style nonce="{{ csrf_token() }}">
body, body * {
font-family: 'OpenDyslexic', sans-serif !important;
}
.fa, .fa-classic, .fas, .fa-solid, .far, .fa-regular {
font-family: "Font Awesome 6 Free" !important;
}
.fa-brands, .fab {
font-family: "Font Awesome 6 Brands" !important;
}
</style>
@endif
@endauth
</head>