Gradient Search Plaza - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Gradient Search Plaza</title> <style> body { font-family: 'Arial', sans-serif; background: linear-gradient(135deg, #f3ec78, #af4261); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .search-container { background: rgba(255, 255, 255, 0.2); border-radius: 15px; padding: 30px; width: 350px; text-align: center; box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); } .search-container h2 { margin: 0; font-size: 22px; color: #fff; margin-bottom: 20px; } .search-container input[type="text"] { width: 90%; padding: 10px 15px; margin: 10px 0; border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 25px; font-size: 16px; outline: none; background: rgba(255, 255, 255, 0.1); color: #fff; transition: border 0.3s, background 0.3s; } .search-container input[type="text"]:focus { border-color: #fff; background: rgba(255, 255, 255, 0.2); } .search-container button { padding: 10px 20px; border: none; background: rgba(255, 255, 255, 0.4); color: #fff; border-radius: 25px; cursor: pointer; font-size: 16px; transition: background 0.3s; } .search-container button:hover { background: rgba(255, 255, 255, 0.6); } .results { margin-top: 20px; text-align: left; } .results .friend { display: flex; align-items: center; background: rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 10px; margin-bottom: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s; } .results .friend:hover { transform: translateY(-5px); } .results img { border-radius: 50%; width: 50px; height: 50px; margin-right: 15px; } .results .friend-info { flex: 1; } .results .friend-info h3 { margin: 0; font-size: 18px; color: #fff; } .results .friend-info p { margin: 5px 0 0; color: #ddd; } .emoji { display: inline-block; margin-left: 10px; animation: emoji-bounce 1.5s infinite; } @keyframes emoji-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } } .no-results { font-size: 16px; color: #ccc; margin-top: 20px; } .suggestions { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 5px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); position: absolute; width: calc(100% - 60px); z-index: 10; max-height: 150px; overflow-y: auto; display: none; left: 50%; transform: translateX(-50%); } .suggestions div { padding: 10px; cursor: pointer; transition: background 0.3s; color: #fff; } .suggestions div:hover { background: rgba(255, 255, 255, 0.2); } </style> </head> <body> <div class="search-container"> <h2>Gradient Search Plaza <span class="emoji">🔎</span></h2> <input type="text" id="gradientSearch" placeholder="Type a name..." oninput="showSuggestions()"> <div class="suggestions" id="suggestions"></div> <button onclick="searchGradient()">Search</button> <div class="results" id="results"></div> <div class="no-results" id="noResults" style="display: none;">No pals found <span class="emoji">😔</span></div> </div> <script> const pals = [ { name: 'Alice Johnson', avatar: 'https://via.placeholder.com/50' }, { name: 'Bob Smith', avatar: 'https://via.placeholder.com/50' }, { name: 'Charlie Brown', avatar: 'https://via.placeholder.com/50' }, { name: 'David Wilson', avatar: 'https://via.placeholder.com/50' }, { name: 'Emma Davis', avatar: 'https://via.placeholder.com/50' }, // Add more pals here ]; function showSuggestions() { const query = document.getElementById('gradientSearch').value.toLowerCase(); const suggestions = document.getElementById('suggestions'); suggestions.innerHTML = ''; if (query) { const filteredPals = pals.filter(pal => pal.name.toLowerCase().includes(query)); filteredPals.forEach(pal => { const suggestion = document.createElement('div'); suggestion.innerText = pal.name; suggestion.onclick = () => { document.getElementById('gradientSearch').value = pal.name; suggestions.style.display = 'none'; }; suggestions.appendChild(suggestion); }); suggestions.style.display = 'block'; } else { suggestions.style.display = 'none'; } } function searchGradient() { const query = document.getElementById('gradientSearch').value.toLowerCase(); const results = document.getElementById('results'); const noResults = document.getElementById('noResults'); const suggestions = document.getElementById('suggestions'); results.innerHTML = ''; noResults.style.display = 'none'; suggestions.style.display = 'none'; const filteredPals = pals.filter(pal => pal.name.toLowerCase().includes(query)); if (filteredPals.length > 0) { filteredPals.forEach(pal => { const palElement = document.createElement('div'); palElement.classList.add('friend'); palElement.innerHTML = ` <img src="${pal.avatar}" alt="${pal.name}"> <div class="friend-info"> <h3>${pal.name}</h3> <p>Online now <span class="emoji">💬</span></p> </div> `; results.appendChild(palElement); }); } else { noResults.style.display = 'block'; } } </script> </body> </html>