Modern Color Picker - VexaX
Run Code
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>Modern Color Picker</title> <style> body { font-family: 'Arial', sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(to right, #f7ff00, #db36a4); margin: 0; } .color-picker-container { display: flex; flex-direction: column; align-items: center; background: #ffffff; border-radius: 20px; box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1); padding: 30px; width: 320px; } .color-picker-container h2 { margin-bottom: 25px; color: #333; } .color-picker { display: flex; align-items: center; } .color-input { width: 60px; height: 60px; border: none; cursor: pointer; margin-right: 15px; border-radius: 50%; box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); transition: transform 0.3s; } .color-input:hover { transform: scale(1.2); } .color-code { font-size: 1.3em; color: #444; } .copy-btn { display: flex; align-items: center; margin-top: 25px; padding: 12px 25px; background: #ff5f6d; color: #fff; border: none; border-radius: 10px; cursor: pointer; transition: background 0.3s; } .copy-btn:hover { background: #ff1e1e; } .copy-btn i { margin-right: 12px; } .notification { position: fixed; bottom: 20px; right: 20px; background: #4caf50; color: #fff; padding: 12px 25px; border-radius: 10px; display: none; align-items: center; } .notification i { margin-right: 12px; } </style> </head> <body> <div class="color-picker-container"> <h2>Choose a Color 🌈</h2> <div class="color-picker"> <input type="color" class="color-input" id="colorInput" title="color"> <span class="color-code" id="colorCode">#ffffff</span> </div> <button class="copy-btn" onclick="copyColorCode()"> <i class="fas fa-copy"></i> Copy Color Code </button> </div> <div class="notification" id="notification"> <i class="fas fa-check"></i> Color code copied! </div> <script src="https://kit.fontawesome.com/a076d05399.js"></script> <script> const colorInput = document.getElementById('colorInput'); const colorCode = document.getElementById('colorCode'); const notification = document.getElementById('notification'); colorInput.addEventListener('input', () => { colorCode.textContent = colorInput.value; }); function copyColorCode() { const code = colorCode.textContent; navigator.clipboard.writeText(code).then(() => { showNotification(); }); } function showNotification() { notification.style.display = 'flex'; setTimeout(() => { notification.style.display = 'none'; }, 2000); } </script> </body> </html>