


<?php
$settings = \App\Models\Setting::first();
$preloaderEnabled = $settings->preloader_enabled ?? true;
$preloaderType = $settings->preloader_type ?? 'spinner';
$preloaderColor = $settings->preloader_color ?? '#3b82f6';
$preloaderBgColor = $settings->preloader_background_color ?? '#ffffff';
$preloaderDuration = $settings->preloader_duration ?? 2000;
$preloaderText = trans('app.Loading...');
$siteLogo = $settings->site_logo ?? null;
$logoText = $settings->logo_text ?? config('app.name');
$logoShowText = $settings->logo_show_text ?? true;
?>

<?php if($preloaderEnabled): ?>
<div class="preloader-container" 
     id="preloader-container"
     data-enabled="1"
     data-type="<?php echo e($preloaderType); ?>"
     data-color="<?php echo e($preloaderColor); ?>"
     data-bg="<?php echo e($preloaderBgColor); ?>"
     data-duration="<?php echo e($preloaderDuration); ?>"
     data-text="<?php echo e($preloaderText); ?>"
     data-logo="<?php echo e($siteLogo); ?>">
    <div class="preloader-content">
        
        <?php if($siteLogo || $logoShowText): ?>
        <div class="preloader-logo">
            <?php if($siteLogo): ?>
            <img src="<?php echo e(asset('storage/' . $siteLogo)); ?>" alt="<?php echo e($logoText); ?>" class="preloader-logo-img"
                class="max-w-[150px] max-h-[50px]">
            <?php elseif($logoShowText): ?>
            <div class="preloader-logo-text"
                class="text-gray-800 text-2xl font-semibold">
                <?php echo e($logoText); ?>

            </div>
            <?php endif; ?>
        </div>
        <?php endif; ?>

        
        <div class="preloader-animation">
            <?php switch($preloaderType):
                case ('spinner'): ?>
                    <div class="preloader-spinner"></div>
                    <?php break; ?>
                <?php case ('dots'): ?>
                    <div class="preloader-dots">
                        <div class="preloader-dot"></div>
                        <div class="preloader-dot"></div>
                        <div class="preloader-dot"></div>
                    </div>
                    <?php break; ?>
                <?php case ('bars'): ?>
                    <div class="preloader-bars">
                        <div class="preloader-bar"></div>
                        <div class="preloader-bar"></div>
                        <div class="preloader-bar"></div>
                        <div class="preloader-bar"></div>
                        <div class="preloader-bar"></div>
                    </div>
                    <?php break; ?>
                <?php case ('pulse'): ?>
                    <div class="preloader-pulse"></div>
                    <?php break; ?>
                <?php case ('progress'): ?>
                    <div class="preloader-progress">
                        <div class="preloader-progress-bar"></div>
                    </div>
                    <?php break; ?>
                <?php case ('custom'): ?>
                    <div class="preloader-custom">
                        <?php echo $settings->preloader_custom_css ?? '<div class="custom-loader"></div>'; ?>

                    </div>
                    <?php break; ?>
                <?php default: ?>
                    <div class="preloader-spinner"></div>
            <?php endswitch; ?>
        </div>

        
        <div class="preloader-text"><?php echo e($preloaderText); ?></div>
    </div>
</div>


<?php endif; ?>


<noscript>
    <link rel="stylesheet" href="<?php echo e(asset('assets/front/css/preloader-noscript.css')); ?>">
</noscript><?php /**PATH /home/kaaliicore/public_html/check.kaaliicore.com/resources/views/components/preloader.blade.php ENDPATH**/ ?>