HTMLify

Amar-engine.html
Views: 56 | Author: amar
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Amar's Engine</title>
    <style>
    
    
    /* thanks to beyoné */
        body {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            margin: 0;
            background-image: url('https://www.transparenttextures.com/patterns/asfalt-dark.png');
            font-family: 'Arial', sans-serif;
            color: #333;
            padding: 20px;
            box-sizing: border-box;
        }
        h1 {
            font-size: 2.5em;
            margin-bottom: 20px;
            text-align: center;
            color: black;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
        }
        .engine-button {
            padding: 15px;
            margin: 15px 0;
            border: none;
            cursor: pointer;
            border-radius: 30px;
            background: transparent;
            outline: none;
            transition: transform 0.3s, background-color 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: black;
            font-weight: bold;
            font-size: 1.2em;
        }
        .engine-button:hover {
            transform: scale(1.1);
            background-color: rgba(0, 0, 0, 0.1);
        }
        input[type="text"] {
            padding: 15px;
            width: 100%;
            max-width: 400px;
            margin-right: 10px;
            border-radius: 24px;
            border: 2px solid #333;
            outline: none;
            font-size: 1em;
            background-color: rgba(255, 255, 255, 0.8);
            color: black;
        }
        button {
            padding: 15px 10px;
            background-color: #4CAF50;
            color: black;
            border: none;
            cursor: pointer;
            border-radius: 24px;
            font-size: 1em;
            margin-top: 10px;
            width: 120px;
        }
        button:hover {
            background-color: #45a049;
        }
        img {
            width: 40px;
            height: 40px;
            vertical-align: middle;
            margin-left: 8px;
        }
        footer {
            margin-top: 40px;
            font-size: 0.9em;
            text-align: center;
            color: black;
        }
        footer a {
            color: #4CAF50;
            text-decoration: none;
        }
        /* Responsive Styles */
        @media (max-width: 600px) {
            h1 {
                font-size: 2em;
            }
            button, .engine-button {
                width: 100%;
                font-size: 1em;
            }
            input[type="text"] {
                width: 90%;
                font-size: 0.9em;
            }
        }
    </style>
</head>
<body>

    <h1>Amar's Engine</h1>

    <button class="engine-button" id="searchButton" onclick="changeEngine()">
        <span style="font-size: 1.3em;">I wanna search with</span>
        <img src="https://upload.wikimedia.org/wikipedia/commons/2/2f/Google_2015_logo.svg" alt="Google Logo" />
    </button>
    
    <input type="text" id="searchQuery" placeholder="Enter your search term" />
    <button onclick="search()">Search</button>
    
    <footer>
        <p>Powered by <a href="https://www.buymeacoffee.com/pokemonmeme" target="_blank">amar</a></p>
    </footer>

    <script>
        const engines = [
            { name: "Google", url: "https://www.google.com/search?q=", logo: "https://upload.wikimedia.org/wikipedia/commons/2/2f/Google_2015_logo.svg" },
            { name: "Bing", url: "https://www.bing.com/search?q=", logo: "https://upload.wikimedia.org/wikipedia/commons/9/9c/Bing_Fluent_Logo.svg" },
            { name: "DuckDuckGo", url: "https://duckduckgo.com/?q=", logo: "https://upload.wikimedia.org/wikipedia/en/8/88/DuckDuckGo_logo.svg"},
            { name: "Yahoo", url: "https://search.yahoo.com/search?p=", logo: "https://upload.wikimedia.org/wikipedia/commons/3/3a/Yahoo%21_%282019%29.svg" }
        ];

        let currentEngineIndex = 0;

        function changeEngine() {
            currentEngineIndex = (currentEngineIndex + 1) % engines.length;
            const button = document.getElementById("searchButton");
            const logo = engines[currentEngineIndex].logo;
            button.innerHTML = `<span style="font-size: 1.0em;">I wanna search with</span> <img src="${logo}" alt="${engines[currentEngineIndex].name} Logo" />`;
        }

        function search() {
            const query = document.getElementById("searchQuery").value.trim();
            if (query) {
                const engineUrl = engines[currentEngineIndex].url;
                window.open(engineUrl + encodeURIComponent(query), '_blank');
            } else {
                alert("Please enter a search term.");
            }
        }
    </script>

</body>
</html>

Comments