Glassmorphism Rating Form - 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>Glassmorphism Rating Form</title> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"> <style> body { font-family: 'Roboto', sans-serif; background: url('https://source.unsplash.com/random') no-repeat center center/cover; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .rating-form { background: rgba(255, 255, 255, 0.2); border-radius: 12px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); padding: 2rem; max-width: 400px; width: 100%; text-align: center; color: white; } .rating-form h1 { font-size: 1.8rem; margin-bottom: 1rem; color: #000; } .rating-form p { margin-bottom: 1.5rem; color: #ddd; } .rating-form .stars { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.5rem; } .rating-form .stars input { display: none; } .rating-form .stars label { font-size: 2rem; color: #bbb; cursor: pointer; transition: color 0.3s ease; } .rating-form .stars input:checked ~ label, .rating-form .stars label:hover, .rating-form .stars label:hover ~ label { color: #ffeb3b; } .rating-form .feedback { display: none; flex-direction: column; gap: 0.5rem; } .rating-form .feedback input, .rating-form .feedback textarea { width: 96%; padding: 0.5rem; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 8px; background: rgba(255, 255, 255, 0.1); color: white; transition: border-color 0.3s ease; } .rating-form .feedback input:focus, .rating-form .feedback textarea:focus { border-color: #ffeb3b; } .rating-form .submit-btn { background: #ffeb3b; color: black; padding: 0.75rem 1.5rem; border: none; border-radius: 8px; cursor: pointer; transition: background 0.3s ease; } .rating-form .submit-btn:hover { background: #ffc107; } </style> </head> <body> <div class="rating-form"> <h1>Rate Our Service</h1> <p>We value your feedback. Please rate our service and provide your comments below.</p> <div class="stars"> <input type="radio" name="rating" id="star5" value="5"> <label for="star5" class="fa fa-star"></label> <input type="radio" name="rating" id="star4" value="4"> <label for="star4" class="fa fa-star"></label> <input type="radio" name="rating" id="star3" value="3"> <label for="star3" class="fa fa-star"></label> <input type="radio" name="rating" id="star2" value="2"> <label for="star2" class="fa fa-star"></label> <input type="radio" name="rating" id="star1" value="1"> <label for="star1" class="fa fa-star"></label> </div> <div class="feedback"> <input type="text" placeholder="Your Name"> <textarea rows="4" placeholder="Your Comments"></textarea> <button class="submit-btn">Submit</button> </div> </div> <script> document.querySelectorAll('.stars input').forEach((input) => { input.addEventListener('change', () => { document.querySelector('.feedback').style.display = 'flex'; }); }); </script> </body> </html>