diff --git a/app/Administration/Livewire/SetupSetting.php b/app/Administration/Livewire/SetupSetting.php index bdd8e78b7..f658f570f 100644 --- a/app/Administration/Livewire/SetupSetting.php +++ b/app/Administration/Livewire/SetupSetting.php @@ -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; @@ -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') @@ -71,7 +74,6 @@ public function form(Form $form): Form ]), ]), - Actions::make([ Action::make('save') ->label('Save') diff --git a/app/Http/Middleware/SetupDefaultData.php b/app/Http/Middleware/SetupDefaultData.php index e55ab8dbc..21f9c1d90 100644 --- a/app/Http/Middleware/SetupDefaultData.php +++ b/app/Http/Middleware/SetupDefaultData.php @@ -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 @@ -43,6 +46,7 @@ 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')); @@ -50,6 +54,13 @@ protected function setupSite() 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')); } @@ -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) { diff --git a/app/Panel/Livewire/Forms/Conferences/SetupSetting.php b/app/Panel/Livewire/Forms/Conferences/SetupSetting.php index 19dddf927..e09de5f5d 100644 --- a/app/Panel/Livewire/Forms/Conferences/SetupSetting.php +++ b/app/Panel/Livewire/Forms/Conferences/SetupSetting.php @@ -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; @@ -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') diff --git a/composer.json b/composer.json index f21215eea..fbb383d43 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/composer.lock b/composer.lock index 6501cfa71..bf4f011f8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "df9944a46e44b395e5b319f165fa5cb5", + "content-hash": "9f15259675b2b23b85b54abb4696cdca", "packages": [ { "name": "akaunting/laravel-setting", @@ -4788,6 +4788,53 @@ ], "time": "2023-02-05T15:03:45+00:00" }, + { + "name": "luizbills/css-generator", + "version": "v4.0.1", + "source": { + "type": "git", + "url": "https://github.com/luizbills/css-generator.php.git", + "reference": "e3807da033c2f300775a002358e026c3c33f8bdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/luizbills/css-generator.php/zipball/e3807da033c2f300775a002358e026c3c33f8bdb", + "reference": "e3807da033c2f300775a002358e026c3c33f8bdb", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=7.4.0" + }, + "require-dev": { + "codeception/codeception": "^4.2", + "codeception/module-asserts": "^1.0.0", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-strict-rules": "^1.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "luizbills\\CSS_Generator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Luiz Bills", + "email": "luizpbills@gmail.com" + } + ], + "description": "Write CSS programatically using PHP.", + "support": { + "issues": "https://github.com/luizbills/css-generator.php/issues", + "source": "https://github.com/luizbills/css-generator.php/tree/v4.0.1" + }, + "time": "2022-09-12T18:52:50+00:00" + }, { "name": "maennchen/zipstream-php", "version": "3.1.0", @@ -4936,6 +4983,87 @@ }, "time": "2023-05-10T11:58:31+00:00" }, + { + "name": "matthieumastadenis/couleur", + "version": "v0.1.2", + "source": { + "type": "git", + "url": "https://github.com/matthieumastadenis/couleur.git", + "reference": "3842cf51c9517e77afaa0a36ec78643a0c258e0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matthieumastadenis/couleur/zipball/3842cf51c9517e77afaa0a36ec78643a0c258e0b", + "reference": "3842cf51c9517e77afaa0a36ec78643a0c258e0b", + "shasum": "" + }, + "require": { + "php": "~8.1" + }, + "require-dev": { + "php": "~8.1", + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/utils/utils.php", + "src/utils/css/conversions.php", + "src/utils/css/utils.php", + "src/utils/hexRgb/conversions.php", + "src/utils/hexRgb/utils.php", + "src/utils/hsl/conversions.php", + "src/utils/hsl/utils.php", + "src/utils/hsv/conversions.php", + "src/utils/hsv/utils.php", + "src/utils/hwb/conversions.php", + "src/utils/hwb/utils.php", + "src/utils/lab/conversions.php", + "src/utils/lab/utils.php", + "src/utils/lch/conversions.php", + "src/utils/lch/utils.php", + "src/utils/linP3/conversions.php", + "src/utils/linP3/utils.php", + "src/utils/linProPhoto/conversions.php", + "src/utils/linProPhoto/utils.php", + "src/utils/linRgb/conversions.php", + "src/utils/linRgb/utils.php", + "src/utils/okLab/conversions.php", + "src/utils/okLab/utils.php", + "src/utils/okLch/conversions.php", + "src/utils/okLch/utils.php", + "src/utils/p3/conversions.php", + "src/utils/p3/utils.php", + "src/utils/proPhoto/conversions.php", + "src/utils/proPhoto/utils.php", + "src/utils/rgb/conversions.php", + "src/utils/rgb/utils.php", + "src/utils/xyzD50/conversions.php", + "src/utils/xyzD50/utils.php", + "src/utils/xyzD65/conversions.php", + "src/utils/xyzD65/utils.php" + ], + "psr-4": { + "matthieumastadenis\\couleur\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthieu Masta Denis", + "email": "matthieu.denis@abitus.net" + } + ], + "description": "A modern PHP 8.1+ color library, compatible with CSS Color Module Level 4", + "support": { + "issues": "https://github.com/matthieumastadenis/couleur/issues", + "source": "https://github.com/matthieumastadenis/couleur/tree/v0.1.2" + }, + "time": "2023-02-18T15:36:55+00:00" + }, { "name": "mchev/banhammer", "version": "v1.2.1", diff --git a/package.json b/package.json index 07256a0f2..d66151c2d 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 03c234671..0aebc8c4f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,8 +35,8 @@ devDependencies: specifier: ^10.4.15 version: 10.4.15(postcss@8.4.28) daisyui: - specifier: ^3.5.1 - version: 3.5.1 + specifier: ^4.4.17 + version: 4.4.17(postcss@8.4.28) laravel-vite-plugin: specifier: ^0.7.8 version: 0.7.8(vite@4.4.9) @@ -513,10 +513,6 @@ packages: fsevents: 2.3.2 dev: true - /colord@2.9.3: - resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} - dev: true - /commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} @@ -539,17 +535,21 @@ packages: hasBin: true dev: true - /daisyui@3.5.1: - resolution: {integrity: sha512-7GG+9QXnr2qQMCqnyFU8TxpaOYJigXiEtmzoivmiiZZHvxqIwYdaMAkgivqTVxEgy3Hot3m1suzZjmt1zUrvmA==} + /culori@3.3.0: + resolution: {integrity: sha512-pHJg+jbuFsCjz9iclQBqyL3B2HLCBF71BwVNujUYEvCeQMvV97R59MNK3R2+jgJ3a1fcZgI9B3vYgz8lzr/BFQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + + /daisyui@4.4.17(postcss@8.4.28): + resolution: {integrity: sha512-vcxLKoWiqPjEtcBkSayi9sDW1kWgWRdy1GjSu3zNtMiCsXwqDpCzNkdijuY9RuJ/2tBCtnwxhBv72Yizfi7KAQ==} engines: {node: '>=16.9.0'} dependencies: - colord: 2.9.3 css-selector-tokenizer: 0.8.0 - postcss: 8.4.28 + culori: 3.3.0 + picocolors: 1.0.0 postcss-js: 4.0.1(postcss@8.4.28) - tailwindcss: 3.3.3 transitivePeerDependencies: - - ts-node + - postcss dev: true /desandro-matches-selector@2.0.2: diff --git a/public/build/manifest.json b/public/build/manifest.json index 5265eeb58..fcadaca69 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -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" }, diff --git a/resources/views/conference/blocks/previous-block.blade.php b/resources/views/conference/blocks/previous-block.blade.php index fdca928df..bd3164795 100644 --- a/resources/views/conference/blocks/previous-block.blade.php +++ b/resources/views/conference/blocks/previous-block.blade.php @@ -1,7 +1,7 @@