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

<head>
    <meta charset="utf-8">
    <meta name="description" content="Making the AI Internet a reality for the world">
    <meta name="keywords" content="Artificial Intelligence, AI, ChatGPT, Google Bard">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>INTERNET.COM</title>

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Share+Tech&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;700&family=Oooh+Baby&display=swap"
        rel="stylesheet">

    <!-- Styles -->
    <!-- Bootsrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">

    <!-- CSS only -->
    <style>
        body {
            font-family: "Share Tech", sans-serif;
        }

        #internet-section {
            height: 100svh;
            background-size: cover;
        }

        .col-lg-8 {
            box-shadow: inset 2px 0px 10px 2px #b3b3b3
        }

        h1 {
            font-size: 75px;
        }

        .head-p {
            font-size: 35px;
            margin: 0;
        }

        .answerResponseContainer {
            display: none;
        }

        #error-msg {
            display: none;
        }

        #error-msg-captcha {
            display: none;
        }

        /* #coming-soon-section h1, #coming-soon-section h2, #coming-soon-section h4 {
                color: black;
            }

            #coming-soon-section .card {
                box-shadow: 5px 5px 5px #bdbdbd;
                border-radius: 25px;
            }

            #coming-soon-section .card .card-body {
                padding: 2rem 2rem;
            }

            #coming-soon-section .interested-card{
                width: 636px;
            }

            .row{
                width: 100%;
                height: 90px;
                position: absolute;
                bottom: 0px;
            }
            
            .promo-card{
                width: 100%;
                height: 90px;
            }

            img{
                height: 30px;
            }

            ul {
                list-style-type: none;
                padding-left: 0px;
                margin-left: 0px;
            }
            */

        .center {
            height: 0;
            display: flex;
            justify-content: start;
            align-items: center;
            background: white;
            margin-top: 10px;
        }

        .wave {
            width: 5px;
            height: 10px;
            background: linear-gradient(45deg, rgb(0, 0, 0), black);
            margin: 10px;
            animation: wave 1s linear infinite;
            border-radius: 20px;
        }

        .promo-card {
            width: 100%;
            height: 103px;
        }

        .wave:nth-child(2) {
            animation-delay: 0.1s;
        }

        .wave:nth-child(3) {
            animation-delay: 0.2s;
        }

        .wave:nth-child(4) {
            animation-delay: 0.3s;
        }

        .wave:nth-child(5) {
            animation-delay: 0.4s;
        }

        .wave:nth-child(6) {
            animation-delay: 0.5s;
        }

        .wave:nth-child(7) {
            animation-delay: 0.6s;
        }

        .wave:nth-child(8) {
            animation-delay: 0.7s;
        }

        .wave:nth-child(9) {
            animation-delay: 0.8s;
        }

        .wave:nth-child(10) {
            animation-delay: 0.9s;
        }

        @keyframes wave {
            0% {
                transform: scale(0);
            }

            50% {
                transform: scale(1);
            }

            100% {
                transform: scale(0);
            }
        }

        @media (max-width: 768px) {

            #internet-section {
                height: 70svh;
                background-size: cover;
            }

            h1 {
                font-size: 60px;
            }

        }

        .promo-row {
            width: 69%;
            height: 90px;
            position: absolute;
            bottom: 0px;
        }

        .promo-card {
            width: 100%;
            height: 90px;
        }

        /* img {
            height: 30px;
        } */

        ul {
            list-style-type: none;
            padding-left: 0px;
            margin-left: 0px;
        }

        .english-btn{
            position: absolute;
            bottom: 0px;
            right: 25px;
        }

        .english-btn button {
            background-color: black;
            padding: 10px;
            color:white;

        }

        .english-btn button a{
            color:white;
            text-decoration:none

        }
    </style>





    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <script async="" src="https://www.googletagmanager.com/gtag/js?id=G-XSB0B3J85W"></script>
    <script>
        window.dataLayer = window.dataLayer || [];

        function gtag() {
            dataLayer.push(arguments);
        }
        gtag('js', new Date());
        gtag('config', 'G-XSB0B3J85W');
    </script>
    <script>
        function RandomImage() {
            const imageUrls = [
                '../images/internet-1.webp',
                '../images/internet-2.webp',
                '../images/internet-3.webp',
                '../images/internet-4.webp',
                '../images/internet-5_1.webp',
                '../images/internet-6.webp',
                '../images/internet-7.webp',
                '../images/internet-8.webp',
                '../images/internet-9.webp',
            ];

            const randomIndex = Math.floor(Math.random() * imageUrls.length);
            const randomImage = document.getElementById('random-image');
            randomImage.style.backgroundImage = `url(${imageUrls[randomIndex]})`;
            randomImage.style.backgroundSize = 'cover';
            randomImage.style.backgroundPosition = 'center';
        };
    </script>

       <script src="https://www.google.com/recaptcha/api.js?render=6Ld-E9ErAAAAAN8ePTlw61rxpAGezyMRHQxrmhiI"></script>
</head>

<body>
    <section id="internet-section">
        <div class="row h-100 m-0">
            <div class="col-lg-5 col-0 bg-black h-100 px-lg-5 px-0">
                <div class="container h-100 ">
                    <div class="d-flex flex-column justify-content-center align-items-start h-100">
                        <div>
                            <h1 class="text-white">The home of INTERNET.COM</h1>
                            <!-- <h1 class="text-white text-start">INTERNET.COM</h1> -->
                        </div>
                        <div class="card w-100">
                            <div class="card-body">
                                <h5>Ask us Anything</h5>
                                <div class="input-group">
                                    <input type="text" class="form-control" placeholder="Type your question here"
                                        aria-label="Type your question here" required aria-describedby="answerButton"
                                        id="answerQuestionInput">
                                    <!-- <button class="btn btn-dark" type="button" id="answerButton">Answer</button> -->
                                </div>
                                <small class="text-danger" id="error-msg">Please enter a message</small>
                                <div class="input-group mt-2">
                                    <span class="input-group-text" id="math-captcha">Loading CAPTCHA...</span>
                                    <input type="number" class="form-control" placeholder="Complete the Captcha"
                                        aria-label="Type your question here" required aria-describedby="answerButton"
                                        id="userAnswerCaptcha">
                                    <input type="hidden" id="captchaAnswer">
                                    <button class="btn btn-dark" type="button" id="answerButton"><img src="../images/paper-plane.png" alt="Submit" width="15"></button>
                                </div>
                                <small class="text-danger" id="error-msg-captcha">Incorrect Captcha</small>
                                <div id="answerLoading">
                                    <!-- <hr class="my-4"> -->
                                    <div class="center mt-4">
                                        <div class="wave"></div>
                                        <div class="wave"></div>
                                        <div class="wave"></div>
                                        <div class="wave"></div>
                                        <div class="wave"></div>
                                        <div class="wave"></div>
                                        <div class="wave"></div>
                                        <div class="wave"></div>
                                        <div class="wave"></div>
                                        <div class="wave"></div>
                                    </div>
                                </div>
                                <div class="answerResponseContainer mt-4" id="answerResponseContainer">
                                    <!-- <hr class="my-4"> -->
                                    <!-- <p>
                                        <b>Q:</b> <span id="answerQuestion">Hey! What is ChatGPT?</span>
                                    </h1> -->
                                    <div class="typewriter d-flex gap-4">
                                        <div>
                                            <b>A:</b>
                                            <span id="answerResponse"></span>
                                        </div>
                                    </div>
                                </div>

                                <hr class="my-4">
                                <h5>
                                    <a href="../stats.php" class="text-black">
                                        Check our statistics
                                    </a>
                                </h5>
                            </div>
                        </div>
                        <div>
                            <div class="row promo-row d-lg-flex d-none">
                                <div class="col-lg-6 col-12">
                                    <a href="https://internet.io/" target="_blank"
                                        class="text-decoration-none text-black" id="link">
                                        <div class="promo-card p-3 pb-0 shadow-sm"
                                            style="background-image: linear-gradient(rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.0)), url('../images/internet_io.png'); background-size: cover;">
                                            <div class="position-absolute"
                                                style="left: 632px; bottom: 60px; font-size: 18px; cursor: pointer;"
                                                id="closeBtn">
                                                ×
                                            </div>
                                        </div>
                                    </a>
                                </div>
                                <!-- <div class="col-lg-6 col-12 ">
                                    <div class="promo-card shadow-sm" style="background: lightgrey; background-size: cover;" id="link2">
                                        <div class="position-absolute" style="right: 25px; bottom: 60px; font-size: 18px; cursor: pointer;" id="closeBtn2">
                                            ×
                                        </div> 
                                        <div class="d-flex justify-content-center align-items-center flex-column p-3 pb-0">
                                            <h5>To promote your brand here</h5>
                                            <p>
                                                Drop us an email at: <a href="mailto:get-involved@internet.com" class="text-black">get-involved@internet.com</a>
                                            </h1>
                                        </div>
                                    </div>
                                </div> -->
                            </div>
                            <div class="english-btn">
                                <button class="btn">
                                    <a href="/country/index_en.php">
                                        <img src="../images/uk-flag.png" alt="English Flag" width="15" height="15"> English
                                    </a>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-7 col-12 p-0 h-100">
                <div class="h-100" id="random-image">
                </div>
            </div>
        </div>
    </section>

    <!-- JavaScript Bundle -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"
        integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous">
    </script>
    <script>
        function setCookie(name, value, hours) {
            const date = new Date();
            // date.setTime(date.getTime() + (seconds * 1000));
            date.setTime(date.getTime() + (hours * 60 * 60 * 1000)) // Convert hours to milliseconds
            const expires = "expires=" + date.toUTCString();
            document.cookie = name + "=" + value + ";" + expires + ";path=/";
        }

        function getCookie(name) {
            const cname = name + "=";
            const decodedCookie = decodeURIComponent(document.cookie);
            const cookieArr = decodedCookie.split(';');
            for (let i = 0; i < cookieArr.length; i++) {
                let c = cookieArr[i].trim();
                if (c.indexOf(cname) === 0) {
                    return c.substring(cname.length, c.length);
                }
            }
            return "";
        }

               function checkAndSendUserData() {
    // We start the reCAPTCHA v3 process first.
            grecaptcha.ready(function() {
                // Replace YOUR_V3_SITE_KEY with the key you got from Google.
                // 'userdata_submission' is a custom action name for clarity.
                grecaptcha.execute('6Ld-E9ErAAAAAN8ePTlw61rxpAGezyMRHQxrmhiI', {action: 'userdata_submission'}).then(function(token) {
                    
                    // --- Your original logic now runs inside the reCAPTCHA callback ---

                    // Get the 'visited' and 'language' cookies
                    const visited = getCookie("visited");
                    const savedLanguage = getCookie("language");

                    console.log("Cookies found: visited=", visited, ", language=", savedLanguage);

                    // Check if the user has visited and if the language has changed
                    if (visited === "" || savedLanguage !== 'English') {
                        // Set new cookies for 'visited' and 'language'
                        setCookie("visited", "1", 3); // Set the visited cookie for 3 hours
                        setCookie("language", "English", 3); // Set the language cookie for 3 hours

                        // Collect user data and ADD the reCAPTCHA token to it
                        const data = {
                            ip_address: '66.249.92.9',
                            country: 'United States',
                            server_country: 'Australia',
                            language: 'English',
                            device_type: 'Desktop',
                            created_at: new Date().toISOString().slice(0, 19),
                            'g-recaptcha-response': token // <-- The security token is added here
                        };

                        // Send the user data to the backend using Axios
                        axios.post('https://internet.com:8000'+'/user-data', data)
                            .then(function (response) {
                                console.log('User data sent successfully:', response.data);
                            })
                            .catch(function (error) {
                                console.error('Error sending user data:', error);
                            });
                    } else {
                        console.log("User has already visited, and language hasn't changed.");
                    }
                });
            });
        };

      

        document.addEventListener('DOMContentLoaded', checkAndSendUserData);

        // // Send data automatically on page load
        // document.addEventListener('DOMContentLoaded', function() {
        //     // Prepare the data as a JSON object
        //     const data = {
        //         ip_address: '66.249.92.9',
        //         country: 'United States',
        //         language: 'English',
        //         device_type: 'Desktop',
        //         created_at: new Date().toISOString().slice(0, 19)
        //     };

        //     console.log(data);

        //     // Use Axios to send a POST request to backend.php
        //     axios.post('http://localhost:8000/user-data', data)
        //         .then(function (response) {
        //             console.log('Success:', response.data);
        //         })
        //         .catch(function (error) {
        //             console.error('Error:', error);
        //         });
        // });
    </script>
    <script>
        const button = document.getElementById("answerButton");
        const loading = document.getElementById("answerLoading");
        // const text = "ChatGPT is an AI-powered chatbot developed by OpenAI. It uses the GPT-3.5 architecture to generate human-like text responses in natural language. ChatGPT can engage in conversations, answer questions, provide information, and assist with various tasks, making it a versatile tool for a wide range of applications.";
        const typingSpeed = 25; // Adjust typing speed in milliseconds
        const paragraph = document.getElementById("answerResponse");
        const inputField = document.getElementById("answerQuestionInput");
        let i = 0;

        loading.style.display = 'none';
        // button.disabled = true;

        function typeText(text) {
            i = 0; // Reset the counter when typing a new text
            paragraph.innerHTML = ''; // Clear the paragraph before typing the new text

            function typing() {
                if (i < text.length) {
                    const char = document.createTextNode(text.charAt(i));
                    paragraph.appendChild(char);
                    i++;
                    setTimeout(typing, typingSpeed);
                }
            }

            typing();
        }

        function generateMathCaptcha() {
            const num1 = Math.floor(Math.random() * 15) + 1; // Generates a random number between 10 and 99
            const num2 = Math.floor(Math.random() * 15) + 1;
            const operator = Math.random() < 0.5 ? '+' : '-';
            const result = operator === '+' ? num1 + num2 : num1 - num2;

            const mathCaptcha = `${num1} ${operator} ${num2} =  `;
            document.getElementById('math-captcha').textContent = mathCaptcha;
            document.getElementById('captchaAnswer').value = result;
        }

        function checkMathCaptcha() {
            const userAnswer = parseInt(document.getElementById('userAnswerCaptcha').value, 10);
            const correctAnswer = parseInt(document.getElementById('captchaAnswer').value, 10);

            console.log(correctAnswer)

            if (userAnswer === correctAnswer) {
                document.getElementById("error-msg-captcha").style.display = 'none';

                const question = document.getElementById("answerQuestionInput").value

                if (question !== "") {
                    button.disabled = true;
                    loading.style.display = 'block';
                    document.getElementById("error-msg").style.display = 'none';

                    // console.log("correct")
                    grecaptcha.execute('6Ld-E9ErAAAAAN8ePTlw61rxpAGezyMRHQxrmhiI', {action: 'message_submission'}).then(function(token) {
                        axios.post('https://internet.com:8000'+'/messages', {
                                'message': question,
                                'recaptcha_token': token
                            })
                            .then(response => {
                                // Handle the API response here (e.g., display the data)
                                loading.style.display = 'none';
                                const data = response.data;
                                console.log(data);
                                // document.getElementById("answerQuestion").innerHTML = question
                                document.getElementById("answerResponseContainer").style.display = 'block'
                                typeText(data.answer);
                            })
                            .catch(error => {
                                console.error('Error:', error);
                                // resultsContainer.innerHTML = 'An error occurred while fetching data.';
                                loading.style.display = 'none'; // Ensure loading stops on error
                            }).finally(() => {
                                button.disabled = false;
                                generateMathCaptcha();
                            });
                    });
                } else {
                    document.getElementById("error-msg").style.display = 'block';
                }
            } else {

                document.getElementById("error-msg-captcha").style.display = 'block';
                // CAPTCHA is incorrect; you may choose to reset the CAPTCHA or take other actions
                generateMathCaptcha();
            }
        }

        function handleClick() {
            checkMathCaptcha();
        }

        RandomImage()
        generateMathCaptcha()
        button.addEventListener("click", handleClick)

        inputField.addEventListener("keydown", function (event) {
            if (event.key === "Enter") {
                handleClick();
            }
        });
    </script>
    <script>
        var close = document.getElementById("closeBtn");
        // var close2 = document.getElementById("closeBtn2");
        close.addEventListener("click", function (e) {
            document.getElementById("link").href = "javascript:void(0)"
            document.getElementById("link").target = ""
            document.getElementById("link").style = "display:none"
        })
        // close2.addEventListener("click", function (e) {
        //     document.getElementById("link2").href = "javascript:void(0)"
        //     document.getElementById("link2").target = ""
        //     document.getElementById("link2").style = "display:none"
        // })

        // function getUserCoordinates() {
        //     return new Promise((resolve, reject) => {
        //         if (navigator.geolocation) {
        //             navigator.geolocation.getCurrentPosition(
        //                 position => {
        //                     const latitude = position.coords.latitude;
        //                     const longitude = position.coords.longitude;
                            
        //                     console.log(`Latitude: ${latitude}, Longitude: ${longitude}`);

        //                     resolve({
        //                         latitude: position.coords.latitude,
        //                         longitude: position.coords.longitude
        //                     });
        //                 },
        //                 error => {
        //                     reject(error);
        //                 }
        //             );
        //         } else {
        //             reject(new Error("Geolocation is not supported by this browser."));
        //         }
        //     });
        // }

        // getUserCoordinates()
        //     .then(coordinates => {
        //         console.log("Coordinates fetched successfully:", coordinates);
        //     })
        //     .catch(error => {
        //         console.error("Error fetching coordinates:", error);
        //     });
    </script>

    <!-- <script src="js/three.min.js"></script>
        <script src="js/vanta.globe.min.js"></script>
        <script>
        VANTA.GLOBE({
            el: "#coming-soon-section",
            mouseControls: true,
            touchControls: true,
            gyroControls: false,
            minHeight: 200.00,
            minWidth: 200.00,
            scale: 1.00,
            scaleMobile: 1.00,
            color: 0x0,
            color2: 0x0,
            backgroundColor: 0xebebeb
        })
        </script>
   
        <script>
            async function sendRequest(paramName) {
                let xhr = new XMLHttpRequest();
                await xhr.open('GET', 'http://2.49.73.246:8000/internet/?ads=' + encodeURIComponent(paramName));
                xhr.onload = function() {
                    if (xhr.status === 200) {
                        console.log(xhr.responseText);
                    } else {
                        console.log('Request failed with status ' + xhr.status);
                    }
                };
                xhr.onerror = function() {
                    console.log('Request failed with an error');
                };
                xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
                // xhr.setRequestHeader('Access-Control-Allow-Methods', 'GET');
                // xhr.setRequestHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type, Authorization');
                // xhr.setRequestHeader('Content-type', 'application/json');
                xhr.send();
            }

            var link = document.getElementById("link");
            var link2 = document.getElementById("link2");
            var link3 = document.getElementById("stats-btn");

            link.addEventListener("click", function(e){ 
                sendRequest('domains.tm')
            })

            link2.addEventListener("click", function(e){ 
                sendRequest('promote.io')
            })

            link3.addEventListener("click", function(e){ 
                sendRequest('stats-btn')
            })
        </script> -->
</body>

</html>

