<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Page Title -->
    <title>ThomGames</title>
    <link rel="icon" href="/assets/img/favicon.png">
    <!-- Custom CSS File -->
    <link rel="stylesheet" href="/assets/css/style.css">
    <!-- FontAwesome CSS Cdn link -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" />
    <style>
        /* CSS for the loader */
        .loader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #111;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        .blob {
            width: 2rem;
            height: 2rem;
            background: rgba(230, 230, 230, 0.85);
            border-radius: 50%;
            position: absolute;
            left: calc(50% - 1rem);
            top: calc(50% - 1rem);
            box-shadow: 0 0 1rem rgba(255, 255, 255, 0.25);
        }

        .blob-2 {
            animation: animate-to-2 1.5s infinite;
        }

        .blob-3 {
            animation: animate-to-3 1.5s infinite;
        }

        .blob-1 {
            animation: animate-to-1 1.5s infinite;
        }

        .blob-4 {
            animation: animate-to-4 1.5s infinite;
        }

        .blob-0 {
            animation: animate-to-0 1.5s infinite;
        }

        .blob-5 {
            animation: animate-to-5 1.5s infinite;
        }

        @keyframes animate-to-2 {

            25%,
            75% {
                transform: translateX(-1.5rem) scale(0.75);
            }

            95% {
                transform: translateX(0rem) scale(1);
            }
        }

        @keyframes animate-to-3 {

            25%,
            75% {
                transform: translateX(1.5rem) scale(0.75);
            }

            95% {
                transform: translateX(0rem) scale(1);
            }
        }

        @keyframes animate-to-1 {
            25% {
                transform: translateX(-1.5rem) scale(0.75);
            }

            50%,
            75% {
                transform: translateX(-4.5rem) scale(0.6);
            }

            95% {
                transform: translateX(0rem) scale(1);
            }
        }

        @keyframes animate-to-4 {
            25% {
                transform: translateX(1.5rem) scale(0.75);
            }

            50%,
            75% {
                transform: translateX(4.5rem) scale(0.6);
            }

            95% {
                transform: translateX(0rem) scale(1);
            }
        }

        @keyframes animate-to-0 {
            25% {
                transform: translateX(-1.5rem) scale(0.75);
            }

            50% {
                transform: translateX(-4.5rem) scale(0.6);
            }

            75% {
                transform: translateX(-7.5rem) scale(0.5);
            }

            95% {
                transform: translateX(0rem) scale(1);
            }
        }

        @keyframes animate-to-5 {
            25% {
                transform: translateX(1.5rem) scale(0.75);
            }

            50% {
                transform: translateX(4.5rem) scale(0.6);
            }

            75% {
                transform: translateX(7.5rem) scale(0.5);
            }

            95% {
                transform: translateX(0rem) scale(1);
            }
        }
    </style>
</head>

<body>

    <!-- Loader -->
    <div class="loader">
        <div class="blob blob-0"></div>
        <div class="blob blob-1"></div>
        <div class="blob blob-2"></div>
        <div class="blob blob-3"></div>
        <div class="blob blob-4"></div>
        <div class="blob blob-5"></div>
    </div>

    <section class="game-play-section">
        <iframe src="<%= data.link %>" frameborder="0" width="100%"></iframe>
        <div class="back-btn">
            <a href="/<%= data.name %>"><i class="fa-solid fa-arrow-left-long"></i></a>
        </div>
    </section>

    <%- include('footer') %>

        <script>
            // Function to hide the loader and show the content after 5 seconds
            setTimeout(() => {
                document.querySelector('.loader').style.display = 'none';
                document.querySelector('.game-play-section').style.display = 'block';
            }, 5000); // 5000 milliseconds = 5 seconds
        </script>

</body>

</html>