mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 09:54:44 +02:00
Font Saga Continues (#1338)
Nuke comic, just use monospace..... make life easy
This commit is contained in:
parent
e1eaf805ea
commit
f2f1026a97
@ -378,7 +378,7 @@ class EditProfile extends BaseEditProfile
|
|||||||
->label(trans('profile.font'))
|
->label(trans('profile.font'))
|
||||||
->options(function () {
|
->options(function () {
|
||||||
$fonts = [
|
$fonts = [
|
||||||
'ComicMono' => 'ComicMono ( Default )', //default
|
'monospace' => 'monospace', //default
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!File::exists(public_path('storage/fonts'))) {
|
if (!File::exists(public_path('storage/fonts'))) {
|
||||||
@ -396,30 +396,15 @@ class EditProfile extends BaseEditProfile
|
|||||||
return $fonts;
|
return $fonts;
|
||||||
})
|
})
|
||||||
->reactive()
|
->reactive()
|
||||||
->default('ComicMono')
|
->default('monospace')
|
||||||
->afterStateUpdated(fn ($state, callable $set) => $set('font_preview', $state)),
|
->afterStateUpdated(fn ($state, callable $set) => $set('font_preview', $state)),
|
||||||
Placeholder::make('font_preview')
|
Placeholder::make('font_preview')
|
||||||
->label('Preview')
|
->label('Preview')
|
||||||
->content(function (Get $get) {
|
->content(function (Get $get) {
|
||||||
$fontName = $get('console_font') ?? 'No font selected.';
|
$fontName = $get('console_font') ?? 'monospace';
|
||||||
$fontSize = $get('console_font_size') . 'px';
|
$fontSize = $get('console_font_size') . 'px';
|
||||||
$fontUrl = asset("storage/fonts/{$fontName}.ttf");
|
$fontUrl = asset("storage/fonts/{$fontName}.ttf");
|
||||||
|
|
||||||
if ($fontName === 'ComicMono') {
|
|
||||||
return new HtmlString(<<<HTML
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/comic-mono@0.0.1/index.css">
|
|
||||||
<style>
|
|
||||||
.preview-text {
|
|
||||||
font-family: Comic Mono;
|
|
||||||
font-size: $fontSize;
|
|
||||||
margin-top: 10px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<span class="preview-text">The quick blue pelican jumps over the lazy pterodactyl. :)</span>
|
|
||||||
HTML);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new HtmlString(<<<HTML
|
return new HtmlString(<<<HTML
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
@font-face {
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
<x-filament::widget>
|
<x-filament::widget>
|
||||||
@assets
|
@assets
|
||||||
@php
|
@php
|
||||||
$userFont = auth()->user()->getCustomization()['console_font'] ?? 'ComicMono';
|
$userFont = auth()->user()->getCustomization()['console_font'];
|
||||||
$userFontSize = auth()->user()->getCustomization()['console_font_size'] ?? 14;
|
$userFontSize = auth()->user()->getCustomization()['console_font_size'] ?? 14;
|
||||||
$userRows = auth()->user()->getCustomization()['console_rows'] ?? 30;
|
$userRows = auth()->user()->getCustomization()['console_rows'] ?? 30;
|
||||||
@endphp
|
@endphp
|
||||||
|
@if($userFont)
|
||||||
@if ($userFont === 'ComicMono')
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/comic-mono@0.0.1/index.css">
|
|
||||||
@else
|
|
||||||
<link rel="preload" href="{{ asset("storage/fonts/{$userFont}.ttf") }}" as="font" crossorigin>
|
<link rel="preload" href="{{ asset("storage/fonts/{$userFont}.ttf") }}" as="font" crossorigin>
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
@font-face {
|
||||||
@ -75,7 +72,7 @@
|
|||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
fontSize: {{ $userFontSize }},
|
fontSize: {{ $userFontSize }},
|
||||||
fontFamily: '{{ $userFont }}',
|
fontFamily: '{{ $userFont }}, monospace',
|
||||||
lineHeight: 1.2,
|
lineHeight: 1.2,
|
||||||
disableStdin: true,
|
disableStdin: true,
|
||||||
cursorStyle: 'underline',
|
cursorStyle: 'underline',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user