HTMLify

Cil.html
Views: 91 | Author: amar
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cookie Consent</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            background: #f4f4f4;
            margin: 0;
            padding: 50px;
            transition: background 0.5s ease-in-out;
        }
        .content {
            max-width: 600px;
            margin: auto;
            padding: 20px;
            background: white;
            box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
            border-radius: 10px;
            transition: opacity 0.5s ease-in-out;
        }
        #message {
            font-size: 24px;
            font-weight: bold;
            margin-top: 20px;
            opacity: 0;
            transform: scale(0.9);
            transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
        }
        .show {
            opacity: 1 !important;
            transform: scale(1) !important;
        }
        /* Pop-up Styling */
        .modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 20px;
            box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
            border-radius: 10px;
            text-align: center;
            width: 300px;
            opacity: 1;
            z-index: 999;
        }
        .hidden {
            display: none;
        }
        .modal p {
            font-size: 16px;
            margin-bottom: 15px;
        }
        button {
            background: #007BFF;
            color: white;
            border: none;
            padding: 10px 15px;
            cursor: pointer;
            margin: 10px;
            border-radius: 5px;
            transition: background 0.3s ease-in-out;
        }
        button:hover {
            background: #0056b3;
        }
        .dismiss {
            background: #aaa;
        }
        .dismiss:hover {
            background: #888;
        }
    </style>
</head>
<body>

    <div class="content" id="article">
        <h2>Why We Don't Use Python?</h2>
        <p>Python is an excellent programming language known for its simplicity and flexibility. However, in web development, it has some limitations. Many websites prefer JavaScript because:</p>
        <ul>
            <li>JavaScript runs directly in the browser, making pages more interactive.</li>
            <li>Python requires a backend setup, which can be more complex.</li>
            <li>JavaScript frameworks like React and Vue provide better user experiences.</li>
            <li>Performance-wise, JavaScript is often faster for front-end tasks.</li>
        </ul>
        <p>While Python is great for backend and AI applications, JavaScript dominates web development due to its speed and browser compatibility.</p>
    </div>

    <h1 id="message">Waiting for your choice...</h1>

    <div class="modal" id="cookieModal">
        <p>We use cookies to improve your experience. Do you accept?</p>
        <button onclick="acceptCookies()">Yes, Accept</button>
        <button class="dismiss" onclick="dismissCookies()">Dismiss</button>
    </div>

    <script>
        function acceptCookies() {
            document.getElementById('cookieModal').classList.add('hidden');

            // Fade out the article and show the message
            document.getElementById('article').style.opacity = '0';
            setTimeout(() => {
                document.getElementById('article').style.display = 'none';
                document.body.style.background = "#d4edda";
                showMessage("Tudwa liya Ramjan.");
            }, 500);
        }

        function dismissCookies() {
            document.getElementById('cookieModal').classList.add('hidden');
        }

        function showMessage(text) {
            const message = document.getElementById('message');
            message.innerText = text;
            message.classList.add("show");
        }

        function showPopup() {
            document.getElementById('cookieModal').classList.remove('hidden');
        }

        // Always show the pop-up when the page loads
        window.onload = showPopup;
    </script>

</body>
</html>

Comments