Skip to content

Commit

Permalink
upgrade daisyui to version 4
Browse files Browse the repository at this point in the history
add color appearance modification
some fix display
  • Loading branch information
rahmanramsi committed Dec 1, 2023
1 parent c1b4693 commit 3766fd6
Show file tree
Hide file tree
Showing 15 changed files with 193 additions and 36 deletions.
4 changes: 3 additions & 1 deletion app/Administration/Livewire/SetupSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use App\Actions\Site\SiteUpdateAction;
use App\Forms\Components\CssFileUpload;
use App\Models\Site;
use Filament\Forms\Components\ColorPicker;
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
use Illuminate\Support\Facades\App;
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
Expand Down Expand Up @@ -58,6 +59,8 @@ public function form(Form $form): Form
'xl' => 1,
'sm' => 2,
]),
ColorPicker::make('meta.appearance_color')
->label('Appearance Color'),
CssFileUpload::make('styleSheet')
->label('Custom Stylesheet')
->collection('styleSheet')
Expand All @@ -71,7 +74,6 @@ public function form(Form $form): Form
]),

]),

Actions::make([
Action::make('save')
->label('Save')
Expand Down
19 changes: 19 additions & 0 deletions app/Http/Middleware/SetupDefaultData.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\View;
use matthieumastadenis\couleur\ColorFactory;
use matthieumastadenis\couleur\ColorSpace;
use luizbills\CSS_Generator\Generator as CSSGenerator;
use Symfony\Component\HttpFoundation\Response;

class SetupDefaultData
Expand Down Expand Up @@ -43,13 +46,21 @@ public function handle(Request $request, Closure $next): Response
protected function setupSite()
{
$site = app()->getSite();

View::share('headerLogo', $site->getFirstMedia('logo')?->getAvailableUrl(['thumb', 'thumb-xl']));
View::share('headerLogoAltText', $site->getMeta('name'));
View::share('contextName', $site->getMeta('name'));
View::share('footer', $site->getMeta('page_footer'));
View::share('favicon', $site->getFirstMediaUrl('favicon'));
View::share('styleSheet', $site->getFirstMediaUrl('styleSheet'));

if($appearanceColor = $site->getMeta('appearance_color')){
$oklch = ColorFactory::new($appearanceColor)->to(ColorSpace::OkLch);
$css = new CSSGenerator();
$css->root_variable('p', "{$oklch->lightness}% {$oklch->chroma} {$oklch->hue}");

View::share('appearanceColor', $css->get_output());
}

MetaTag::add('description', $site->getMeta('description'));
}
Expand All @@ -64,6 +75,14 @@ protected function setupConference(Request $request, $currentConference)
View::share('favicon', $currentConference->getFirstMediaUrl('favicon'));
View::share('styleSheet', $currentConference->getFirstMediaUrl('styleSheet'));

if($appearanceColor = $currentConference->getMeta('appearance_color')){
$oklch = ColorFactory::new($appearanceColor)->to(ColorSpace::OkLch);
$css = new CSSGenerator();
$css->root_variable('p', "{$oklch->lightness}% {$oklch->chroma} {$oklch->hue}");

View::share('appearanceColor', $css->get_output());
}

MetaTag::add('description', preg_replace("/\r|\n/", '', $currentConference->getMeta('description')));

foreach ($currentConference->getMeta('meta_tags') ?? [] as $name => $content) {
Expand Down
3 changes: 3 additions & 0 deletions app/Panel/Livewire/Forms/Conferences/SetupSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Filament\Forms\Concerns\InteractsWithForms;
use App\Actions\Conferences\ConferenceUpdateAction;
use App\Forms\Components\CssFileUpload;
use Filament\Forms\Components\ColorPicker;
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;

Expand Down Expand Up @@ -54,6 +55,8 @@ public function form(Form $form): Form
'xl' => 1,
'sm' => 2,
]),
ColorPicker::make('meta.appearance_color')
->label('Appearance Color'),
CssFileUpload::make('styleSheet')
->label('Custom Stylesheet')
->collection('styleSheet')
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8",
"lorisleiva/laravel-actions": "^2.5",
"luizbills/css-generator": "^4.0",
"matthieumastadenis/couleur": "^0.1.2",
"mchev/banhammer": "^1.2",
"mohamedsabil83/filament-forms-tinyeditor": "^2.0",
"plank/laravel-metable": "^5.4",
Expand Down
130 changes: 129 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@tailwindcss/forms": "^0.5.4",
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.15",
"daisyui": "^3.5.1",
"daisyui": "^4.4.17",
"laravel-vite-plugin": "^0.7.8",
"postcss": "^8.4.28",
"postcss-nesting": "^12.0.1",
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"src": "resources/panel/js/panel.js"
},
"resources/website/css/website.css": {
"file": "assets/website-e4f96494.css",
"file": "assets/website-cbb12118.css",
"isEntry": true,
"src": "resources/website/css/website.css"
},
Expand Down
7 changes: 3 additions & 4 deletions resources/views/conference/blocks/previous-block.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="flex flex-col space-y-1">
@if (count($archives) > 0)
@if ($archives->isNotEmpty())
<h2 class="text-heading px-2">Previous Event</h2>
@forelse ($archives as $archive)
@foreach ($archives as $archive)
<div class="card card-compact bg-white w-full p-4 flex-col rounded">
<div class="w-full flex justify-between text-primary">
<a href="{{ route('livewirePageGroup.archive-conference.pages.home', ['conference' => $archive->path]) }}"
Expand All @@ -17,7 +17,6 @@ class="text-sm block hover:text-primary-focus">{{ $archive->name }}</a>
</div>
</div>
</div>
@empty
@endforelse
@endforeach
@endif
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="divide-y overflow-y-auto space-y-2">
@forelse ($announcements as $announcement)
<a href="{{ route('livewirePageGroup.current-conference.pages.announcement-page', ['announcement' => $announcement->id]) }}"
class="flex w-full bg-white md:flex-row hover:bg-gray-100 gap-x-2 p-1">
class="flex w-full bg-white md:flex-row hover:bg-gray-100 gap-x-2 p-1 group">
@if ($featuredImage = $announcement->getFirstMedia('featured_image'))
<img class="object-cover h-28 aspect-square"
src="{{ $featuredImage->getAvailableUrl(['thumb']) }}" alt="">
Expand Down
6 changes: 3 additions & 3 deletions resources/views/conference/pages/timeline.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<x-website::layouts.main>
<section class="h-screen">
<div class="flex flex-wrap py-10">
<div class="flex flex-col ps-6 basis-1/2">
<section class="p-5">
<div class="flex flex-wrap">
<div class="flex flex-col basis-1/2">
<div class="flex flex-col space-y-1 mb-3">
<h2 class="text-heading">Event</h2>
<div class="border border-primary w-12"></div>
Expand Down
8 changes: 8 additions & 0 deletions resources/views/website/components/layouts/head.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@
display: none !important;
}
</style>


@vite(['resources/website/css/website.css', 'resources/website/js/website.js'])
@isset($styleSheet)
<link rel="stylesheet" type="text/css" href="{{ $styleSheet }}">
@endisset

@if (isset($appearanceColor))
<style>
{!! $appearanceColor !!}
</style>
@endif
</head>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<x-website::navigation :items="$primaryNavigationItems"/>
<div class="navbar-end gap-x-4 hidden lg:inline-flex">
@if (\Filament\Facades\Filament::getDefaultPanel()->auth()->user())
<x-website::link :href="$panelUrl" :spa="false" class="btn btn-sm btn-white rounded px-4 font-normal text-gray-900">Dashboard</x-conference::link>
<x-website::link :href="$panelUrl" :spa="false" class="btn btn-sm bg-white rounded px-4 font-normal text-gray-900">Dashboard</x-conference::link>
@else
<x-website::link :href="route('livewirePageGroup.website.pages.register')" :spa="false" class="btn btn-sm btn-ghost rounded px-4 font-normal text-white">Register</x-conference::link>
<x-website::link :href="route('livewirePageGroup.website.pages.login')" :spa="false" class="btn btn-sm rounded px-4 font-normal text-gray-900">Login</x-conference::link>
Expand Down
Loading

0 comments on commit 3766fd6

Please sign in to comment.