@php // Theme option color values map onto the SCSS palette in // assets/sass/abstracts/_variable.scss. Defaults below mirror that palette // so an unconfigured install matches the shipped design. $themeMode = theme_option('default_theme_mode', 'light'); $primaryColor = theme_option('primary_color', '#DC4646'); $secondaryColor = theme_option('secondary_color', '#70857A'); $headingColor = theme_option('heading_color', '#101010'); $bodyColor = theme_option('body_text_color', '#696E73'); $linkColor = theme_option('link_color', $primaryColor); $linkHoverColor = theme_option('link_hover_color', '#C93A0B'); $borderColor = theme_option('border_color', '#E9E9E9'); $successColor = theme_option('success_color', '#3DAB25'); $dangerColor = theme_option('danger_color', '#F03E3E'); @endphp
{{-- FOUC prevention — read theme mode BEFORE CSS loads --}} @php // Translatable strings consumed by theme JS (main.js, shop.js, etc.). // Use `window.amerceI18n.key || 'Fallback'` in JS so missing keys degrade gracefully. $amerceI18n = [ 'remove_wishlist' => __('Remove Wishlist'), 'add_to_wishlist' => __('Add to Wishlist'), 'no_file_chosen' => __('No File Chosen'), 'before' => __('Before'), 'after' => __('After'), 'loading' => __('Loading...'), 'unable_to_load' => __('Unable to load products.'), 'in_stock' => __('In Stock'), 'out_of_stock' => __('Out of stock'), 'product_singular' => __('Product'), 'product_plural' => __('Products'), 'products_found_label' => __('found'), 'link_copied' => __('Link copied to clipboard'), 'copy_failed' => __('Copy failed, please copy the link manually.'), 'subscription_success' => __('Subscribed successfully.'), 'subscription_failed' => __('Subscription failed. Please try again.'), ]; @endphp {{-- LCP preload — homepage hero slider only. Cached forever; bust via `php artisan cache:forget amerce.lcp_hero_url` after admin slider edit (or hook an observer on SimpleSliderItem save/delete). --}} @if (\Illuminate\Support\Facades\Route::is('public.index')) @php $lcpHeroUrl = \Illuminate\Support\Facades\Cache::rememberForever('amerce.lcp_hero_url', function () { $slider = \Botble\SimpleSlider\Models\SimpleSlider::query() ->where('status', \Botble\Base\Enums\BaseStatusEnum::PUBLISHED) ->oldest('id') ->first(); $firstSlide = $slider?->publishedSliderItems()->first(); if (! $firstSlide?->image) { return null; } $original = \RvMedia::getImageUrl($firstSlide->image); return [ 'src' => $original, 'srcset' => \RvMedia::getImageUrl($firstSlide->image, 'hero-sm') . ' 400w, ' . \RvMedia::getImageUrl($firstSlide->image, 'hero-md') . ' 768w, ' . $original . ' 1920w', 'sizes' => '100vw', ]; }); @endphp @if ($lcpHeroUrl) @endif @endif {!! Theme::header() !!} {{-- Theme option color overrides — write directly into the SCSS palette vars defined in assets/sass/abstracts/_variable.scss so admin changes cascade through every component that already uses var(--primary), etc. --}} {!! apply_filters(THEME_FRONT_BODY, null) !!} @if (theme_option('preloader_enabled', true)) {!! Theme::partial('preloader') !!} @endif