<?php

declare(strict_types=1);

session_start();

$targetPage = isset($_SESSION['user_id']) ? 'dashboard-menu' : 'login';
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Loading - CFIWallet</title>
    <link rel="stylesheet" href="../css/output.css">
</head>

<body class="bg-white mx-auto">
    <div class="flex flex-col items-center h-screen w-full">
        <div class="flex justify-center h-full items-center">
            <img src="../img/logo/logo-cfi.png" alt="Logo CFIWallet" class="w-40 h-auto">
        </div>
        <div class="my-7 h-full flex flex-col gap-5 justify-center">
            <div id="loader-wrapper">
            <div class="mx-auto loader"></div>
            </div>
            <h1 class="text-main text-5xl font-bold text-center">CFI-Wallet</h1>
        </div>
    </div>

    <script>
        setTimeout(function () {
            window.location.href = '<?php echo $targetPage; ?>';
        }, 2000);
    </script>
</body>

</html>
