Checkboxes are a fundamental element in user interface design, offering a simple way for users to make selections. They are versatile, easy to implement, and can significantly enhance the user experience.
In this article, we will explore 10 checkbox examples that demonstrate various styles and functionalities. These examples will provide inspiration and practical insights for integrating checkboxes into your own projects.
CODE1
Here's the code:
CODETEXT1
CODE2
Here's the code:
CODETEXT2
CODE3
Here's the code:
CODETEXT3
CODE4
Here's the code:
CODETEXT4
CODE5
Here's the code:
CODETEXT5
Designers and developers love Subframe for its drag-and-drop interface and intuitive, responsive canvas. Create pixel-perfect UI effortlessly, ensuring every checkbox is flawless.
Join the community of satisfied users and elevate your design game. Start for free today!
CODE6
Here's the code:
CODETEXT6
CODE7
Here's the code:
CODETEXT7
CODE8
Here's the code:
CODETEXT8
CODE9
Here's the code:
CODETEXT9
CODE10
Here's the code:
CODETEXT10
Ready to elevate your UI design game? With Subframe, you can create pixel-perfect interfaces, including checkboxes, in minutes. Our drag-and-drop editor ensures efficiency and precision.
Don't wait! Start for free and begin designing stunning UIs immediately.
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> :root { --primary-blue: #3498db; --secondary-blue: #2980b9; --primary-green: #2ecc71; --secondary-green: #27ae60; --light-blue: #ebf5fb; --light-green: #e8f8f5; --gray: #7f8c8d; --light-gray: #ecf0f1; --dark-gray: #34495e; --white: #ffffff; --shadow: 0 4px 6px rgba(0, 0, 0, 0.1); --transition: all 0.3s ease; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background-color: var(--white); display: flex; justify-content: center; align-items: center; min-height: 100vh; color: var(--dark-gray); padding: 15px; } .patient-form { width: 100%; max-width: 650px; background: var(--white); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; position: relative; } .form-header { background: linear-gradient(135deg, var(--primary-blue), var(--primary-green)); padding: 20px 30px; color: var(--white); position: relative; overflow: hidden; } .form-header h1 { font-size: 24px; margin-bottom: 5px; font-weight: 600; position: relative; z-index: 2; } .form-header p { font-size: 14px; opacity: 0.9; position: relative; z-index: 2; } .form-header::before { content: ''; position: absolute; width: 150px; height: 150px; background: rgba(255, 255, 255, 0.1); border-radius: 50%; top: -50px; right: -50px; } .form-header::after { content: ''; position: absolute; width: 100px; height: 100px; background: rgba(255, 255, 255, 0.1); border-radius: 50%; bottom: -30px; left: 30px; } .form-content { padding: 30px; max-height: 520px; overflow-y: auto; } .form-section { margin-bottom: 25px; } .form-section h2 { font-size: 18px; margin-bottom: 15px; color: var(--primary-blue); display: flex; align-items: center; font-weight: 600; } .form-section h2 .icon { margin-right: 10px; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; } .checkbox-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; } .checkbox-container { position: relative; } .checkbox-label { display: flex; align-items: center; cursor: pointer; padding: 10px 15px; border-radius: 8px; background-color: var(--light-gray); transition: var(--transition); border: 2px solid transparent; } .checkbox-label:hover { background-color: var(--light-blue); } .form-section:nth-child(even) .checkbox-label:hover { background-color: var(--light-green); } .checkbox-input { position: absolute; opacity: 0; width: 0; height: 0; } .checkbox-custom { width: 22px; height: 22px; border-radius: 4px; border: 2px solid var(--gray); background-color: var(--white); margin-right: 10px; display: flex; align-items: center; justify-content: center; transition: var(--transition); position: relative; overflow: hidden; } .checkbox-custom::after { content: ''; position: absolute; width: 0; height: 0; background-color: var(--primary-blue); border-radius: 2px; transition: var(--transition); } .form-section:nth-child(even) .checkbox-custom::after { background-color: var(--primary-green); } .checkbox-input:checked + .checkbox-label { border-color: var(--primary-blue); background-color: var(--light-blue); font-weight: 500; } .form-section:nth-child(even) .checkbox-input:checked + .checkbox-label { border-color: var(--primary-green); background-color: var(--light-green); } .checkbox-input:checked + .checkbox-label .checkbox-custom { border-color: var(--primary-blue); } .form-section:nth-child(even) .checkbox-input:checked + .checkbox-label .checkbox-custom { border-color: var(--primary-green); } .checkbox-input:checked + .checkbox-label .checkbox-custom::after { width: 14px; height: 14px; } .checkbox-input:focus + .checkbox-label { outline: none; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3); } .form-section:nth-child(even) .checkbox-input:focus + .checkbox-label { box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.3); } .checkbox-text { font-size: 14px; line-height: 1.4; flex: 1; } .form-buttons { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--light-gray); } .btn { background: var(--primary-blue); color: var(--white); border: none; padding: 12px 25px; border-radius: 6px; cursor: pointer; font-size: 15px; font-weight: 500; transition: var(--transition); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); display: flex; align-items: center; } .btn-reset { background: var(--light-gray); color: var(--dark-gray); } .btn:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); } .btn:active { transform: translateY(0); } .btn .icon { margin-right: 8px; } .progress-container { height: 6px; width: 100%; background: var(--light-gray); margin-top: 10px; border-radius: 3px; overflow: hidden; } .progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary-blue), var(--primary-green)); transition: width 0.5s ease; } /* Animations */ @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } } @keyframes slideInUp { 0% { transform: translateY(20px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } } .form-section { animation: slideInUp 0.6s forwards; } .form-section:nth-child(1) { animation-delay: 0.1s; } .form-section:nth-child(2) { animation-delay: 0.2s; } .form-section:nth-child(3) { animation-delay: 0.3s; } .form-section:nth-child(4) { animation-delay: 0.4s; } .checkbox-input:checked + .checkbox-label .checkbox-custom { animation: pulse 0.3s; } /* Tooltip */ .tooltip { position: absolute; background: var(--dark-gray); color: var(--white); padding: 8px 12px; border-radius: 6px; font-size: 12px; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-10px); opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s; width: max-content; max-width: 200px; z-index: 10; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); } .tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border-width: 6px; border-style: solid; border-color: var(--dark-gray) transparent transparent transparent; } .checkbox-container:hover .tooltip { opacity: 1; transform: translateX(-50%) translateY(-5px); } /* Custom scrollbar */ .form-content::-webkit-scrollbar { width: 8px; } .form-content::-webkit-scrollbar-track { background: var(--light-gray); border-radius: 10px; } .form-content::-webkit-scrollbar-thumb { background: var(--gray); border-radius: 10px; } .form-content::-webkit-scrollbar-thumb:hover { background: var(--dark-gray); } /* Mobile adjustments */ @media (max-width: 600px) { .checkbox-group { grid-template-columns: 1fr; } .form-content { padding: 20px; } .form-header { padding: 15px 20px; } .form-header h1 { font-size: 20px; } .form-buttons { flex-direction: column; gap: 10px; } .btn { width: 100%; justify-content: center; } } /* Form completion animation */ .completion-animation { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.9); display: flex; justify-content: center; align-items: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s; } .completion-animation.show { opacity: 1; pointer-events: auto; } .checkmark { width: 80px; height: 80px; border-radius: 50%; display: block; stroke-width: 2; stroke: var(--white); stroke-miterlimit: 10; box-shadow: 0 0 0 var(--primary-green); animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both; position: relative; margin: 0 auto; } .checkmark__circle { stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 2; stroke-miterlimit: 10; stroke: var(--primary-green); fill: none; animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards; } .checkmark__check { transform-origin: 50% 50%; stroke-dasharray: 48; stroke-dashoffset: 48; animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards; } @keyframes stroke { 100% { stroke-dashoffset: 0; } } @keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.1, 1.1, 1); } } @keyframes fill { 100% { box-shadow: 0 0 0 30px var(--light-green); } } </style> </head> <body> <div class="patient-form"> <div class="form-header"> <h1>Patient Health Assessment</h1> <p>Please complete all relevant sections to help us provide you with the best care.</p> <div class="progress-container"> <div class="progress-bar" id="progress-bar"></div> </div> </div> <div class="form-content"> <div class="form-section"> <h2> <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#3498db" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path> <rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect> </svg> </span> Current Symptoms </h2> <div class="checkbox-group"> <div class="checkbox-container"> <input type="checkbox" id="symptom1" class="checkbox-input"> <label for="symptom1" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Fever or chills</span> </label> <div class="tooltip">Temperature above 100.4°F (38°C) or feeling unusually cold</div> </div> <div class="checkbox-container"> <input type="checkbox" id="symptom2" class="checkbox-input"> <label for="symptom2" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Persistent cough</span> </label> <div class="tooltip">Cough that has lasted for more than 1 week</div> </div> <div class="checkbox-container"> <input type="checkbox" id="symptom3" class="checkbox-input"> <label for="symptom3" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Shortness of breath</span> </label> <div class="tooltip">Difficulty breathing or catching your breath</div> </div> <div class="checkbox-container"> <input type="checkbox" id="symptom4" class="checkbox-input"> <label for="symptom4" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Fatigue</span> </label> <div class="tooltip">Feeling unusually tired or exhausted</div> </div> <div class="checkbox-container"> <input type="checkbox" id="symptom5" class="checkbox-input"> <label for="symptom5" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Muscle/body aches</span> </label> <div class="tooltip">Pain or soreness in muscles not related to exercise</div> </div> <div class="checkbox-container"> <input type="checkbox" id="symptom6" class="checkbox-input"> <label for="symptom6" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Headache</span> </label> <div class="tooltip">Pain in any region of the head</div> </div> </div> </div> <div class="form-section"> <h2> <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#2ecc71" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M20.42 4.58a5.4 5.4 0 0 0-7.65 0l-.77.78-.77-.78a5.4 5.4 0 0 0-7.65 0C1.46 6.7 1.33 10.28 4 13l8 8 8-8c2.67-2.72 2.54-6.3.42-8.42z"></path> </svg> </span> Medical History </h2> <div class="checkbox-group"> <div class="checkbox-container"> <input type="checkbox" id="history1" class="checkbox-input"> <label for="history1" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Hypertension</span> </label> <div class="tooltip">High blood pressure diagnosed by a healthcare provider</div> </div> <div class="checkbox-container"> <input type="checkbox" id="history2" class="checkbox-input"> <label for="history2" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Diabetes</span> </label> <div class="tooltip">Type 1, Type 2, or gestational diabetes</div> </div> <div class="checkbox-container"> <input type="checkbox" id="history3" class="checkbox-input"> <label for="history3" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Heart disease</span> </label> <div class="tooltip">Any condition affecting your heart including arrhythmia, prior heart attack</div> </div> <div class="checkbox-container"> <input type="checkbox" id="history4" class="checkbox-input"> <label for="history4" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Respiratory disease</span> </label> <div class="tooltip">Such as asthma, COPD, or emphysema</div> </div> <div class="checkbox-container"> <input type="checkbox" id="history5" class="checkbox-input"> <label for="history5" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Autoimmune disorder</span> </label> <div class="tooltip">Such as lupus, rheumatoid arthritis, or multiple sclerosis</div> </div> <div class="checkbox-container"> <input type="checkbox" id="history6" class="checkbox-input"> <label for="history6" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Cancer</span> </label> <div class="tooltip">Current or previous diagnosis of any type of cancer</div> </div> </div> </div> <div class="form-section"> <h2> <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#3498db" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <circle cx="12" cy="12" r="10"></circle> <line x1="12" y1="8" x2="12" y2="16"></line> <line x1="8" y1="12" x2="16" y2="12"></line> </svg> </span> Medications & Allergies </h2> <div class="checkbox-group"> <div class="checkbox-container"> <input type="checkbox" id="med1" class="checkbox-input"> <label for="med1" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Blood pressure medication</span> </label> <div class="tooltip">Currently taking medication to control blood pressure</div> </div> <div class="checkbox-container"> <input type="checkbox" id="med2" class="checkbox-input"> <label for="med2" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Anticoagulants</span> </label> <div class="tooltip">Blood thinners such as warfarin, apixaban, or aspirin</div> </div> <div class="checkbox-container"> <input type="checkbox" id="med3" class="checkbox-input"> <label for="med3" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Insulin or oral diabetic medication</span> </label> <div class="tooltip">Medication to control blood sugar levels</div> </div> <div class="checkbox-container"> <input type="checkbox" id="allergy1" class="checkbox-input"> <label for="allergy1" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Penicillin allergy</span> </label> <div class="tooltip">Allergic to penicillin or related antibiotics</div> </div> <div class="checkbox-container"> <input type="checkbox" id="allergy2" class="checkbox-input"> <label for="allergy2" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">NSAID allergy</span> </label> <div class="tooltip">Allergy to aspirin, ibuprofen, or similar pain relievers</div> </div> <div class="checkbox-container"> <input type="checkbox" id="allergy3" class="checkbox-input"> <label for="allergy3" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Contrast dye sensitivity</span> </label> <div class="tooltip">Reaction to contrast agents used in imaging procedures</div> </div> </div> </div> <div class="form-section"> <h2> <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#2ecc71" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M18 8h1a4 4 0 0 1 0 8h-1"></path> <path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z"></path> <line x1="6" y1="1" x2="6" y2="4"></line> <line x1="10" y1="1" x2="10" y2="4"></line> <line x1="14" y1="1" x2="14" y2="4"></line> </svg> </span> Lifestyle & Preventive Health </h2> <div class="checkbox-group"> <div class="checkbox-container"> <input type="checkbox" id="lifestyle1" class="checkbox-input"> <label for="lifestyle1" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Current tobacco use</span> </label> <div class="tooltip">Cigarettes, e-cigarettes, cigars, pipes, or smokeless tobacco</div> </div> <div class="checkbox-container"> <input type="checkbox" id="lifestyle2" class="checkbox-input"> <label for="lifestyle2" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Regular alcohol consumption</span> </label> <div class="tooltip">More than 1 drink per day for women or 2 for men</div> </div> <div class="checkbox-container"> <input type="checkbox" id="lifestyle3" class="checkbox-input"> <label for="lifestyle3" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Regular exercise</span> </label> <div class="tooltip">At least 150 minutes per week of moderate-intensity activity</div> </div> <div class="checkbox-container"> <input type="checkbox" id="preventive1" class="checkbox-input"> <label for="preventive1" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Flu shot this season</span> </label> <div class="tooltip">Received influenza vaccination in the past year</div> </div> <div class="checkbox-container"> <input type="checkbox" id="preventive2" class="checkbox-input"> <label for="preventive2" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">COVID-19 vaccination</span> </label> <div class="tooltip">Received full course of COVID-19 vaccination</div> </div> <div class="checkbox-container"> <input type="checkbox" id="preventive3" class="checkbox-input"> <label for="preventive3" class="checkbox-label"> <span class="checkbox-custom"></span> <span class="checkbox-text">Recent physical exam</span> </label> <div class="tooltip">Complete physical check-up in the last 12 months</div> </div> </div> </div> <div class="form-buttons"> <button class="btn btn-reset" id="reset-form"> <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M23 4v6h-6"></path> <path d="M1 20v-6h6"></path> <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10"></path> <path d="M20.49 15a9 9 0 0 1-14.85 3.36L1 14"></path> </svg> </span> Reset Form </button> <button class="btn" id="submit-form"> <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <line x1="22" y1="2" x2="11" y2="13"></line> <polygon points="22 2 15 22 11 13 2 9 22 2"></polygon> </svg> </span> Submit Assessment </button> </div> </div> </div> <div class="completion-animation" id="completion-animation"> <div class="success-animation"> <svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52"> <circle class="checkmark__circle" cx="26" cy="26" r="25" fill="none"/> <path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/> </svg> <p style="text-align: center; margin-top: 20px; color: #2ecc71; font-weight: 500;">Assessment submitted successfully!</p> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const checkboxes = document.querySelectorAll('.checkbox-input'); const progressBar = document.getElementById('progress-bar'); const resetButton = document.getElementById('reset-form'); const submitButton = document.getElementById('submit-form'); const completionAnimation = document.getElementById('completion-animation'); // Update progress bar when checkboxes are clicked function updateProgressBar() { const totalCheckboxes = checkboxes.length; const checkedCheckboxes = document.querySelectorAll('.checkbox-input:checked').length; const progressPercentage = (checkedCheckboxes / totalCheckboxes) * 100; progressBar.style.width = `${progressPercentage}%`; } // Add click event to each checkbox checkboxes.forEach(checkbox => { checkbox.addEventListener('change', function() { updateProgressBar(); // Add ripple effect on check if (this.checked) { const label = this.nextElementSibling; const checkboxCustom = label.querySelector('.checkbox-custom'); // Create ripple element const ripple = document.createElement('span'); ripple.classList.add('ripple'); ripple.style.width = '40px'; ripple.style.height = '40px'; ripple.style.position = 'absolute'; ripple.style.borderRadius = '50%'; ripple.style.transform = 'translate(-50%, -50%)'; ripple.style.backgroundColor = 'rgba(255, 255, 255, 0.6)'; ripple.style.animation = 'ripple 0.6s linear'; ripple.style.pointerEvents = 'none'; checkboxCustom.appendChild(ripple); // Remove ripple after animation setTimeout(() => { ripple.remove(); }, 600); } }); }); // Reset form resetButton.addEventListener('click', function() { checkboxes.forEach(checkbox => { checkbox.checked = false; }); updateProgressBar(); // Add button press animation this.style.transform = 'scale(0.95)'; setTimeout(() => { this.style.transform = 'none'; }, 100); }); // Submit form submitButton.addEventListener('click', function() { // Add button press animation this.style.transform = 'scale(0.95)'; setTimeout(() => { this.style.transform = 'none'; }, 100); // Show completion animation completionAnimation.classList.add('show'); // Hide completion animation after 2 seconds setTimeout(() => { completionAnimation.classList.remove('show'); }, 2000); // Simulate form submission (in a real app, this would send data to server) console.log('Form submitted'); }); // Initialize progress bar updateProgressBar(); // Add keydown event for accessibility document.addEventListener('keydown', function(e) { if (e.key === 'Enter') { const focusedElement = document.activeElement; if (focusedElement.classList.contains('checkbox-label')) { const checkbox = document.getElementById(focusedElement.getAttribute('for')); checkbox.checked = !checkbox.checked; checkbox.dispatchEvent(new Event('change')); } } }); // Checkbox "click" animation with a little bounce document.querySelectorAll('.checkbox-custom').forEach(checkbox => { checkbox.addEventListener('click', function(e) { // Prevent the default checkbox behavior e.preventDefault(); // Manually toggle the checkbox const label = this.parentElement; const checkboxId = label.getAttribute('for'); const checkbox = document.getElementById(checkboxId); checkbox.checked = !checkbox.checked; checkbox.dispatchEvent(new Event('change')); }); }); // Add subtle hover animation to form sections document.querySelectorAll('.form-section').forEach(section => { section.addEventListener('mouseenter', function() { this.style.transform = 'translateY(-2px)'; this.style.transition = 'transform 0.3s ease'; }); section.addEventListener('mouseleave', function() { this.style.transform = 'translateY(0)'; }); }); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>E-commerce Filters</title> <style> :root { --primary: #5465ff; --primary-dark: #4255ee; --secondary: #ff7b54; --light: #f9f9f9; --dark: #2d3142; --gray: #bfc0c0; --success: #00b894; --price-low: #00cec9; --price-mid: #fdcb6e; --price-high: #e17055; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } body { background-color: var(--light); color: var(--dark); display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; } .filter-container { width: 100%; max-width: 650px; background-color: white; border-radius: 16px; box-shadow: 0 10px 30px rgba(45, 49, 66, 0.08); padding: 32px; position: relative; overflow: hidden; } .filter-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; position: relative; } .filter-title { font-size: 24px; font-weight: 700; position: relative; } .filter-title::after { content: ''; position: absolute; width: 40px; height: 4px; background-color: var(--secondary); bottom: -8px; left: 0; border-radius: 2px; } .reset-btn { background-color: transparent; color: var(--primary); border: none; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 5px; opacity: 0; transform: translateY(10px); pointer-events: none; } .reset-btn.visible { opacity: 1; transform: translateY(0); pointer-events: all; } .reset-btn:hover { color: var(--primary-dark); } .reset-btn .icon { display: inline-block; transition: transform 0.3s ease; } .reset-btn:hover .icon { transform: rotate(90deg); } .filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px; } .filter-group { margin-bottom: 20px; } .filter-group-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; } .filter-group-title .icon { color: var(--primary); font-size: 18px; } .checkbox-list { display: flex; flex-direction: column; gap: 14px; } .checkbox-wrapper { display: flex; align-items: center; position: relative; } .checkbox-wrapper input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; } .checkmark { position: relative; height: 22px; width: 22px; border: 2px solid var(--gray); border-radius: 6px; transition: all 0.2s ease; margin-right: 12px; cursor: pointer; display: flex; justify-content: center; align-items: center; } .checkbox-wrapper:hover .checkmark { border-color: var(--primary); transform: scale(1.05); box-shadow: 0 0 0 3px rgba(84, 101, 255, 0.1); } .checkbox-wrapper input:checked ~ .checkmark { background-color: var(--primary); border-color: var(--primary); } .checkmark:after { content: ""; position: absolute; display: none; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); top: 4px; } .checkbox-wrapper input:checked ~ .checkmark:after { display: block; } .checkbox-label { font-size: 15px; user-select: none; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: space-between; width: 100%; } .checkbox-wrapper:hover .checkbox-label { color: var(--primary); } .count { background-color: var(--light); border-radius: 20px; padding: 3px 8px; font-size: 12px; font-weight: 600; color: var(--dark); transition: all 0.2s ease; } .checkbox-wrapper input:checked ~ .checkbox-label .count { background-color: var(--primary-dark); color: white; } .price-filters { display: flex; flex-direction: column; gap: 14px; } .price-badge { display: inline-flex; align-items: center; background-color: var(--light); border-radius: 20px; padding: 3px 10px; font-size: 13px; transition: all 0.2s ease; margin-left: 6px; } .low-price { color: var(--price-low); } .mid-price { color: var(--price-mid); } .high-price { color: var(--price-high); } .filter-footer { margin-top: 30px; display: flex; justify-content: space-between; align-items: center; } .apply-btn { background-color: var(--primary); color: white; border: none; padding: 12px 24px; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 8px; } .apply-btn:hover { background-color: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(84, 101, 255, 0.25); } .apply-btn:active { transform: translateY(0); box-shadow: none; } .filter-bubble { display: inline-flex; align-items: center; background-color: var(--primary); color: white; font-size: 14px; padding: 8px 12px; border-radius: 20px; margin-right: 8px; margin-bottom: 8px; animation: bubbleIn 0.3s ease forwards; cursor: pointer; } .filter-bubble span { margin-right: 5px; } .filter-bubble .remove { font-size: 18px; margin-left: 5px; transition: transform 0.2s ease; } .filter-bubble:hover .remove { transform: rotate(90deg); } .selected-filters { display: flex; flex-wrap: wrap; margin-top: 5px; height: 0; overflow: hidden; transition: height 0.3s ease; } .selected-filters.visible { height: auto; margin-bottom: 15px; } .results-count { font-size: 15px; color: var(--dark); } .highlight { font-weight: 700; color: var(--success); } @keyframes bubbleIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } } @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(84, 101, 255, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(84, 101, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(84, 101, 255, 0); } } .pulse { animation: pulse 1.5s infinite; } @media (max-width: 640px) { .filter-container { padding: 24px; } .filter-grid { grid-template-columns: 1fr; gap: 15px; } } </style> </head> <body> <div class="filter-container"> <div class="filter-header"> <h2 class="filter-title">Refine Results</h2> <button class="reset-btn"> Clear all <span class="icon">↺</span> </button> </div> <div class="selected-filters"> <!-- Selected filters will appear here --> </div> <div class="filter-grid"> <div class="filter-section"> <div class="filter-group"> <h3 class="filter-group-title"> <span class="icon">⚙️</span> Categories </h3> <div class="checkbox-list"> <label class="checkbox-wrapper"> <input type="checkbox" name="category" value="Electronics"> <span class="checkmark"></span> <span class="checkbox-label">Electronics <span class="count">247</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="category" value="Home & Kitchen"> <span class="checkmark"></span> <span class="checkbox-label">Home & Kitchen <span class="count">183</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="category" value="Fashion"> <span class="checkmark"></span> <span class="checkbox-label">Fashion <span class="count">419</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="category" value="Books"> <span class="checkmark"></span> <span class="checkbox-label">Books <span class="count">156</span></span> </label> </div> </div> <div class="filter-group"> <h3 class="filter-group-title"> <span class="icon">💰</span> Price Range </h3> <div class="checkbox-list price-filters"> <label class="checkbox-wrapper"> <input type="checkbox" name="price" value="Under $25"> <span class="checkmark"></span> <span class="checkbox-label">Under $25 <span class="price-badge low-price">$</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="price" value="$25 - $50"> <span class="checkmark"></span> <span class="checkbox-label">$25 - $50 <span class="price-badge low-price">$$</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="price" value="$50 - $100"> <span class="checkmark"></span> <span class="checkbox-label">$50 - $100 <span class="price-badge mid-price">$$$</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="price" value="$100+"> <span class="checkmark"></span> <span class="checkbox-label">$100+ <span class="price-badge high-price">$$$$</span></span> </label> </div> </div> </div> <div class="filter-section"> <div class="filter-group"> <h3 class="filter-group-title"> <span class="icon">⭐</span> Ratings </h3> <div class="checkbox-list"> <label class="checkbox-wrapper"> <input type="checkbox" name="rating" value="4+ Stars"> <span class="checkmark"></span> <span class="checkbox-label">4+ Stars <span class="count">389</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="rating" value="3+ Stars"> <span class="checkmark"></span> <span class="checkbox-label">3+ Stars <span class="count">542</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="rating" value="2+ Stars"> <span class="checkmark"></span> <span class="checkbox-label">2+ Stars <span class="count">628</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="rating" value="1+ Stars"> <span class="checkmark"></span> <span class="checkbox-label">1+ Stars <span class="count">731</span></span> </label> </div> </div> <div class="filter-group"> <h3 class="filter-group-title"> <span class="icon">🚚</span> Shipping </h3> <div class="checkbox-list"> <label class="checkbox-wrapper"> <input type="checkbox" name="shipping" value="Free Shipping"> <span class="checkmark"></span> <span class="checkbox-label">Free Shipping <span class="count">342</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="shipping" value="Same Day"> <span class="checkmark"></span> <span class="checkbox-label">Same Day <span class="count">87</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="shipping" value="Next Day"> <span class="checkmark"></span> <span class="checkbox-label">Next Day <span class="count">156</span></span> </label> <label class="checkbox-wrapper"> <input type="checkbox" name="shipping" value="2-Day"> <span class="checkmark"></span> <span class="checkbox-label">2-Day <span class="count">298</span></span> </label> </div> </div> </div> </div> <div class="filter-footer"> <div class="results-count">Showing <span class="highlight">731</span> products</div> <button class="apply-btn pulse"> Apply Filters <span>→</span> </button> </div> </div> <script> document.addEventListener('DOMContentLoaded', () => { const checkboxes = document.querySelectorAll('input[type="checkbox"]'); const resetBtn = document.querySelector('.reset-btn'); const selectedFilters = document.querySelector('.selected-filters'); const applyBtn = document.querySelector('.apply-btn'); const resultsCount = document.querySelector('.results-count .highlight'); // Initial count let totalProducts = 731; let selectedCount = 0; // Track selected filters const filterState = { category: [], price: [], rating: [], shipping: [] }; // Update UI based on selections function updateUI() { // Clear selected filters display selectedFilters.innerHTML = ''; // Count total selected filters selectedCount = 0; for (const key in filterState) { selectedCount += filterState[key].length; } // Show/hide reset button and selected filters area if (selectedCount > 0) { resetBtn.classList.add('visible'); selectedFilters.classList.add('visible'); // Add filter bubbles for (const key in filterState) { filterState[key].forEach(value => { const bubble = document.createElement('div'); bubble.className = 'filter-bubble'; bubble.innerHTML = `<span>${value}</span><span class="remove">×</span>`; bubble.addEventListener('click', () => { // Find and uncheck the corresponding checkbox checkboxes.forEach(checkbox => { if (checkbox.name === key && checkbox.value === value) { checkbox.checked = false; updateFilterState(checkbox); } }); }); selectedFilters.appendChild(bubble); }); } // Update product count (simple simulation) const newCount = Math.max(50, totalProducts - (selectedCount * 85)); resultsCount.textContent = newCount; // Make the Apply button pulse applyBtn.classList.add('pulse'); } else { resetBtn.classList.remove('visible'); selectedFilters.classList.remove('visible'); resultsCount.textContent = totalProducts; applyBtn.classList.remove('pulse'); } } // Update the filter state when a checkbox changes function updateFilterState(checkbox) { const { name, value, checked } = checkbox; if (checked) { // Add to filter state if not already there if (!filterState[name].includes(value)) { filterState[name].push(value); } } else { // Remove from filter state const index = filterState[name].indexOf(value); if (index > -1) { filterState[name].splice(index, 1); } } updateUI(); } // Add event listeners to checkboxes checkboxes.forEach(checkbox => { checkbox.addEventListener('change', () => { updateFilterState(checkbox); }); }); // Reset all filters resetBtn.addEventListener('click', () => { checkboxes.forEach(checkbox => { checkbox.checked = false; }); for (const key in filterState) { filterState[key] = []; } updateUI(); }); // Apply button click applyBtn.addEventListener('click', () => { applyBtn.classList.remove('pulse'); // Simulate a successful filter application applyBtn.textContent = "Filters Applied ✓"; applyBtn.style.backgroundColor = "var(--success)"; setTimeout(() => { applyBtn.innerHTML = 'Apply Filters <span>→</span>'; applyBtn.style.backgroundColor = ""; }, 1500); }); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> :root { --primary-color: #6d5dfc; --secondary-color: #ff6b6b; --accent-color: #2ecc71; --neutral-light: #f8f9fa; --neutral-dark: #343a40; --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; } body { background-color: var(--neutral-light); display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; overflow-x: hidden; } .survey-container { background: white; border-radius: 16px; box-shadow: var(--box-shadow); width: 100%; max-width: 600px; padding: 32px; position: relative; overflow: hidden; } .survey-container::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)); } .survey-header { margin-bottom: 28px; position: relative; } .survey-title { font-size: 24px; color: var(--neutral-dark); font-weight: 700; margin-bottom: 8px; } .survey-description { font-size: 15px; color: rgba(52, 58, 64, 0.8); line-height: 1.5; } .survey-step { font-size: 13px; color: var(--primary-color); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 1px; } .checkbox-question { margin-bottom: 24px; opacity: 0; transform: translateY(20px); transition: var(--transition); } .checkbox-question.visible { opacity: 1; transform: translateY(0); } .question-text { font-size: 17px; font-weight: 600; color: var(--neutral-dark); margin-bottom: 16px; } .checkbox-group { display: grid; grid-template-columns: 1fr; gap: 12px; } .checkbox-option { position: relative; cursor: pointer; user-select: none; } .checkbox-option input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; } .checkbox-custom { position: relative; display: flex; align-items: center; padding: 12px 16px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.1); background-color: white; transition: var(--transition); } .checkbox-option:hover .checkbox-custom { background-color: rgba(109, 93, 252, 0.05); border-color: rgba(109, 93, 252, 0.3); transform: translateY(-2px); } .checkbox-mark { min-width: 22px; height: 22px; border: 2px solid rgba(0, 0, 0, 0.2); border-radius: 4px; margin-right: 12px; display: flex; justify-content: center; align-items: center; transition: var(--transition); position: relative; overflow: hidden; } .checkbox-option input:checked ~ .checkbox-custom { border-color: var(--primary-color); background-color: rgba(109, 93, 252, 0.05); } .checkbox-option input:checked ~ .checkbox-custom .checkbox-mark { background-color: var(--primary-color); border-color: var(--primary-color); } .checkbox-checkmark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); opacity: 0; color: white; font-size: 14px; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); } .checkbox-option input:checked ~ .checkbox-custom .checkbox-mark .checkbox-checkmark { opacity: 1; transform: translate(-50%, -50%) scale(1); } .checkbox-label { font-size: 15px; color: var(--neutral-dark); } .survey-actions { display: flex; justify-content: space-between; margin-top: 32px; } .btn { padding: 10px 24px; border-radius: 8px; border: none; font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; } .btn-back { background-color: transparent; color: var(--neutral-dark); } .btn-back:hover { background-color: rgba(0, 0, 0, 0.05); } .btn-next { background-color: var(--primary-color); color: white; } .btn-next:hover { background-color: #5a4ad9; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(109, 93, 252, 0.3); } .btn-submit { background-color: var(--accent-color); color: white; display: none; } .btn-submit:hover { background-color: #27ae60; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3); } .btn-icon { margin-left: 8px; } .progress-container { position: relative; height: 4px; background-color: rgba(0, 0, 0, 0.05); border-radius: 4px; margin-top: 32px; overflow: hidden; } .progress-bar { position: absolute; top: 0; left: 0; height: 100%; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)); transition: width 0.4s ease; width: 0%; } .confirmation { display: none; text-align: center; animation: fadeIn 0.6s ease; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } } .confirmation-icon { width: 80px; height: 80px; background-color: var(--accent-color); border-radius: 50%; display: flex; justify-content: center; align-items: center; margin: 0 auto 24px; color: white; font-size: 40px; animation: pulse 2s infinite; } .confirmation-title { font-size: 24px; font-weight: 700; color: var(--neutral-dark); margin-bottom: 16px; } .confirmation-text { font-size: 16px; color: rgba(52, 58, 64, 0.8); margin-bottom: 32px; line-height: 1.5; } /* Responsive adjustments */ @media (max-width: 600px) { .survey-container { padding: 24px; border-radius: 12px; } .checkbox-group { gap: 8px; } .checkbox-custom { padding: 10px 12px; } .survey-title { font-size: 20px; } .question-text { font-size: 16px; } .checkbox-label { font-size: 14px; } .btn { padding: 8px 16px; font-size: 14px; } } /* Animations */ .ripple { position: absolute; border-radius: 50%; background-color: rgba(255, 255, 255, 0.7); transform: scale(0); animation: ripple 0.6s linear; pointer-events: none; } @keyframes ripple { to { transform: scale(2.5); opacity: 0; } } </style> </head> <body> <div class="survey-container"> <div class="survey-form"> <div class="survey-header"> <div class="survey-step">Product Experience Survey</div> <h1 class="survey-title">Help us improve your workflow</h1> <p class="survey-description">Your feedback helps us refine our tools and create better experiences. This will take less than 2 minutes.</p> </div> <div class="checkbox-question visible" data-question="1"> <p class="question-text">Which features do you use most frequently?</p> <div class="checkbox-group"> <label class="checkbox-option"> <input type="checkbox" name="feature" value="dashboard"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Analytics dashboard</span> </div> </label> <label class="checkbox-option"> <input type="checkbox" name="feature" value="reporting"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Automated reporting</span> </div> </label> <label class="checkbox-option"> <input type="checkbox" name="feature" value="collaboration"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Team collaboration tools</span> </div> </label> <label class="checkbox-option"> <input type="checkbox" name="feature" value="integration"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Third-party integrations</span> </div> </label> </div> </div> <div class="checkbox-question" data-question="2"> <p class="question-text">What aspects could be improved?</p> <div class="checkbox-group"> <label class="checkbox-option"> <input type="checkbox" name="improvement" value="speed"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Performance speed</span> </div> </label> <label class="checkbox-option"> <input type="checkbox" name="improvement" value="interface"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">User interface design</span> </div> </label> <label class="checkbox-option"> <input type="checkbox" name="improvement" value="features"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Feature availability</span> </div> </label> <label class="checkbox-option"> <input type="checkbox" name="improvement" value="documentation"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Documentation & help resources</span> </div> </label> </div> </div> <div class="checkbox-question" data-question="3"> <p class="question-text">What additional features would you like to see?</p> <div class="checkbox-group"> <label class="checkbox-option"> <input type="checkbox" name="additional" value="mobile"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Enhanced mobile experience</span> </div> </label> <label class="checkbox-option"> <input type="checkbox" name="additional" value="ai"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">AI-powered insights</span> </div> </label> <label class="checkbox-option"> <input type="checkbox" name="additional" value="customization"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Advanced customization options</span> </div> </label> <label class="checkbox-option"> <input type="checkbox" name="additional" value="offline"> <div class="checkbox-custom"> <div class="checkbox-mark"> <span class="checkbox-checkmark">✓</span> </div> <span class="checkbox-label">Offline functionality</span> </div> </label> </div> </div> <div class="survey-actions"> <button class="btn btn-back" id="btnBack" style="display: none;">Back</button> <button class="btn btn-next" id="btnNext"> Next <span class="btn-icon">→</span> </button> <button class="btn btn-submit" id="btnSubmit"> Submit Feedback <span class="btn-icon">✓</span> </button> </div> <div class="progress-container"> <div class="progress-bar" id="progressBar"></div> </div> </div> <div class="confirmation" id="confirmation"> <div class="confirmation-icon">✓</div> <h2 class="confirmation-title">Thank you for your feedback!</h2> <p class="confirmation-text">Your insights are invaluable to us. We'll use your feedback to improve our product experience and prioritize upcoming features.</p> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const questions = document.querySelectorAll('.checkbox-question'); const btnNext = document.getElementById('btnNext'); const btnBack = document.getElementById('btnBack'); const btnSubmit = document.getElementById('btnSubmit'); const progressBar = document.getElementById('progressBar'); const surveyForm = document.querySelector('.survey-form'); const confirmation = document.getElementById('confirmation'); let currentQuestionIndex = 0; const totalQuestions = questions.length; // Initialize progress bar updateProgressBar(); // Show ripple effect on button clicks const addRippleEffect = (event) => { const button = event.currentTarget; const ripple = document.createElement('span'); const rect = button.getBoundingClientRect(); const size = Math.max(rect.width, rect.height); const x = event.clientX - rect.left - size / 2; const y = event.clientY - rect.top - size / 2; ripple.style.width = ripple.style.height = `${size}px`; ripple.style.left = `${x}px`; ripple.style.top = `${y}px`; ripple.classList.add('ripple'); button.appendChild(ripple); setTimeout(() => { ripple.remove(); }, 600); }; btnNext.addEventListener('click', function(e) { addRippleEffect(e); if (currentQuestionIndex < totalQuestions - 1) { questions[currentQuestionIndex].classList.remove('visible'); currentQuestionIndex++; setTimeout(() => { questions[currentQuestionIndex].classList.add('visible'); updateButtonsVisibility(); updateProgressBar(); }, 300); } }); btnBack.addEventListener('click', function(e) { addRippleEffect(e); if (currentQuestionIndex > 0) { questions[currentQuestionIndex].classList.remove('visible'); currentQuestionIndex--; setTimeout(() => { questions[currentQuestionIndex].classList.add('visible'); updateButtonsVisibility(); updateProgressBar(); }, 300); } }); btnSubmit.addEventListener('click', function(e) { addRippleEffect(e); // Gather all checked values for analytics (not actually submitted in this demo) const selections = {}; document.querySelectorAll('input[type="checkbox"]:checked').forEach(checkbox => { const name = checkbox.name; const value = checkbox.value; if (!selections[name]) { selections[name] = []; } selections[name].push(value); }); console.log('Form data (for demo purposes only):', selections); // Show confirmation screen surveyForm.style.display = 'none'; confirmation.style.display = 'block'; }); // Add animation to checkboxes document.querySelectorAll('.checkbox-option').forEach(option => { option.addEventListener('click', function() { const checkbox = this.querySelector('input[type="checkbox"]'); // Add a small delay to make the animation visible even when clicking on the label setTimeout(() => { if (checkbox.checked) { this.querySelector('.checkbox-mark').classList.add('checked'); } else { this.querySelector('.checkbox-mark').classList.remove('checked'); } }, 10); }); }); function updateButtonsVisibility() { if (currentQuestionIndex === 0) { btnBack.style.display = 'none'; } else { btnBack.style.display = 'inline-flex'; } if (currentQuestionIndex === totalQuestions - 1) { btnNext.style.display = 'none'; btnSubmit.style.display = 'inline-flex'; } else { btnNext.style.display = 'inline-flex'; btnSubmit.style.display = 'none'; } } function updateProgressBar() { const progress = ((currentQuestionIndex + 1) / totalQuestions) * 100; progressBar.style.width = `${progress}%`; } }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> :root { --primary-color: #6200ee; --primary-light: #bb86fc; --primary-dark: #3700b3; --secondary-color: #03dac6; --secondary-dark: #018786; --error-color: #b00020; --background: #fafafa; --surface: #ffffff; --on-primary: #ffffff; --on-secondary: #000000; --on-background: #000000; --on-surface: #000000; --on-error: #ffffff; --primary-shadow: rgba(98, 0, 238, 0.2); } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background-color: var(--background); color: var(--on-background); display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 1rem; transition: background-color 0.3s ease; } .task-manager { width: 100%; max-width: 600px; background-color: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08); position: relative; transform: translateZ(0); } .header { padding: 1.5rem; background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: var(--on-primary); position: relative; overflow: hidden; } .header h1 { margin-bottom: 0.5rem; font-weight: 600; font-size: 1.75rem; position: relative; z-index: 1; } .header p { opacity: 0.9; margin-bottom: 1rem; position: relative; z-index: 1; font-weight: 300; } .header-pattern { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-image: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 20%), radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 20%); z-index: 0; } .task-input-container { display: flex; background: white; margin: -25px 1rem 0; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); position: relative; z-index: 5; } .task-input { flex: 1; padding: 1rem; border: none; outline: none; font-size: 1rem; } .add-task-btn { background-color: var(--primary-color); color: var(--on-primary); border: none; padding: 0 1.25rem; cursor: pointer; transition: background-color 0.3s ease; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; } .add-task-btn:hover { background-color: var(--primary-dark); } .add-task-btn .ripple { position: absolute; background-color: rgba(255, 255, 255, 0.7); transform: scale(0); border-radius: 50%; animation: ripple 0.5s linear; } @keyframes ripple { to { transform: scale(2.5); opacity: 0; } } .tasks-container { padding: 2rem 1rem 1rem; max-height: 400px; overflow-y: auto; scrollbar-width: thin; } .tasks-container::-webkit-scrollbar { width: 6px; } .tasks-container::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.03); } .tasks-container::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.1); border-radius: 3px; } .task-item { display: flex; align-items: center; padding: 0.75rem; margin-bottom: 0.75rem; border-radius: 8px; background-color: white; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); transition: all 0.3s ease; position: relative; overflow: hidden; animation: slideIn 0.3s ease-out; } @keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .task-item:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); transform: translateY(-2px); } .task-checkbox { position: relative; appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin-right: 0.75rem; border: 2px solid var(--primary-color); border-radius: 4px; outline: none; cursor: pointer; transition: all 0.2s ease; flex-shrink: 0; } .task-checkbox:hover { background-color: var(--primary-shadow); } .task-checkbox:checked { background-color: var(--primary-color); border-color: var(--primary-color); } .task-checkbox:checked::after { content: ''; position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(45deg); width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; } .task-checkbox + .task-text { position: relative; cursor: pointer; user-select: none; flex: 1; transition: color 0.2s ease; } .task-checkbox:checked + .task-text { color: #9e9e9e; text-decoration: line-through; } .task-checkbox:checked + .task-text::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background-color: #9e9e9e; transform: scaleX(0); transform-origin: left; animation: strikeThrough 0.3s ease-out forwards; } @keyframes strikeThrough { from { transform: scaleX(0); } to { transform: scaleX(1); } } .delete-btn { background: transparent; border: none; color: #9e9e9e; cursor: pointer; opacity: 0; transition: all 0.2s ease; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; } .task-item:hover .delete-btn { opacity: 1; } .delete-btn:hover { background-color: rgba(176, 0, 32, 0.1); color: var(--error-color); } .ripple-container { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; } .task-stats { padding: 1rem; border-top: 1px solid rgba(0, 0, 0, 0.05); display: flex; justify-content: space-between; align-items: center; color: #757575; font-size: 0.875rem; } .progress-container { height: 4px; background-color: rgba(0, 0, 0, 0.05); border-radius: 2px; overflow: hidden; margin: 0.5rem 0; } .progress-bar { height: 100%; background-color: var(--secondary-color); width: 0%; transition: width 0.5s ease; } .filters { display: flex; gap: 0.5rem; } .filter-btn { background: transparent; border: none; padding: 0.25rem 0.5rem; border-radius: 4px; cursor: pointer; color: #757575; transition: all 0.2s ease; } .filter-btn.active { background-color: var(--primary-shadow); color: var(--primary-color); font-weight: 500; } .priority-indicator { width: 4px; position: absolute; left: 0; top: 0; bottom: 0; background-color: transparent; } .priority-high { background-color: #f44336; } .priority-medium { background-color: #ff9800; } .priority-low { background-color: #4caf50; } .no-tasks { text-align: center; padding: 2rem; color: #9e9e9e; font-style: italic; } .quick-add { position: absolute; bottom: 4.5rem; right: 1rem; width: 56px; height: 56px; border-radius: 50%; background-color: var(--secondary-color); color: var(--on-secondary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); cursor: pointer; transition: transform 0.2s ease, background-color 0.2s ease; z-index: 10; } .quick-add:hover { transform: scale(1.05); background-color: var(--secondary-dark); } .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: center; } .empty-state-icon { font-size: 3rem; color: #e0e0e0; margin-bottom: 1rem; } .empty-state-text { color: #9e9e9e; margin-bottom: 1.5rem; } .category-tag { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 10px; margin-left: 0.5rem; background-color: var(--primary-shadow); color: var(--primary-dark); } .task-item.completed { background-color: rgba(0, 0, 0, 0.02); } .task-date { font-size: 0.75rem; color: #9e9e9e; margin-left: auto; margin-right: 0.5rem; } /* Dark mode toggle */ .dark-mode-toggle { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--on-primary); cursor: pointer; z-index: 5; font-size: 1.25rem; } body.dark-mode { --background: #121212; --surface: #1e1e1e; --on-background: #e0e0e0; --on-surface: #e0e0e0; --primary-shadow: rgba(187, 134, 252, 0.2); } body.dark-mode .task-item { background-color: #2d2d2d; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); } body.dark-mode .task-input-container { background-color: #2d2d2d; } body.dark-mode .task-input { background-color: #2d2d2d; color: var(--on-surface); } body.dark-mode .task-item.completed { background-color: rgba(255, 255, 255, 0.05); } /* Responsive adjustments */ @media (max-width: 480px) { .header h1 { font-size: 1.5rem; } .task-input-container { margin: -20px 0.75rem 0; } .tasks-container { padding: 1.5rem 0.75rem 1rem; } .task-date { display: none; } .category-tag { font-size: 0.65rem; padding: 0.15rem 0.35rem; } .quick-add { width: 48px; height: 48px; bottom: 4rem; right: 0.75rem; } } .task-priority-dropdown { position: relative; margin-right: 0.5rem; } .priority-btn { background: none; border: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #757575; } .priority-btn:hover { background-color: rgba(0, 0, 0, 0.05); } .priority-dropdown { position: absolute; top: 100%; left: 0; background-color: white; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); width: 120px; display: none; z-index: 10; } body.dark-mode .priority-dropdown { background-color: #2d2d2d; } .priority-option { padding: 0.5rem; cursor: pointer; display: flex; align-items: center; } .priority-option:hover { background-color: rgba(0, 0, 0, 0.05); } .priority-color { width: 12px; height: 12px; border-radius: 50%; margin-right: 0.5rem; } .priority-color.high { background-color: #f44336; } .priority-color.medium { background-color: #ff9800; } .priority-color.low { background-color: #4caf50; } .priority-color.none { background-color: transparent; border: 1px solid #9e9e9e; } .show { display: block; } .task-priority-dropdown.open .priority-dropdown { display: block; } </style> </head> <body> <div class="task-manager"> <div class="header"> <button class="dark-mode-toggle" id="darkModeToggle"> <i class="toggle-icon">🌙</i> </button> <h1>Focused Task Manager</h1> <p>Organize your day, track your progress</p> <div class="header-pattern"></div> </div> <div class="task-input-container"> <input type="text" class="task-input" id="taskInput" placeholder="Add a new task..."> <button class="add-task-btn" id="addTaskBtn"> Add <div class="ripple-container"></div> </button> </div> <div class="tasks-container" id="tasksContainer"> <!-- Tasks will be added here --> </div> <div class="task-stats"> <div class="stats"> <div id="taskCount">0 tasks</div> <div class="progress-container"> <div class="progress-bar" id="progressBar"></div> </div> </div> <div class="filters"> <button class="filter-btn active" data-filter="all">All</button> <button class="filter-btn" data-filter="active">Active</button> <button class="filter-btn" data-filter="completed">Completed</button> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const taskInput = document.getElementById('taskInput'); const addTaskBtn = document.getElementById('addTaskBtn'); const tasksContainer = document.getElementById('tasksContainer'); const taskCount = document.getElementById('taskCount'); const progressBar = document.getElementById('progressBar'); const filterButtons = document.querySelectorAll('.filter-btn'); const darkModeToggle = document.getElementById('darkModeToggle'); // Initialize tasks from localStorage or use default sample tasks let tasks = JSON.parse(localStorage.getItem('tasks')) || [ { id: 1, text: 'Plan weekly marketing strategy', completed: false, date: 'Today', category: 'Work', priority: 'high' }, { id: 2, text: 'Prepare quarterly report', completed: false, date: 'Tomorrow', category: 'Work', priority: 'medium' }, { id: 3, text: 'Schedule team meeting', completed: true, date: 'Today', category: 'Work', priority: 'low' }, { id: 4, text: 'Review budget proposal', completed: false, date: 'Today', category: 'Finance', priority: 'high' } ]; let currentFilter = 'all'; // Initialize the task list renderTasks(); updateTaskStats(); // Add a new task addTaskBtn.addEventListener('click', function(e) { createRippleEffect(e, this); addTask(); }); taskInput.addEventListener('keypress', function(e) { if (e.key === 'Enter') { addTask(); } }); // Filter tasks filterButtons.forEach(button => { button.addEventListener('click', function() { filterButtons.forEach(btn => btn.classList.remove('active')); this.classList.add('active'); currentFilter = this.getAttribute('data-filter'); renderTasks(); }); }); // Dark mode toggle darkModeToggle.addEventListener('click', function() { document.body.classList.toggle('dark-mode'); const icon = this.querySelector('.toggle-icon'); icon.textContent = document.body.classList.contains('dark-mode') ? '☀️' : '🌙'; localStorage.setItem('darkMode', document.body.classList.contains('dark-mode')); }); // Check for dark mode preference if (localStorage.getItem('darkMode') === 'true') { document.body.classList.add('dark-mode'); darkModeToggle.querySelector('.toggle-icon').textContent = '☀️'; } // Add a new task function addTask() { const text = taskInput.value.trim(); if (text) { const newTask = { id: Date.now(), text: text, completed: false, date: 'Today', category: 'Personal', priority: 'medium' }; tasks.unshift(newTask); saveTasks(); renderTasks(); taskInput.value = ''; updateTaskStats(); } } // Render tasks based on the current filter function renderTasks() { tasksContainer.innerHTML = ''; const filteredTasks = tasks.filter(task => { if (currentFilter === 'all') return true; if (currentFilter === 'active') return !task.completed; if (currentFilter === 'completed') return task.completed; }); if (filteredTasks.length === 0) { const emptyState = document.createElement('div'); emptyState.className = 'empty-state'; emptyState.innerHTML = ` <div class="empty-state-icon">📋</div> <p class="empty-state-text">No ${currentFilter === 'all' ? '' : currentFilter} tasks found</p> <p>Add a new task to get started!</p> `; tasksContainer.appendChild(emptyState); return; } filteredTasks.forEach(task => { const taskElement = document.createElement('div'); taskElement.className = `task-item ${task.completed ? 'completed' : ''}`; taskElement.innerHTML = ` <div class="priority-indicator ${task.priority ? 'priority-' + task.priority : ''}"></div> <input type="checkbox" class="task-checkbox" ${task.completed ? 'checked' : ''} data-id="${task.id}"> <span class="task-text">${task.text}</span> <span class="category-tag">${task.category}</span> <span class="task-date">${task.date}</span> <div class="task-priority-dropdown"> <button class="priority-btn">⚑</button> <div class="priority-dropdown"> <div class="priority-option" data-priority="high"> <span class="priority-color high"></span> High </div> <div class="priority-option" data-priority="medium"> <span class="priority-color medium"></span> Medium </div> <div class="priority-option" data-priority="low"> <span class="priority-color low"></span> Low </div> <div class="priority-option" data-priority="none"> <span class="priority-color none"></span> None </div> </div> </div> <button class="delete-btn" data-id="${task.id}">✕</button> <div class="ripple-container"></div> `; tasksContainer.appendChild(taskElement); // Add ripple effect to the task item taskElement.addEventListener('click', function(e) { if (!e.target.closest('.task-checkbox, .delete-btn, .priority-btn, .priority-option')) { createRippleEffect(e, this); } }); }); // Add event listeners to checkboxes and delete buttons document.querySelectorAll('.task-checkbox').forEach(checkbox => { checkbox.addEventListener('change', toggleTaskCompletion); }); document.querySelectorAll('.delete-btn').forEach(button => { button.addEventListener('click', deleteTask); }); // Priority dropdown handling document.querySelectorAll('.priority-btn').forEach(button => { button.addEventListener('click', function(e) { e.stopPropagation(); const dropdown = this.parentElement; dropdown.classList.toggle('open'); }); }); document.querySelectorAll('.priority-option').forEach(option => { option.addEventListener('click', function(e) { e.stopPropagation(); const taskItem = this.closest('.task-item'); const taskId = taskItem.querySelector('.task-checkbox').getAttribute('data-id'); const priority = this.getAttribute('data-priority'); const taskIndex = tasks.findIndex(task => task.id == taskId); if (taskIndex !== -1) { tasks[taskIndex].priority = priority === 'none' ? '' : priority; saveTasks(); renderTasks(); } this.closest('.task-priority-dropdown').classList.remove('open'); }); }); // Close priority dropdowns when clicking outside document.addEventListener('click', function(e) { if (!e.target.closest('.task-priority-dropdown')) { document.querySelectorAll('.task-priority-dropdown.open').forEach(dropdown => { dropdown.classList.remove('open'); }); } }); } // Toggle task completion function toggleTaskCompletion() { const taskId = this.getAttribute('data-id'); const taskIndex = tasks.findIndex(task => task.id == taskId); if (taskIndex !== -1) { tasks[taskIndex].completed = !tasks[taskIndex].completed; saveTasks(); renderTasks(); updateTaskStats(); } } // Delete a task function deleteTask() { const taskId = this.getAttribute('data-id'); tasks = tasks.filter(task => task.id != taskId); saveTasks(); renderTasks(); updateTaskStats(); } // Update task statistics function updateTaskStats() { const totalTasks = tasks.length; const completedTasks = tasks.filter(task => task.completed).length; const progressPercentage = totalTasks > 0 ? (completedTasks / totalTasks) * 100 : 0; taskCount.textContent = `${completedTasks}/${totalTasks} ${totalTasks === 1 ? 'task' : 'tasks'} completed`; progressBar.style.width = `${progressPercentage}%`; } // Create ripple effect function createRippleEffect(event, element) { const rippleContainer = element.querySelector('.ripple-container'); if (!rippleContainer) return; const ripple = document.createElement('span'); ripple.className = 'ripple'; rippleContainer.appendChild(ripple); const rect = element.getBoundingClientRect(); const size = Math.max(rect.width, rect.height); ripple.style.width = ripple.style.height = `${size}px`; ripple.style.left = `${event.clientX - rect.left - size / 2}px`; ripple.style.top = `${event.clientY - rect.top - size / 2}px`; setTimeout(() => { ripple.remove(); }, 500); } // Save tasks to localStorage function saveTasks() { localStorage.setItem('tasks', JSON.stringify(tasks)); } }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> :root { --primary-color: #7C6CF1; --secondary-color: #F9CFF2; --tertiary-color: #C2F0E8; --accent-color: #FFB344; --correct-color: #7FCB9D; --error-color: #FF7D7D; --text-color: #444857; --light-bg: #F8F9FA; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } body { background-color: var(--light-bg); color: var(--text-color); display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; overflow-x: hidden; } .quiz-container { max-width: 650px; width: 100%; background: white; border-radius: 20px; box-shadow: 0 15px 30px rgba(124, 108, 241, 0.1); padding: 30px; transition: transform 0.3s ease; position: relative; overflow: hidden; } .quiz-container::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 8px; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--tertiary-color)); border-radius: 8px 8px 0 0; } h1 { font-size: 2rem; color: var(--primary-color); margin-bottom: 20px; text-align: center; font-weight: 700; margin-top: 10px; } .quiz-description { text-align: center; font-size: 1rem; margin-bottom: 30px; color: var(--text-color); line-height: 1.6; } .progress-bar { height: 8px; background: var(--light-bg); border-radius: 10px; margin-bottom: 30px; overflow: hidden; } .progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary-color), var(--tertiary-color)); border-radius: 10px; transition: width 0.5s ease; } .question-container { margin-bottom: 30px; } .question { font-size: 1.25rem; font-weight: 600; margin-bottom: 20px; color: var(--text-color); line-height: 1.4; } .options-container { display: grid; gap: 15px; } .option-item { position: relative; cursor: pointer; } .custom-checkbox { display: flex; align-items: center; gap: 15px; padding: 16px 20px; border-radius: 12px; background-color: var(--light-bg); transition: all 0.3s ease; border: 2px solid transparent; } .custom-checkbox:hover { transform: translateY(-2px); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05); } .checkbox-indicator { width: 24px; height: 24px; border: 2px solid var(--primary-color); border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; flex-shrink: 0; position: relative; overflow: hidden; } .checkbox-indicator::before { content: ''; position: absolute; width: 0; height: 0; background-color: var(--primary-color); border-radius: 3px; transition: all 0.3s ease; } .option-item input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; } .option-item input:checked ~ .custom-checkbox .checkbox-indicator::before { width: 16px; height: 16px; } .option-item input:checked ~ .custom-checkbox { border-color: var(--primary-color); background-color: rgba(124, 108, 241, 0.05); } .option-text { font-size: 1.1rem; color: var(--text-color); transition: color 0.3s ease; } .option-item input:checked ~ .custom-checkbox .option-text { color: var(--primary-color); font-weight: 500; } .option-item.correct .custom-checkbox { border-color: var(--correct-color); background-color: rgba(127, 203, 157, 0.1); } .option-item.correct .checkbox-indicator { border-color: var(--correct-color); } .option-item.correct .checkbox-indicator::before { background-color: var(--correct-color); } .option-item.incorrect .custom-checkbox { border-color: var(--error-color); background-color: rgba(255, 125, 125, 0.1); } .option-item.incorrect .checkbox-indicator { border-color: var(--error-color); } .option-item.incorrect .checkbox-indicator::before { background-color: var(--error-color); } .feedback-icon { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; } .option-item.correct .feedback-icon { opacity: 1; color: var(--correct-color); } .option-item.incorrect .feedback-icon { opacity: 1; color: var(--error-color); } .controls { display: flex; justify-content: space-between; margin-top: 30px; } .btn { padding: 12px 24px; border-radius: 12px; border: none; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px; } .btn-check { background-color: var(--primary-color); color: white; } .btn-check:hover { background-color: #6959dd; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(124, 108, 241, 0.3); } .btn-next { background-color: var(--tertiary-color); color: var(--text-color); } .btn-next:hover { background-color: #ade7dd; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(194, 240, 232, 0.3); } .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: translateY(0); box-shadow: none; } .feedback-message { margin-top: 20px; padding: 15px; border-radius: 12px; font-size: 1rem; display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(20px); transition: all 0.3s ease; } .feedback-message.show { opacity: 1; transform: translateY(0); } .feedback-message.correct { background-color: rgba(127, 203, 157, 0.1); color: var(--correct-color); border-left: 4px solid var(--correct-color); } .feedback-message.incorrect { background-color: rgba(255, 125, 125, 0.1); color: var(--error-color); border-left: 4px solid var(--error-color); } .shaking-animation { animation: shake 0.4s ease-in-out; } .success-animation { animation: success 0.5s ease-in-out; } @keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } } @keyframes success { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } } .confetti { position: absolute; width: 10px; height: 10px; background-color: #f0f; opacity: 0; z-index: 10; } @media (max-width: 600px) { h1 { font-size: 1.5rem; } .quiz-container { padding: 20px; } .question { font-size: 1.1rem; } .option-text { font-size: 1rem; } .custom-checkbox { padding: 12px 15px; } .btn { padding: 10px 20px; font-size: 0.9rem; } } </style> </head> <body> <div class="quiz-container"> <h1>Brain Development Quiz</h1> <p class="quiz-description">Test your knowledge about child development and learning processes with this interactive quiz. Select all correct answers for each question.</p> <div class="progress-bar"> <div class="progress-fill" id="progress-fill"></div> </div> <div id="quiz-content"> <!-- Questions will be inserted here by JavaScript --> </div> <div class="feedback-message" id="feedback-message"></div> <div class="controls"> <button class="btn btn-check" id="check-btn">Check Answers</button> <button class="btn btn-next" id="next-btn" disabled>Next Question</button> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const quizContent = document.getElementById('quiz-content'); const checkBtn = document.getElementById('check-btn'); const nextBtn = document.getElementById('next-btn'); const feedbackMessage = document.getElementById('feedback-message'); const progressFill = document.getElementById('progress-fill'); // Quiz questions data const quizData = [ { question: "Which of these factors positively impact child brain development? (Select all that apply)", options: [ { text: "Regular physical exercise", correct: true }, { text: "Consistent sleep patterns", correct: true }, { text: "Excessive screen time", correct: false }, { text: "Rich conversational interaction", correct: true } ], explanation: "Physical exercise, consistent sleep, and rich conversation all support healthy brain development. Excessive screen time can actually inhibit certain developmental processes." }, { question: "Which learning techniques are most effective for long-term memory formation? (Select all that apply)", options: [ { text: "Spaced repetition", correct: true }, { text: "Last-minute cramming", correct: false }, { text: "Active recall practice", correct: true }, { text: "Teaching concepts to others", correct: true } ], explanation: "Spaced repetition, active recall, and teaching others are proven techniques for long-term memory formation. Cramming might help short-term but doesn't create lasting neural connections." }, { question: "Which statements about the adolescent brain are correct? (Select all that apply)", options: [ { text: "The prefrontal cortex is fully developed by age 13", correct: false }, { text: "Emotional responses are often stronger than in adults", correct: true }, { text: "Risk assessment abilities are still developing", correct: true }, { text: "Sleep patterns naturally shift to later times", correct: true } ], explanation: "Adolescent brains have heightened emotional responses, developing risk assessment, and naturally later sleep cycles. The prefrontal cortex actually continues developing into the mid-20s." }, { question: "Which of these are effective ways to stimulate cognitive development in toddlers? (Select all that apply)", options: [ { text: "Open-ended play with simple toys", correct: true }, { text: "Structured academic drills", correct: false }, { text: "Sensory exploration activities", correct: true }, { text: "Interactive storytelling", correct: true } ], explanation: "Open-ended play, sensory exploration, and interactive storytelling all promote healthy cognitive development in toddlers. Structured academic drills are generally less effective at this age." }, { question: "Which of these statements about neuroplasticity are true? (Select all that apply)", options: [ { text: "It ends completely after early childhood", correct: false }, { text: "It allows the brain to form new neural connections", correct: true }, { text: "It can be enhanced through novel experiences", correct: true }, { text: "It helps recovery after brain injuries", correct: true } ], explanation: "Neuroplasticity continues throughout life, allowing for new neural connections, is enhanced through novel experiences, and plays a critical role in recovery from brain injuries." } ]; let currentQuestion = 0; let answersChecked = false; // Initialize the quiz function initQuiz() { showQuestion(currentQuestion); updateProgressBar(); } // Display the current question function showQuestion(questionIndex) { const questionData = quizData[questionIndex]; // Create question container const questionContainer = document.createElement('div'); questionContainer.className = 'question-container'; // Add question text const questionElement = document.createElement('div'); questionElement.className = 'question'; questionElement.textContent = questionData.question; questionContainer.appendChild(questionElement); // Add options const optionsContainer = document.createElement('div'); optionsContainer.className = 'options-container'; questionData.options.forEach((option, index) => { const optionItem = document.createElement('label'); optionItem.className = 'option-item'; optionItem.setAttribute('data-index', index); const input = document.createElement('input'); input.type = 'checkbox'; input.name = `question${questionIndex}`; input.setAttribute('data-correct', option.correct); const customCheckbox = document.createElement('div'); customCheckbox.className = 'custom-checkbox'; const checkboxIndicator = document.createElement('div'); checkboxIndicator.className = 'checkbox-indicator'; const optionText = document.createElement('span'); optionText.className = 'option-text'; optionText.textContent = option.text; const feedbackIcon = document.createElement('span'); feedbackIcon.className = 'feedback-icon'; // Create the structure customCheckbox.appendChild(checkboxIndicator); customCheckbox.appendChild(optionText); customCheckbox.appendChild(feedbackIcon); optionItem.appendChild(input); optionItem.appendChild(customCheckbox); optionsContainer.appendChild(optionItem); }); questionContainer.appendChild(optionsContainer); // Clear previous question and add new one quizContent.innerHTML = ''; quizContent.appendChild(questionContainer); // Reset state answersChecked = false; checkBtn.disabled = false; nextBtn.disabled = true; feedbackMessage.classList.remove('show', 'correct', 'incorrect'); } // Check user answers function checkAnswers() { if (answersChecked) return; let allCorrect = true; const optionItems = document.querySelectorAll('.option-item'); optionItems.forEach(item => { const input = item.querySelector('input'); const isChecked = input.checked; const isCorrect = input.getAttribute('data-correct') === 'true'; const feedbackIcon = item.querySelector('.feedback-icon'); // Clear previous feedback item.classList.remove('correct', 'incorrect'); // Checked correctly if (isChecked && isCorrect) { item.classList.add('correct'); feedbackIcon.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>'; } // Checked incorrectly else if (isChecked && !isCorrect) { item.classList.add('incorrect'); feedbackIcon.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>'; allCorrect = false; item.classList.add('shaking-animation'); setTimeout(() => { item.classList.remove('shaking-animation'); }, 500); } // Not checked but should be else if (!isChecked && isCorrect) { item.classList.add('incorrect'); feedbackIcon.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>'; allCorrect = false; } }); // Display feedback message feedbackMessage.innerHTML = allCorrect ? '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg> ' + 'Excellent! ' + quizData[currentQuestion].explanation : '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg> ' + 'Not quite. ' + quizData[currentQuestion].explanation; feedbackMessage.classList.add('show'); feedbackMessage.classList.add(allCorrect ? 'correct' : 'incorrect'); // Enable next button and disable check button nextBtn.disabled = false; checkBtn.disabled = true; // Add celebration effect if all correct if (allCorrect) { document.querySelector('.quiz-container').classList.add('success-animation'); setTimeout(() => { document.querySelector('.quiz-container').classList.remove('success-animation'); }, 500); createConfetti(); } answersChecked = true; } // Move to the next question function nextQuestion() { if (currentQuestion < quizData.length - 1) { currentQuestion++; showQuestion(currentQuestion); updateProgressBar(); } else { // Quiz completed quizContent.innerHTML = ` <div class="question-container"> <h2 style="color: var(--primary-color); text-align: center; margin-bottom: 20px;">Quiz Completed!</h2> <p style="text-align: center; margin-bottom: 30px;">Great job! You've completed the Brain Development Quiz.</p> <button id="restart-btn" class="btn btn-check" style="display: block; margin: 0 auto;">Restart Quiz</button> </div> `; document.getElementById('restart-btn').addEventListener('click', () => { currentQuestion = 0; initQuiz(); }); checkBtn.style.display = 'none'; nextBtn.style.display = 'none'; feedbackMessage.classList.remove('show'); createConfetti(); } } // Update progress bar function updateProgressBar() { const progressPercentage = ((currentQuestion + 1) / quizData.length) * 100; progressFill.style.width = `${progressPercentage}%`; } // Create confetti effect function createConfetti() { const container = document.querySelector('.quiz-container'); const colors = ['#7C6CF1', '#F9CFF2', '#C2F0E8', '#FFB344', '#7FCB9D']; for (let i = 0; i < 50; i++) { const confetti = document.createElement('div'); confetti.className = 'confetti'; confetti.style.left = Math.random() * 100 + '%'; confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)]; confetti.style.width = Math.random() * 10 + 5 + 'px'; confetti.style.height = Math.random() * 10 + 5 + 'px'; confetti.style.opacity = Math.random(); confetti.style.transform = 'rotate(' + Math.random() * 360 + 'deg)'; container.appendChild(confetti); // Animate the confetti const animation = confetti.animate( [ { transform: `translate(0, 0) rotate(0deg)`, opacity: 1 }, { transform: `translate(${Math.random() * 200 - 100}px, ${Math.random() * 200 + 100}px) rotate(${Math.random() * 360}deg)`, opacity: 0 } ], { duration: Math.random() * 2000 + 1000, easing: 'cubic-bezier(0, .9, .57, 1)', delay: Math.random() * 200 } ); animation.onfinish = function() { confetti.remove(); }; } } // Event Listeners checkBtn.addEventListener('click', checkAnswers); nextBtn.addEventListener('click', nextQuestion); // Initialize the quiz initQuiz(); }); </script> </body> </html>
<html> <head> <title>Gourmet Selector - Food Ordering App</title> <style> :root { --primary: #FF6B35; --primary-dark: #E84E0F; --secondary: #3B8C66; --secondary-dark: #2A6B4A; --neutral-light: #FFF9F2; --neutral-dark: #33272A; --success: #73D56E; --accent: #FFBC42; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif; } body { background-color: var(--neutral-light); display: flex; justify-content: center; align-items: center; min-height: 100vh; color: var(--neutral-dark); overflow-x: hidden; } .container { max-width: 640px; width: 100%; padding: 20px; border-radius: 24px; background-color: #fff; box-shadow: 0 12px 36px rgba(51, 39, 42, 0.1); position: relative; overflow: hidden; } .app-header { display: flex; align-items: center; margin-bottom: 20px; } .app-logo { width: 48px; height: 48px; background-color: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-right: 16px; box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3); } .app-logo svg { width: 28px; height: 28px; fill: white; } .app-title h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; } .app-title p { font-size: 0.9rem; color: rgba(51, 39, 42, 0.7); } .section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; } .section-title span { display: inline-block; margin-left: 8px; font-size: 0.9rem; font-weight: 400; color: var(--primary); } .checkbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 24px; } .checkbox-container { position: relative; overflow: hidden; } .checkbox-label { display: flex; padding: 16px; border-radius: 12px; background-color: rgba(255, 249, 242, 0.7); border: 2px solid transparent; cursor: pointer; transition: all 0.3s ease; position: relative; } .checkbox-label:hover { border-color: rgba(255, 107, 53, 0.3); transform: translateY(-2px); } .checkbox-input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; } .checkbox-input:checked + .checkbox-label { border-color: var(--primary); background-color: rgba(255, 107, 53, 0.05); } .checkbox-custom { min-width: 24px; height: 24px; background-color: white; border-radius: 6px; margin-right: 12px; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(51, 39, 42, 0.2); transition: all 0.2s ease; position: relative; overflow: hidden; } .checkbox-input:checked + .checkbox-label .checkbox-custom { background-color: var(--primary); border-color: var(--primary); } .checkbox-input:checked + .checkbox-label .checkbox-custom::after { content: ''; position: absolute; width: 6px; height: 12px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(1); opacity: 1; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); } .checkbox-input:not(:checked) + .checkbox-label .checkbox-custom::after { content: ''; position: absolute; width: 6px; height: 12px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); opacity: 0; } .checkbox-content { display: flex; flex-direction: column; } .checkbox-title { font-weight: 600; margin-bottom: 4px; font-size: 1rem; } .checkbox-description { font-size: 0.85rem; color: rgba(51, 39, 42, 0.7); line-height: 1.4; } .checkbox-price { font-weight: 600; color: var(--primary); margin-top: 6px; } .ripple { position: absolute; border-radius: 50%; background-color: rgba(255, 107, 53, 0.3); transform: scale(0); animation: ripple 0.6s linear; pointer-events: none; } @keyframes ripple { to { transform: scale(2.5); opacity: 0; } } .summary-section { background-color: #FFF9F2; padding: 20px; border-radius: 12px; margin-bottom: 24px; } .summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; } .summary-total { display: flex; justify-content: space-between; font-weight: 700; padding-top: 12px; margin-top: 12px; border-top: 2px dashed rgba(51, 39, 42, 0.1); } .summary-total .amount { color: var(--primary); font-size: 1.2rem; } .action-button { background-color: var(--primary); color: white; border: none; padding: 16px 32px; border-radius: 12px; font-weight: 600; cursor: pointer; width: 100%; font-size: 1rem; transition: all 0.3s ease; position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3); } .action-button:hover { background-color: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4); } .action-button svg { margin-left: 8px; transition: transform 0.3s ease; } .action-button:hover svg { transform: translateX(4px); } .confirmation { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(51, 39, 42, 0.85); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; } .confirmation.active { opacity: 1; pointer-events: all; } .confirmation-content { background-color: white; padding: 32px; border-radius: 24px; text-align: center; max-width: 320px; transform: translateY(20px); opacity: 0; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); transition-delay: 0.1s; } .confirmation.active .confirmation-content { transform: translateY(0); opacity: 1; } .confirmation-icon { width: 72px; height: 72px; background-color: var(--success); border-radius: 50%; margin: 0 auto 24px; display: flex; align-items: center; justify-content: center; } .confirmation-icon svg { width: 36px; height: 36px; fill: white; } .confirmation h2 { margin-bottom: 12px; color: var(--neutral-dark); } .confirmation p { color: rgba(51, 39, 42, 0.7); margin-bottom: 24px; } .close-button { background-color: var(--neutral-light); color: var(--neutral-dark); border: none; padding: 12px 24px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; } .close-button:hover { background-color: rgba(51, 39, 42, 0.1); } .added-notification { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background-color: var(--secondary); color: white; padding: 12px 24px; border-radius: 12px; box-shadow: 0 4px 12px rgba(59, 140, 102, 0.3); opacity: 0; transition: all 0.3s ease; z-index: 100; } .added-notification.show { transform: translateX(-50%) translateY(0); opacity: 1; } .badge { display: inline-block; background-color: var(--accent); color: var(--neutral-dark); font-size: 0.75rem; font-weight: 600; padding: 4px 8px; border-radius: 4px; margin-left: 8px; vertical-align: middle; } @media (max-width: 640px) { .container { border-radius: 0; padding: 16px; margin: 0; height: 100vh; overflow-y: auto; } .checkbox-list { grid-template-columns: 1fr; } .app-title h1 { font-size: 1.3rem; } } /* Animated background pattern */ .pattern { position: absolute; width: 1000px; height: 1000px; background: linear-gradient(45deg, var(--primary) 25%, transparent 25%, transparent 75%, var(--primary) 75%, var(--primary)), linear-gradient(45deg, var(--primary) 25%, transparent 25%, transparent 75%, var(--primary) 75%, var(--primary)); background-size: 20px 20px; background-position: 0 0, 10px 10px; opacity: 0.03; top: -200px; right: -200px; border-radius: 50%; animation: rotate 120s linear infinite; z-index: -1; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } </style> </head> <body> <div class="pattern"></div> <div class="container"> <div class="app-header"> <div class="app-logo"> <svg viewBox="0 0 24 24"> <path d="M8.1,13.34L3.91,9.16C2.35,7.59 2.35,5.06 3.91,3.5L10.93,10.5L8.1,13.34M14.88,11.53L13.41,13L20.29,19.88L18.88,21.29L12,14.41L5.12,21.29L3.71,19.88L13.47,10.12C12.76,8.59 13.26,6.44 14.85,4.85C16.76,2.93 19.5,2.57 20.96,4.03C22.43,5.5 22.07,8.24 20.15,10.15C18.56,11.74 16.41,12.24 14.88,11.53Z"/> </svg> </div> <div class="app-title"> <h1>Taste Tapestry</h1> <p>Craft your perfect meal with ease</p> </div> </div> <div class="section-title"> Customize Your Burger <span class="badge">Popular Choice</span> </div> <div class="checkbox-list"> <div class="checkbox-container"> <input type="checkbox" id="cheese" class="checkbox-input"> <label for="cheese" class="checkbox-label"> <div class="checkbox-custom"></div> <div class="checkbox-content"> <div class="checkbox-title">Extra Cheese</div> <div class="checkbox-description">Melted aged cheddar with smoky notes</div> <div class="checkbox-price">+$1.50</div> </div> </label> </div> <div class="checkbox-container"> <input type="checkbox" id="bacon" class="checkbox-input"> <label for="bacon" class="checkbox-label"> <div class="checkbox-custom"></div> <div class="checkbox-content"> <div class="checkbox-title">Crispy Bacon</div> <div class="checkbox-description">House-cured, applewood smoked bacon strips</div> <div class="checkbox-price">+$2.00</div> </div> </label> </div> <div class="checkbox-container"> <input type="checkbox" id="avocado" class="checkbox-input"> <label for="avocado" class="checkbox-label"> <div class="checkbox-custom"></div> <div class="checkbox-content"> <div class="checkbox-title">Fresh Avocado</div> <div class="checkbox-description">Sliced ripe Hass avocado with sea salt</div> <div class="checkbox-price">+$1.75</div> </div> </label> </div> <div class="checkbox-container"> <input type="checkbox" id="mushroom" class="checkbox-input"> <label for="mushroom" class="checkbox-label"> <div class="checkbox-custom"></div> <div class="checkbox-content"> <div class="checkbox-title">Sautéed Mushrooms</div> <div class="checkbox-description">Garlic butter portobello mushrooms</div> <div class="checkbox-price">+$1.25</div> </div> </label> </div> </div> <div class="section-title"> Special Instructions </div> <div class="checkbox-list"> <div class="checkbox-container"> <input type="checkbox" id="glutenfree" class="checkbox-input"> <label for="glutenfree" class="checkbox-label"> <div class="checkbox-custom"></div> <div class="checkbox-content"> <div class="checkbox-title">Gluten-Free Bun</div> <div class="checkbox-description">Artisanal gluten-free bun substitute</div> <div class="checkbox-price">+$2.50</div> </div> </label> </div> <div class="checkbox-container"> <input type="checkbox" id="wellDone" class="checkbox-input"> <label for="wellDone" class="checkbox-label"> <div class="checkbox-custom"></div> <div class="checkbox-content"> <div class="checkbox-title">Cook Well Done</div> <div class="checkbox-description">Fully cooked patty, no pink inside</div> <div class="checkbox-price">No extra charge</div> </div> </label> </div> <div class="checkbox-container"> <input type="checkbox" id="extraSauce" class="checkbox-input"> <label for="extraSauce" class="checkbox-label"> <div class="checkbox-custom"></div> <div class="checkbox-content"> <div class="checkbox-title">Extra Sauce</div> <div class="checkbox-description">Additional house-made secret sauce</div> <div class="checkbox-price">+$0.75</div> </div> </label> </div> <div class="checkbox-container"> <input type="checkbox" id="noOnion" class="checkbox-input"> <label for="noOnion" class="checkbox-label"> <div class="checkbox-custom"></div> <div class="checkbox-content"> <div class="checkbox-title">No Onions</div> <div class="checkbox-description">Remove all onions from the burger</div> <div class="checkbox-price">No extra charge</div> </div> </label> </div> </div> <div class="summary-section"> <div class="section-title" style="margin-bottom: 12px">Order Summary</div> <div class="summary-row"> <div>Classic Burger</div> <div>$10.99</div> </div> <div class="summary-row" id="extras-row"> <div>Added extras</div> <div id="extras-price">$0.00</div> </div> <div class="summary-total"> <div>Total</div> <div class="amount" id="total-price">$10.99</div> </div> </div> <button class="action-button" id="add-to-cart"> Add To Order <svg viewBox="0 0 24 24" width="20" height="20" fill="white"> <path d="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" /> </svg> </button> </div> <div class="added-notification" id="notification">Item added to your order!</div> <div class="confirmation" id="confirmation"> <div class="confirmation-content"> <div class="confirmation-icon"> <svg viewBox="0 0 24 24"> <path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /> </svg> </div> <h2>Order Added!</h2> <p>Your customized burger has been added to your cart. Ready to checkout?</p> <button class="close-button" id="close-confirmation">Continue Ordering</button> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const checkboxes = document.querySelectorAll('.checkbox-input'); const extrasPrice = document.getElementById('extras-price'); const totalPrice = document.getElementById('total-price'); const addToCartBtn = document.getElementById('add-to-cart'); const notification = document.getElementById('notification'); const confirmation = document.getElementById('confirmation'); const closeConfirmation = document.getElementById('close-confirmation'); const baseBurgerPrice = 10.99; let totalExtras = 0; // Add ripple effect to checkboxes const checkboxLabels = document.querySelectorAll('.checkbox-label'); checkboxLabels.forEach(label => { label.addEventListener('click', function(e) { const ripple = document.createElement('span'); ripple.classList.add('ripple'); this.appendChild(ripple); const rect = this.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; ripple.style.left = `${x}px`; ripple.style.top = `${y}px`; setTimeout(() => { ripple.remove(); }, 600); }); }); // Calculate prices when checkboxes change checkboxes.forEach(checkbox => { checkbox.addEventListener('change', function() { calculateTotals(); // Animate checkbox const label = this.nextElementSibling; if (this.checked) { label.style.transform = 'scale(1.03)'; setTimeout(() => { label.style.transform = 'translateY(-2px)'; }, 100); } else { label.style.transform = 'scale(0.97)'; setTimeout(() => { label.style.transform = 'translateY(0)'; }, 100); } }); }); function calculateTotals() { totalExtras = 0; if (document.getElementById('cheese').checked) totalExtras += 1.50; if (document.getElementById('bacon').checked) totalExtras += 2.00; if (document.getElementById('avocado').checked) totalExtras += 1.75; if (document.getElementById('mushroom').checked) totalExtras += 1.25; if (document.getElementById('glutenfree').checked) totalExtras += 2.50; if (document.getElementById('extraSauce').checked) totalExtras += 0.75; extrasPrice.textContent = `$${totalExtras.toFixed(2)}`; totalPrice.textContent = `$${(baseBurgerPrice + totalExtras).toFixed(2)}`; } // Add to cart button click addToCartBtn.addEventListener('click', function() { // Show notification notification.classList.add('show'); setTimeout(() => { notification.classList.remove('show'); }, 2000); // Button animation this.style.transform = 'scale(0.95)'; setTimeout(() => { this.style.transform = ''; // Show confirmation after button animation setTimeout(() => { confirmation.classList.add('active'); }, 300); }, 200); }); // Close confirmation closeConfirmation.addEventListener('click', function() { confirmation.classList.remove('active'); }); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> :root { --primary: #2E4057; --secondary: #F0EBE3; --accent: #A67F68; --accent-light: #D7C0AE; --text: #333333; --light-text: #7D7D7D; --background: #F9F8F6; --transition: 0.3s ease; --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); } * { margin: 0; padding: 0; box-sizing: border-box; font-family: "Baskerville", Georgia, serif; } body { background-color: var(--background); color: var(--text); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; overflow-x: hidden; } .container { width: 100%; max-width: 600px; background-color: white; border-radius: 8px; box-shadow: var(--box-shadow); padding: 40px; position: relative; overflow: hidden; } .container::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 6px; background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%); } .header { margin-bottom: 30px; position: relative; } .header h1 { font-size: 28px; font-weight: normal; margin-bottom: 8px; color: var(--primary); letter-spacing: -0.5px; } .header p { font-size: 16px; color: var(--light-text); line-height: 1.6; } .toggle-view { display: flex; justify-content: flex-end; margin-bottom: 20px; } .toggle-view button { background: none; border: none; font-size: 14px; color: var(--light-text); cursor: pointer; padding: 5px 10px; margin-left: 10px; transition: var(--transition); position: relative; } .toggle-view button.active { color: var(--primary); font-weight: bold; } .toggle-view button.active::after { content: ""; position: absolute; bottom: 0; left: 10px; right: 10px; height: 2px; background-color: var(--accent); } .tags-grid, .tags-list { display: none; opacity: 0; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease; } .tags-grid.active, .tags-list.active { display: grid; opacity: 1; transform: translateY(0); } .tags-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; } .tags-list { display: flex; flex-direction: column; gap: 12px; } .tag-checkbox { position: relative; user-select: none; } .tag-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; } .checkmark { position: relative; display: flex; align-items: center; padding: 10px 15px; border: 1px solid #E5E5E5; border-radius: 5px; transition: var(--transition); cursor: pointer; overflow: hidden; } .tags-grid .checkmark { justify-content: center; padding: 12px 10px; font-size: 15px; } .tags-list .checkmark { padding: 14px 15px 14px 40px; font-size: 16px; } .tags-list .checkmark::before { content: ""; position: absolute; left: 15px; top: 50%; transform: translateY(-50%); height: 18px; width: 18px; border: 1px solid #CCCCCC; border-radius: 3px; transition: var(--transition); } .tag-checkbox input:checked ~ .checkmark::before { background-color: var(--accent); border-color: var(--accent); } .tags-list .checkmark::after { content: ""; position: absolute; left: 20px; top: 45%; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: translateY(-50%) rotate(45deg); opacity: 0; transition: var(--transition); } .tag-checkbox input:checked ~ .checkmark::after { opacity: 1; } .tag-checkbox input:checked ~ .checkmark { background-color: var(--secondary); border-color: var(--accent-light); box-shadow: 0 2px 8px rgba(166, 127, 104, 0.1); } .tag-checkbox:hover .checkmark { border-color: var(--accent-light); } .tag-checkbox .tag-icon { margin-right: 8px; transition: var(--transition); font-size: 14px; } .tag-checkbox input:checked ~ .checkmark .tag-icon { color: var(--accent); } .tags-grid .tag-checkbox input:checked ~ .checkmark::before { content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 20px 20px 0; border-color: transparent var(--accent) transparent transparent; } .categories-section { margin-top: 30px; border-top: 1px solid #EFEFEF; padding-top: 30px; } .section-title { font-size: 20px; font-weight: normal; margin-bottom: 20px; color: var(--primary); display: flex; align-items: center; } .section-title::after { content: ""; flex: 1; height: 1px; background-color: #EFEFEF; margin-left: 15px; } .selected-count { background-color: var(--accent-light); color: var(--primary); font-size: 14px; padding: 2px 8px; border-radius: 20px; margin-left: 10px; opacity: 0; transform: scale(0.8); transition: var(--transition); } .selected-count.visible { opacity: 1; transform: scale(1); } .save-button { margin-top: 40px; text-align: center; } .save-button button { background-color: var(--primary); color: white; border: none; padding: 12px 30px; font-size: 16px; border-radius: 30px; cursor: pointer; transition: var(--transition); position: relative; overflow: hidden; box-shadow: 0 4px 10px rgba(46, 64, 87, 0.2); } .save-button button:hover { background-color: #233547; } .save-button button .ripple { position: absolute; border-radius: 50%; background-color: rgba(255, 255, 255, 0.4); transform: scale(0); animation: ripple 0.6s linear; } @keyframes ripple { to { transform: scale(2.5); opacity: 0; } } .tooltip { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); background-color: var(--primary); color: white; padding: 8px 12px; border-radius: 4px; font-size: 14px; opacity: 0; transition: var(--transition); pointer-events: none; white-space: nowrap; } .tooltip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: var(--primary) transparent transparent transparent; } .tooltip.show { top: -50px; opacity: 1; } @media (max-width: 600px) { .container { padding: 30px 20px; } .header h1 { font-size: 24px; } .tags-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; } .tag-checkbox .checkmark { padding: 10px; font-size: 14px; } .tags-list .checkmark { padding: 12px 12px 12px 36px; } .tags-list .checkmark::before { left: 12px; height: 16px; width: 16px; } .section-title { font-size: 18px; } } </style> </head> <body> <div class="container"> <div class="header"> <h1>Curate Your Editorial Identity</h1> <p>Select the tags and categories that best represent your writing style and content focus. These choices will help readers discover your work.</p> </div> <div class="toggle-view"> <button id="grid-view" class="active">Grid View</button> <button id="list-view">List View</button> </div> <div class="section-title"> Content Tags <span class="selected-count" id="tags-count">0</span> </div> <div class="tags-grid active" id="tags-grid"> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Literature"> <span class="checkmark">Literature</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Philosophy"> <span class="checkmark">Philosophy</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Politics"> <span class="checkmark">Politics</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Culture"> <span class="checkmark">Culture</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Science"> <span class="checkmark">Science</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="History"> <span class="checkmark">History</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Technology"> <span class="checkmark">Technology</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Art"> <span class="checkmark">Art</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Travel"> <span class="checkmark">Travel</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Food"> <span class="checkmark">Food</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Memoir"> <span class="checkmark">Memoir</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Poetry"> <span class="checkmark">Poetry</span> </label> </div> <div class="tags-list" id="tags-list"> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Literature"> <span class="checkmark">Literature</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Philosophy"> <span class="checkmark">Philosophy</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Politics"> <span class="checkmark">Politics</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Culture"> <span class="checkmark">Culture</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Science"> <span class="checkmark">Science</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="History"> <span class="checkmark">History</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Technology"> <span class="checkmark">Technology</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Art"> <span class="checkmark">Art</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Travel"> <span class="checkmark">Travel</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Food"> <span class="checkmark">Food</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Memoir"> <span class="checkmark">Memoir</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="tag" value="Poetry"> <span class="checkmark">Poetry</span> </label> </div> <div class="categories-section"> <div class="section-title"> Publication Categories <span class="selected-count" id="categories-count">0</span> </div> <div class="tags-grid active" id="categories-grid"> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Essay"> <span class="checkmark">Essay</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Review"> <span class="checkmark">Review</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Analysis"> <span class="checkmark">Analysis</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Interview"> <span class="checkmark">Interview</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Feature"> <span class="checkmark">Feature</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Opinion"> <span class="checkmark">Opinion</span> </label> </div> <div class="tags-list" id="categories-list"> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Essay"> <span class="checkmark">Essay</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Review"> <span class="checkmark">Review</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Analysis"> <span class="checkmark">Analysis</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Interview"> <span class="checkmark">Interview</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Feature"> <span class="checkmark">Feature</span> </label> <label class="tag-checkbox"> <input type="checkbox" name="category" value="Opinion"> <span class="checkmark">Opinion</span> </label> </div> </div> <div class="save-button"> <button id="save-button">Save Preferences</button> <div class="tooltip" id="tooltip">Tags and categories saved successfully</div> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const gridViewBtn = document.getElementById('grid-view'); const listViewBtn = document.getElementById('list-view'); const tagsGrid = document.getElementById('tags-grid'); const tagsList = document.getElementById('tags-list'); const categoriesGrid = document.getElementById('categories-grid'); const categoriesList = document.getElementById('categories-list'); const tagsCount = document.getElementById('tags-count'); const categoriesCount = document.getElementById('categories-count'); const saveButton = document.getElementById('save-button'); const tooltip = document.getElementById('tooltip'); // Toggle between grid and list view gridViewBtn.addEventListener('click', function() { gridViewBtn.classList.add('active'); listViewBtn.classList.remove('active'); tagsGrid.classList.add('active'); tagsList.classList.remove('active'); categoriesGrid.classList.add('active'); categoriesList.classList.remove('active'); }); listViewBtn.addEventListener('click', function() { listViewBtn.classList.add('active'); gridViewBtn.classList.remove('active'); tagsList.classList.add('active'); tagsGrid.classList.remove('active'); categoriesList.classList.add('active'); categoriesGrid.classList.remove('active'); }); // Sync checkboxes between grid and list views const tagCheckboxes = document.querySelectorAll('input[name="tag"]'); const categoryCheckboxes = document.querySelectorAll('input[name="category"]'); // Sync tag checkboxes tagCheckboxes.forEach((checkbox, index) => { if (index < tagCheckboxes.length / 2) { checkbox.addEventListener('change', function() { const corresponding = tagCheckboxes[index + tagCheckboxes.length / 2]; corresponding.checked = checkbox.checked; updateCounter(); }); } else { checkbox.addEventListener('change', function() { const corresponding = tagCheckboxes[index - tagCheckboxes.length / 2]; corresponding.checked = checkbox.checked; updateCounter(); }); } }); // Sync category checkboxes categoryCheckboxes.forEach((checkbox, index) => { if (index < categoryCheckboxes.length / 2) { checkbox.addEventListener('change', function() { const corresponding = categoryCheckboxes[index + categoryCheckboxes.length / 2]; corresponding.checked = checkbox.checked; updateCounter(); }); } else { checkbox.addEventListener('change', function() { const corresponding = categoryCheckboxes[index - categoryCheckboxes.length / 2]; corresponding.checked = checkbox.checked; updateCounter(); }); } }); // Update counter function function updateCounter() { // Count tags const selectedTags = Array.from(tagCheckboxes) .filter(checkbox => checkbox.checked) .length / 2; tagsCount.textContent = selectedTags; if (selectedTags > 0) { tagsCount.classList.add('visible'); } else { tagsCount.classList.remove('visible'); } // Count categories const selectedCategories = Array.from(categoryCheckboxes) .filter(checkbox => checkbox.checked) .length / 2; categoriesCount.textContent = selectedCategories; if (selectedCategories > 0) { categoriesCount.classList.add('visible'); } else { categoriesCount.classList.remove('visible'); } } // Save button ripple effect saveButton.addEventListener('click', function(e) { const x = e.clientX - e.target.getBoundingClientRect().left; const y = e.clientY - e.target.getBoundingClientRect().top; const ripple = document.createElement('span'); ripple.className = 'ripple'; ripple.style.left = `${x}px`; ripple.style.top = `${y}px`; saveButton.appendChild(ripple); setTimeout(() => { ripple.remove(); }, 600); // Show tooltip tooltip.classList.add('show'); setTimeout(() => { tooltip.classList.remove('show'); }, 2500); }); // Initialize counters updateCounter(); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Financial Dashboard Settings</title> <style> :root { --primary: #1B3A57; --secondary: #2C5F8B; --accent: #00C2CB; --light: #E0F0FF; --error: #FF4757; --success: #00E676; --dark: #0A1C2A; --neutral: #718096; --gray-light: #F0F5F9; --shadow: rgba(12, 36, 64, 0.1); --font-main: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } * { margin: 0; padding: 0; box-sizing: border-box; } body { background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%); font-family: var(--font-main); color: var(--dark); display: flex; justify-content: center; align-items: center; min-height: 700px; line-height: 1.5; padding: 20px; } .dashboard-container { max-width: 650px; width: 100%; background: white; border-radius: 16px; box-shadow: 0 10px 30px var(--shadow); overflow: hidden; position: relative; } .dashboard-header { background: var(--primary); color: white; padding: 24px 32px; position: relative; overflow: hidden; } .dashboard-header h1 { font-size: 24px; font-weight: 600; margin-bottom: 6px; } .dashboard-header p { font-size: 15px; opacity: 0.9; max-width: 90%; } .header-pattern { position: absolute; top: 0; right: 0; width: 180px; height: 100%; background-image: linear-gradient(45deg, rgba(0,194,203,0.1) 25%, transparent 25%, transparent 50%, rgba(0,194,203,0.1) 50%, rgba(0,194,203,0.1) 75%, transparent 75%, transparent); background-size: 20px 20px; } .settings-content { padding: 25px 32px; } .settings-section { margin-bottom: 28px; } .settings-section:last-child { margin-bottom: 0; } .settings-section h2 { font-size: 18px; font-weight: 600; margin-bottom: 14px; color: var(--primary); display: flex; align-items: center; } .settings-section h2 svg { margin-right: 10px; } .checkbox-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; } .checkbox-item { position: relative; transition: all 0.2s ease; } .checkbox-wrapper { display: flex; align-items: flex-start; cursor: pointer; padding: 14px 18px; background-color: var(--gray-light); border-radius: 10px; transition: all 0.2s ease; border: 2px solid transparent; user-select: none; } .checkbox-wrapper:hover { background-color: white; box-shadow: 0 4px 12px rgba(44, 95, 139, 0.08); border-color: var(--light); } .checkbox-input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; } .checkbox-custom { position: relative; height: 22px; width: 22px; min-width: 22px; border-radius: 5px; background-color: white; border: 2px solid var(--neutral); margin-right: 14px; margin-top: 2px; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); } .checkbox-custom:after { content: ""; position: absolute; display: none; left: 6px; top: 2px; width: 6px; height: 11px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); } .checkbox-input:checked ~ .checkbox-wrapper .checkbox-custom { background-color: var(--secondary); border-color: var(--secondary); transform: scale(1.1); } .checkbox-input:checked ~ .checkbox-wrapper .checkbox-custom:after { display: block; } .checkbox-input:focus ~ .checkbox-wrapper { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 194, 203, 0.2); } .checkbox-label { display: flex; flex-direction: column; } .checkbox-title { font-weight: 500; font-size: 15px; color: var(--dark); margin-bottom: 2px; } .checkbox-desc { font-size: 13px; color: var(--neutral); } .error .checkbox-wrapper { animation: shake 0.4s ease; border-color: var(--error); } @keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } } .settings-actions { display: flex; justify-content: flex-end; align-items: center; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--gray-light); } .save-btn { background: var(--secondary); color: white; border: none; padding: 12px 24px; border-radius: 8px; font-weight: 500; font-size: 15px; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; } .save-btn:hover { background: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(12, 36, 64, 0.15); } .save-btn:active { transform: translateY(0); } .save-btn svg { margin-left: 8px; } .reset-btn { margin-right: 16px; background: none; border: none; color: var(--neutral); font-size: 15px; cursor: pointer; transition: color 0.2s ease; } .reset-btn:hover { color: var(--dark); } .status-message { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--primary); color: white; padding: 14px 24px; border-radius: 8px; box-shadow: 0 10px 25px rgba(12, 36, 64, 0.18); font-size: 15px; display: flex; align-items: center; opacity: 0; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 100; } .status-message.success { background: var(--success); } .status-message.error { background: var(--error); } .status-message.visible { transform: translateX(-50%) translateY(0); opacity: 1; } .status-message svg { margin-right: 10px; } .save-animation { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.5s ease; } .save-animation.active { transform: scaleX(1); } @media (max-width: 600px) { .dashboard-container { border-radius: 12px; } .dashboard-header { padding: 20px 24px; } .settings-content { padding: 20px 24px; } .checkbox-group { grid-template-columns: 1fr; } .settings-actions { flex-direction: column; align-items: stretch; } .reset-btn { margin-right: 0; margin-bottom: 16px; padding: 10px; } } </style> </head> <body> <div class="dashboard-container"> <div class="save-animation" id="saveAnimation"></div> <div class="dashboard-header"> <h1>Dashboard Settings</h1> <p>Customize your financial monitoring preferences</p> <div class="header-pattern"></div> </div> <div class="settings-content"> <div class="settings-section"> <h2> <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M19.4 15C19.2669 15.3016 19.2272 15.6362 19.286 15.9606C19.3448 16.285 19.4995 16.5843 19.73 16.82L19.79 16.88C19.976 17.0657 20.1235 17.2863 20.2241 17.5291C20.3248 17.7719 20.3766 18.0322 20.3766 18.295C20.3766 18.5578 20.3248 18.8181 20.2241 19.0609C20.1235 19.3037 19.976 19.5243 19.79 19.71C19.6043 19.896 19.3837 20.0435 19.1409 20.1441C18.8981 20.2448 18.6378 20.2966 18.375 20.2966C18.1122 20.2966 17.8519 20.2448 17.6091 20.1441C17.3663 20.0435 17.1457 19.896 16.96 19.71L16.9 19.65C16.6643 19.4195 16.365 19.2648 16.0406 19.206C15.7162 19.1472 15.3816 19.1869 15.08 19.32C14.7842 19.4468 14.532 19.6572 14.3543 19.9255C14.1766 20.1938 14.0813 20.5082 14.08 20.83V21C14.08 21.5304 13.8693 22.0391 13.4942 22.4142C13.1191 22.7893 12.6104 23 12.08 23C11.5496 23 11.0409 22.7893 10.6658 22.4142C10.2907 22.0391 10.08 21.5304 10.08 21V20.91C10.0723 20.579 9.96512 20.258 9.77251 19.9887C9.5799 19.7194 9.31074 19.5143 9 19.4C8.69838 19.2669 8.36381 19.2272 8.03941 19.286C7.71502 19.3448 7.41568 19.4995 7.18 19.73L7.12 19.79C6.93425 19.976 6.71368 20.1235 6.47088 20.2241C6.22808 20.3248 5.96783 20.3766 5.705 20.3766C5.44217 20.3766 5.18192 20.3248 4.93912 20.2241C4.69632 20.1235 4.47575 19.976 4.29 19.79C4.10405 19.6043 3.95653 19.3837 3.85588 19.1409C3.75523 18.8981 3.70343 18.6378 3.70343 18.375C3.70343 18.1122 3.75523 17.8519 3.85588 17.6091C3.95653 17.3663 4.10405 17.1457 4.29 16.96L4.35 16.9C4.58054 16.6643 4.73519 16.365 4.794 16.0406C4.85282 15.7162 4.81312 15.3816 4.68 15.08C4.55324 14.7842 4.34276 14.532 4.07447 14.3543C3.80618 14.1766 3.49179 14.0813 3.17 14.08H3C2.46957 14.08 1.96086 13.8693 1.58579 13.4942C1.21071 13.1191 1 12.6104 1 12.08C1 11.5496 1.21071 11.0409 1.58579 10.6658C1.96086 10.2907 2.46957 10.08 3 10.08H3.09C3.42099 10.0723 3.742 9.96512 4.0113 9.77251C4.28059 9.5799 4.48572 9.31074 4.6 9C4.73312 8.69838 4.77282 8.36381 4.714 8.03941C4.65519 7.71502 4.50054 7.41568 4.27 7.18L4.21 7.12C4.02405 6.93425 3.87653 6.71368 3.77588 6.47088C3.67523 6.22808 3.62343 5.96783 3.62343 5.705C3.62343 5.44217 3.67523 5.18192 3.77588 4.93912C3.87653 4.69632 4.02405 4.47575 4.21 4.29C4.39575 4.10405 4.61632 3.95653 4.85912 3.85588C5.10192 3.75523 5.36217 3.70343 5.625 3.70343C5.88783 3.70343 6.14808 3.75523 6.39088 3.85588C6.63368 3.95653 6.85425 4.10405 7.04 4.29L7.1 4.35C7.33568 4.58054 7.63502 4.73519 7.95941 4.794C8.28381 4.85282 8.61838 4.81312 8.92 4.68H9C9.29577 4.55324 9.54802 4.34276 9.72569 4.07447C9.90337 3.80618 9.99872 3.49179 10 3.17V3C10 2.46957 10.2107 1.96086 10.5858 1.58579C10.9609 1.21071 11.4696 1 12 1C12.5304 1 13.0391 1.21071 13.4142 1.58579C13.7893 1.96086 14 2.46957 14 3V3.09C14.0013 3.41179 14.0966 3.72618 14.2743 3.99447C14.452 4.26276 14.7042 4.47324 15 4.6C15.3016 4.73312 15.6362 4.77282 15.9606 4.714C16.285 4.65519 16.5843 4.50054 16.82 4.27L16.88 4.21C17.0657 4.02405 17.2863 3.87653 17.5291 3.77588C17.7719 3.67523 18.0322 3.62343 18.295 3.62343C18.5578 3.62343 18.8181 3.67523 19.0609 3.77588C19.3037 3.87653 19.5243 4.02405 19.71 4.21C19.896 4.39575 20.0435 4.61632 20.1441 4.85912C20.2448 5.10192 20.2966 5.36217 20.2966 5.625C20.2966 5.88783 20.2448 6.14808 20.1441 6.39088C20.0435 6.63368 19.896 6.85425 19.71 7.04L19.65 7.1C19.4195 7.33568 19.2648 7.63502 19.206 7.95941C19.1472 8.28381 19.1869 8.61838 19.32 8.92V9C19.4468 9.29577 19.6572 9.54802 19.9255 9.72569C20.1938 9.90337 20.5082 9.99872 20.83 10H21C21.5304 10 22.0391 10.2107 22.4142 10.5858C22.7893 10.9609 23 11.4696 23 12C23 12.5304 22.7893 13.0391 22.4142 13.4142C22.0391 13.7893 21.5304 14 21 14H20.91C20.5882 14.0013 20.2738 14.0966 20.0055 14.2743C19.7372 14.452 19.5268 14.7042 19.4 15Z" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> </svg> Real-time Monitoring </h2> <div class="checkbox-group"> <div class="checkbox-item"> <input type="checkbox" id="price-alerts" class="checkbox-input" checked> <label for="price-alerts" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">Price Change Alerts</span> <span class="checkbox-desc">Get notified when securities exceed your threshold</span> </div> </label> </div> <div class="checkbox-item"> <input type="checkbox" id="volatility-monitoring" class="checkbox-input" checked> <label for="volatility-monitoring" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">Volatility Monitoring</span> <span class="checkbox-desc">Track market volatility in your portfolio</span> </div> </label> </div> <div class="checkbox-item"> <input type="checkbox" id="news-impact" class="checkbox-input"> <label for="news-impact" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">News Impact Analysis</span> <span class="checkbox-desc">See how news affects your holdings</span> </div> </label> </div> <div class="checkbox-item"> <input type="checkbox" id="earning-reports" class="checkbox-input" checked> <label for="earning-reports" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">Earnings Report Alerts</span> <span class="checkbox-desc">Notifications before company earnings calls</span> </div> </label> </div> </div> </div> <div class="settings-section"> <h2> <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4 4H20C21.1 4 22 4.9 22 6V18C22 19.1 21.1 20 20 20H4C2.9 20 2 19.1 2 18V6C2 4.9 2.9 4 4 4Z" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M22 6L12 13L2 6" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> </svg> Reporting & Notifications </h2> <div class="checkbox-group"> <div class="checkbox-item"> <input type="checkbox" id="weekly-summary" class="checkbox-input" checked> <label for="weekly-summary" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">Weekly Portfolio Summary</span> <span class="checkbox-desc">Get performance updates every Friday</span> </div> </label> </div> <div class="checkbox-item"> <input type="checkbox" id="tax-documents" class="checkbox-input" checked> <label for="tax-documents" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">Tax Document Alerts</span> <span class="checkbox-desc">Notify when tax forms are available</span> </div> </label> </div> <div class="checkbox-item"> <input type="checkbox" id="dividend-alerts" class="checkbox-input"> <label for="dividend-alerts" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">Dividend Announcements</span> <span class="checkbox-desc">Alerts for upcoming dividend payments</span> </div> </label> </div> <div class="checkbox-item"> <input type="checkbox" id="market-summary" class="checkbox-input"> <label for="market-summary" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">Market Open/Close Summary</span> <span class="checkbox-desc">Daily overview at market open and close</span> </div> </label> </div> </div> </div> <div class="settings-section"> <h2> <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M12 20V21" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M12 3V4" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M20 12H21" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M3 12H4" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M17.657 6.343L18.364 5.636" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M5.63599 18.364L6.34299 17.657" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M17.657 17.657L18.364 18.364" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M5.63599 5.636L6.34299 6.343" stroke="#1B3A57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> </svg> Advanced Features </h2> <div class="checkbox-group"> <div class="checkbox-item"> <input type="checkbox" id="ai-insights" class="checkbox-input"> <label for="ai-insights" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">AI Market Insights</span> <span class="checkbox-desc">ML-powered analysis of your investments</span> </div> </label> </div> <div class="checkbox-item"> <input type="checkbox" id="portfolio-rebalance" class="checkbox-input" checked> <label for="portfolio-rebalance" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">Auto-Rebalance Notifications</span> <span class="checkbox-desc">Alerts when portfolio drifts from targets</span> </div> </label> </div> <div class="checkbox-item"> <input type="checkbox" id="esg-screening" class="checkbox-input"> <label for="esg-screening" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">ESG Risk Screening</span> <span class="checkbox-desc">Environmental and social risk analysis</span> </div> </label> </div> <div class="checkbox-item"> <input type="checkbox" id="dark-mode" class="checkbox-input" checked> <label for="dark-mode" class="checkbox-wrapper"> <span class="checkbox-custom"></span> <div class="checkbox-label"> <span class="checkbox-title">Dark Mode Trading Hours</span> <span class="checkbox-desc">Auto-switch to dark mode during market hours</span> </div> </label> </div> </div> </div> <div class="settings-actions"> <button id="resetBtn" class="reset-btn">Reset to Defaults</button> <button id="saveBtn" class="save-btn"> Save Preferences <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M20 6L9 17L4 12" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> </button> </div> </div> </div> <div class="status-message" id="statusMessage"> <svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M20 6L9 17L4 12" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> <span id="statusText">Settings successfully saved</span> </div> <script> // Cache DOM elements const saveBtn = document.getElementById('saveBtn'); const resetBtn = document.getElementById('resetBtn'); const statusMessage = document.getElementById('statusMessage'); const statusText = document.getElementById('statusText'); const saveAnimation = document.getElementById('saveAnimation'); const checkboxes = document.querySelectorAll('.checkbox-input'); // Default checkbox states const defaults = { 'price-alerts': true, 'volatility-monitoring': true, 'news-impact': false, 'earning-reports': true, 'weekly-summary': true, 'tax-documents': true, 'dividend-alerts': false, 'market-summary': false, 'ai-insights': false, 'portfolio-rebalance': true, 'esg-screening': false, 'dark-mode': true }; // Show status message function showStatus(message, type = 'success') { statusText.textContent = message; statusMessage.className = 'status-message ' + type; statusMessage.classList.add('visible'); setTimeout(() => { statusMessage.classList.remove('visible'); }, 3000); } // Save settings with animation saveBtn.addEventListener('click', () => { // Start progress animation saveAnimation.classList.add('active'); // Simulate processing delay setTimeout(() => { saveAnimation.classList.remove('active'); const savedItems = []; checkboxes.forEach(checkbox => { if (checkbox.checked) { const label = document.querySelector(`label[for="${checkbox.id}"] .checkbox-title`).textContent; savedItems.push(label); } }); if (savedItems.length > 0) { showStatus(`Settings successfully saved (${savedItems.length} items enabled)`); } else { showStatus('All monitoring features disabled', 'error'); } }, 800); }); // Reset to defaults resetBtn.addEventListener('click', () => { // Shake animation for any checkbox being reset checkboxes.forEach(checkbox => { const shouldBeChecked = defaults[checkbox.id]; if (checkbox.checked !== shouldBeChecked) { const checkboxItem = checkbox.closest('.checkbox-item'); checkboxItem.classList.add('error'); setTimeout(() => { checkboxItem.classList.remove('error'); checkbox.checked = shouldBeChecked; }, 400); } else { checkbox.checked = shouldBeChecked; } }); showStatus('Settings reset to default values'); }); // Add focus effect on tab navigation document.addEventListener('keydown', function(e) { if (e.key === 'Tab') { document.body.classList.add('keyboard-focus'); } }); document.addEventListener('mousedown', function() { document.body.classList.remove('keyboard-focus'); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Gaming Platform Toggle Checkboxes</title> <style> :root { --primary-color: #ff3366; --secondary-color: #6633ff; --accent-color: #33ccff; --dark-color: #1a1a2e; --light-color: #f0f0f0; --success-color: #00ff99; --danger-color: #ff3333; --warning-color: #ffcc00; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Rajdhani', 'Orbitron', sans-serif; } body { background-color: var(--dark-color); color: var(--light-color); display: flex; justify-content: center; align-items: center; min-height: 100vh; overflow-x: hidden; padding: 20px; background-image: radial-gradient(circle at 10% 20%, rgba(102, 51, 255, 0.1) 0%, transparent 50%), radial-gradient(circle at 90% 80%, rgba(255, 51, 102, 0.1) 0%, transparent 50%); } .container { width: 100%; max-width: 650px; background-color: rgba(18, 18, 30, 0.85); border-radius: 12px; padding: 30px; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5); position: relative; overflow: hidden; backdrop-filter: blur(10px); border: 1px solid rgba(102, 51, 255, 0.2); } .container::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(45deg, transparent 30%, rgba(102, 51, 255, 0.1) 40%, rgba(255, 51, 102, 0.1) 60%, transparent 70%); background-size: 200% 200%; animation: borderGlow 6s linear infinite; z-index: -1; } @keyframes borderGlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } h1 { font-size: 2.2rem; margin-bottom: 10px; text-align: center; letter-spacing: 2px; font-weight: 700; color: var(--light-color); position: relative; text-transform: uppercase; } h1::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 80px; height: 4px; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)); border-radius: 2px; } .subtitle { text-align: center; color: #a0a0c0; margin-bottom: 30px; font-size: 1rem; } .checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; } @media (max-width: 580px) { .checkbox-grid { grid-template-columns: 1fr; } } .toggle-item { padding: 15px; border-radius: 8px; background-color: rgba(26, 26, 46, 0.8); transition: all 0.3s ease; cursor: pointer; position: relative; overflow: hidden; border: 1px solid rgba(102, 51, 255, 0.1); } .toggle-item:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3); border-color: rgba(102, 51, 255, 0.3); } .toggle-item::before { content: ''; position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px; z-index: -1; border-radius: 10px; background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color)); opacity: 0; transition: opacity 0.3s ease; } .toggle-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .toggle-title { font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 10px; } .toggle-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; } .toggle-icon svg { width: 100%; height: 100%; } .toggle-description { font-size: 0.85rem; color: #a0a0c0; line-height: 1.4; margin-bottom: 10px; } .toggle-input { position: absolute; opacity: 0; height: 0; width: 0; } .toggle-switch { position: relative; display: inline-block; width: 50px; height: 26px; flex-shrink: 0; } .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(60, 60, 90, 0.3); transition: 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); clip-path: polygon(0 30%, 10% 0, 90% 0, 100% 30%, 100% 70%, 90% 100%, 10% 100%, 0 70%); } .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); clip-path: polygon(0 30%, 10% 0, 90% 0, 100% 30%, 100% 70%, 90% 100%, 10% 100%, 0 70%); } .toggle-input:checked + .slider { background-image: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); } .toggle-input:checked + .slider:before { transform: translateX(24px); } .toggle-input:checked ~ .toggle-item::before { opacity: 0.15; } .toggle-status { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; color: #a0a0c0; transition: all 0.3s ease; } .toggle-input:checked ~ .toggle-status { color: var(--success-color); } /* Item specific colors */ .item-1 .toggle-input:checked + .slider { background-image: linear-gradient(135deg, #ff3366, #6633ff); } .item-2 .toggle-input:checked + .slider { background-image: linear-gradient(135deg, #33ccff, #00ff99); } .item-3 .toggle-input:checked + .slider { background-image: linear-gradient(135deg, #ffcc00, #ff3366); } .item-4 .toggle-input:checked + .slider { background-image: linear-gradient(135deg, #00ff99, #6633ff); } .item-5 .toggle-input:checked + .slider { background-image: linear-gradient(135deg, #ff3366, #ffcc00); } .item-6 .toggle-input:checked + .slider { background-image: linear-gradient(135deg, #6633ff, #33ccff); } /* Glitch effect on toggle */ @keyframes glitch { 0% { transform: translate(0); } 20% { transform: translate(-2px, 2px); } 40% { transform: translate(-2px, -2px); } 60% { transform: translate(2px, 2px); } 80% { transform: translate(2px, -2px); } 100% { transform: translate(0); } } .toggle-input:checked ~ .glitch-effect { animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; } /* Particles effect */ .particles { position: absolute; top: 50%; right: 0; width: 50px; height: 20px; pointer-events: none; opacity: 0; transition: opacity 0.2s ease; } .toggle-input:checked ~ .particles { opacity: 1; } .particle { position: absolute; width: 4px; height: 4px; border-radius: 2px; background-color: var(--accent-color); opacity: 0; } .footer { margin-top: 30px; text-align: center; font-size: 0.85rem; color: #a0a0c0; padding-top: 20px; border-top: 1px solid rgba(102, 51, 255, 0.1); } .applied-settings { margin-top: 25px; background-color: rgba(26, 26, 46, 0.8); border-radius: 8px; padding: 15px; position: relative; overflow: hidden; border: 1px solid rgba(102, 51, 255, 0.1); } .applied-title { font-size: 1rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; } .applied-list { list-style-type: none; display: flex; flex-wrap: wrap; gap: 10px; } .applied-item { background-color: rgba(102, 51, 255, 0.15); padding: 6px 12px; border-radius: 30px; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(102, 51, 255, 0.3); animation: fadeIn 0.3s ease; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .action-buttons { display: flex; justify-content: center; gap: 15px; margin-top: 25px; } .btn { border: none; padding: 12px 24px; background-color: transparent; color: var(--light-color); font-size: 0.9rem; font-weight: 600; cursor: pointer; border-radius: 6px; transition: all 0.3s ease; position: relative; overflow: hidden; letter-spacing: 1px; text-transform: uppercase; z-index: 1; } .btn::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); z-index: -1; transition: all 0.3s ease; } .btn-secondary::before { background: linear-gradient(135deg, #3a3a5a, #2d2d45); } .btn:hover { transform: translateY(-3px); box-shadow: 0 7px 15px rgba(0, 0, 0, 0.3); } .btn:active { transform: translateY(0); } .applied-empty { color: #a0a0c0; font-style: italic; font-size: 0.9rem; } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } } .pulse { animation: pulse 2s infinite; } @keyframes glowBorder { 0% { border-color: rgba(102, 51, 255, 0.3); } 50% { border-color: rgba(255, 51, 102, 0.5); } 100% { border-color: rgba(102, 51, 255, 0.3); } } .applied-settings.has-items { border-color: rgba(102, 51, 255, 0.3); animation: glowBorder 3s infinite; } </style> </head> <body> <div class="container"> <h1>Game Settings</h1> <p class="subtitle">Customize your gaming experience with these advanced options</p> <div class="checkbox-grid"> <label class="toggle-item item-1"> <div class="toggle-header"> <span class="toggle-title"> <span class="toggle-icon"> <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M10.5 16L14.5 12L10.5 8" stroke="#ff3366" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12Z" stroke="#ff3366" stroke-width="2"/> </svg> </span> Ultra Performance Mode </span> <span class="toggle-switch"> <input type="checkbox" class="toggle-input"> <span class="slider"></span> </span> </div> <p class="toggle-description">Overclocks your GPU for maximum FPS with dynamic resource allocation. May increase system temperature.</p> <div class="toggle-status glitch-effect">DISABLED</div> <div class="particles"></div> </label> <label class="toggle-item item-2"> <div class="toggle-header"> <span class="toggle-title"> <span class="toggle-icon"> <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z" stroke="#33ccff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M18.7273 14.7273C18.6063 15.0909 18.6273 15.4818 18.7891 15.8318C18.9509 16.1818 19.2418 16.4636 19.6 16.6C19.9582 16.7364 20.3491 16.7573 20.7182 16.6618C21.0873 16.5664 21.4091 16.3591 21.6364 16.0727C21.8636 15.7864 21.9855 15.4318 21.9855 15.0682C21.9855 14.7045 21.8636 14.35 21.6364 14.0636C21.4091 13.7773 21.0873 13.57 20.7182 13.4745C20.3491 13.3791 19.9582 13.4 19.6 13.5364L18 12L19.6 10.4636C19.9582 10.6 20.3491 10.6209 20.7182 10.5255C21.0873 10.43 21.4091 10.2227 21.6364 9.93636C21.8636 9.65 21.9855 9.29545 21.9855 8.93182C21.9855 8.56818 21.8636 8.21364 21.6364 7.92727C21.4091 7.64091 21.0873 7.43364 20.7182 7.33818C20.3491 7.24273 19.9582 7.26364 19.6 7.4C19.2418 7.53636 18.9509 7.81818 18.7891 8.16818C18.6273 8.51818 18.6063 8.90909 18.7273 9.27273" stroke="#33ccff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M5.27273 14.7273C5.39373 15.0909 5.37273 15.4818 5.21091 15.8318C5.04909 16.1818 4.75818 16.4636 4.4 16.6C4.04182 16.7364 3.65091 16.7573 3.28182 16.6618C2.91273 16.5664 2.59091 16.3591 2.36364 16.0727C2.13636 15.7864 2.01455 15.4318 2.01455 15.0682C2.01455 14.7045 2.13636 14.35 2.36364 14.0636C2.59091 13.7773 2.91273 13.57 3.28182 13.4745C3.65091 13.3791 4.04182 13.4 4.4 13.5364L6 12L4.4 10.4636C4.04182 10.6 3.65091 10.6209 3.28182 10.5255C2.91273 10.43 2.59091 10.2227 2.36364 9.93636C2.13636 9.65 2.01455 9.29545 2.01455 8.93182C2.01455 8.56818 2.13636 8.21364 2.36364 7.92727C2.59091 7.64091 2.91273 7.43364 3.28182 7.33818C3.65091 7.24273 4.04182 7.26364 4.4 7.4C4.75818 7.53636 5.04909 7.81818 5.21091 8.16818C5.37273 8.51818 5.39373 8.90909 5.27273 9.27273" stroke="#33ccff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M9.27273 5.27273C8.90909 5.39373 8.51818 5.37273 8.16818 5.21091C7.81818 5.04909 7.53636 4.75818 7.4 4.4C7.26364 4.04182 7.24273 3.65091 7.33818 3.28182C7.43364 2.91273 7.64091 2.59091 7.92727 2.36364C8.21364 2.13636 8.56818 2.01455 8.93182 2.01455C9.29545 2.01455 9.65 2.13636 9.93636 2.36364C10.2227 2.59091 10.43 2.91273 10.5255 3.28182C10.6209 3.65091 10.6 4.04182 10.4636 4.4L12 6L13.5364 4.4C13.4 4.04182 13.3791 3.65091 13.4745 3.28182C13.57 2.91273 13.7773 2.59091 14.0636 2.36364C14.35 2.13636 14.7045 2.01455 15.0682 2.01455C15.4318 2.01455 15.7864 2.13636 16.0727 2.36364C16.3591 2.59091 16.5664 2.91273 16.6618 3.28182C16.7573 3.65091 16.7364 4.04182 16.6 4.4C16.4636 4.75818 16.1818 5.04909 15.8318 5.21091C15.4818 5.37273 15.0909 5.39373 14.7273 5.27273" stroke="#33ccff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M9.27273 18.7273C8.90909 18.6063 8.51818 18.6273 8.16818 18.7891C7.81818 18.9509 7.53636 19.2418 7.4 19.6C7.26364 19.9582 7.24273 20.3491 7.33818 20.7182C7.43364 21.0873 7.64091 21.4091 7.92727 21.6364C8.21364 21.8636 8.56818 21.9855 8.93182 21.9855C9.29545 21.9855 9.65 21.8636 9.93636 21.6364C10.2227 21.4091 10.43 21.0873 10.5255 20.7182C10.6209 20.3491 10.6 19.9582 10.4636 19.6L12 18L13.5364 19.6C13.4 19.9582 13.3791 20.3491 13.4745 20.7182C13.57 21.0873 13.7773 21.4091 14.0636 21.6364C14.35 21.8636 14.7045 21.9855 15.0682 21.9855C15.4318 21.9855 15.7864 21.8636 16.0727 21.6364C16.3591 21.4091 16.5664 21.0873 16.6618 20.7182C16.7573 20.3491 16.7364 19.9582 16.6 19.6C16.4636 19.2418 16.1818 18.9509 15.8318 18.7891C15.4818 18.6273 15.0909 18.6063 14.7273 18.7273" stroke="#33ccff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> </svg> </span> Ray Tracing </span> <span class="toggle-switch"> <input type="checkbox" class="toggle-input"> <span class="slider"></span> </span> </div> <p class="toggle-description">Enables advanced light rendering for photorealistic reflections and shadows. Requires RTX-compatible hardware.</p> <div class="toggle-status glitch-effect">DISABLED</div> <div class="particles"></div> </label> <label class="toggle-item item-3"> <div class="toggle-header"> <span class="toggle-title"> <span class="toggle-icon"> <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M21 13.5V8C21 6.89543 20.1046 6 19 6H5C3.89543 6 3 6.89543 3 8V14C3 15.1046 3.89543 16 5 16H8.5" stroke="#ffcc00" stroke-width="2" stroke-linecap="round"/> <path d="M14 19H19" stroke="#ffcc00" stroke-width="2" stroke-linecap="round"/> <path d="M16.5 16.5V21.5" stroke="#ffcc00" stroke-width="2" stroke-linecap="round"/> <path d="M8 16V13M8 13V10H11V13H8Z" stroke="#ffcc00" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M16 13V10" stroke="#ffcc00" stroke-width="2" stroke-linecap="round"/> <path d="M13 10L13 13" stroke="#ffcc00" stroke-width="2" stroke-linecap="round"/> <path d="M16 10C16 10 16 9.27273 16 9.27273C16 8.56982 15.4302 8 14.7273 8C14.0244 8 13.4545 8.56982 13.4545 9.27273C13.4545 10 13.4545 10 13.4545 10" stroke="#ffcc00" stroke-width="2"/> </svg> </span> Stream-Ready Mode </span> <span class="toggle-switch"> <input type="checkbox" class="toggle-input"> <span class="slider"></span> </span> </div> <p class="toggle-description">Optimizes video encoding and VRAM usage for streaming while gaming. Reduces background processes for stable bitrate.</p> <div class="toggle-status glitch-effect">DISABLED</div> <div class="particles"></div> </label> <label class="toggle-item item-4"> <div class="toggle-header"> <span class="toggle-title"> <span class="toggle-icon"> <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M9.5 9.5L14.5 14.5" stroke="#00ff99" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M14.5 9.5L9.5 14.5" stroke="#00ff99" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12Z" stroke="#00ff99" stroke-width="2"/> <path d="M13.5 7.5L16.5 7.5" stroke="#00ff99" stroke-width="2" stroke-linecap="round"/> <path d="M7.5 16.5L10.5 16.5" stroke="#00ff99" stroke-width="2" stroke-linecap="round"/> </svg> </span> Aim Assist </span> <span class="toggle-switch"> <input type="checkbox" class="toggle-input"> <span class="slider"></span> </span> </div> <p class="toggle-description">Subtle targeting enhancement for controller players. Provides small correction within a 5° cone of intended target.</p> <div class="toggle-status glitch-effect">DISABLED</div> <div class="particles"></div> </label> <label class="toggle-item item-5"> <div class="toggle-header"> <span class="toggle-title"> <span class="toggle-icon"> <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M19.7274 10.5L17.2274 8L19.7274 5.5" stroke="#ff3366" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M4.27271 5.5L6.77271 8L4.27271 10.5" stroke="#ff3366" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M17.2274 8H6.77271" stroke="#ff3366" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M17 16H7C5.89543 16 5 16.8954 5 18C5 19.1046 5.89543 20 7 20H17C18.1046 20 19 19.1046 19 18C19 16.8954 18.1046 16 17 16Z" stroke="#ff3366" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M14 16V14C14 12.8954 13.1046 12 12 12C10.8954 12 10 12.8954 10 14V16" stroke="#ff3366" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> </svg> </span> Low Latency Mode </span> <span class="toggle-switch"> <input type="checkbox" class="toggle-input"> <span class="slider"></span> </span> </div> <p class="toggle-description">Reduces input lag by 40% using frame pre-rendering limitations. Optimal for competitive FPS and fighting games.</p> <div class="toggle-status glitch-effect">DISABLED</div> <div class="particles"></div> </label> <label class="toggle-item item-6"> <div class="toggle-header"> <span class="toggle-title"> <span class="toggle-icon"> <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M9 3.5V2M5.5 5.5L4.5 4.5M12.5 5.5L13.5 4.5M5.5 9H4M12.5 9H14" stroke="#6633ff" stroke-width="2" stroke-linecap="round"/> <path d="M9 14.5C11.4853 14.5 13.5 12.4853 13.5 10C13.5 7.51472 11.4853 5.5 9 5.5C6.51472 5.5 4.5 7.51472 4.5 10C4.5 12.4853 6.51472 14.5 9 14.5Z" stroke="#6633ff" stroke-width="2"/> <path d="M9 22C13.9706 22 18 17.9706 18 13C18 8.02944 13.9706 4 9 4C4.02944 4 0 8.02944 0 13C0 17.9706 4.02944 22 9 22Z" stroke="#6633ff" stroke-width="2"/> <path d="M16 18L23 21" stroke="#6633ff" stroke-width="2" stroke-linecap="round"/> <path d="M20 10.5C20 10.5 22 11.5 22 13C22 14.5 20 15.5 20 15.5" stroke="#6633ff" stroke-width="2" stroke-linecap="round"/> </svg> </span> DLSS/FSR Upscaling </span> <span class="toggle-switch"> <input type="checkbox" class="toggle-input"> <span class="slider"></span> </span> </div> <p class="toggle-description">AI-powered resolution scaling for maximum performance with minimal quality loss. Renders at lower resolution then upscales with ML algorithms.</p> <div class="toggle-status glitch-effect">DISABLED</div> <div class="particles"></div> </label> </div> <div class="applied-settings"> <div class="applied-title"> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#00ff99" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> </svg> Active Enhancements </div> <div class="applied-list-container"> <ul class="applied-list"> <li class="applied-empty">No settings applied yet</li> </ul> </div> </div> <div class="action-buttons"> <button class="btn btn-primary" id="save-settings">APPLY SETTINGS</button> <button class="btn btn-secondary" id="reset-settings">RESET ALL</button> </div> <div class="footer"> Settings are automatically saved to your cloud profile </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const toggleInputs = document.querySelectorAll('.toggle-input'); const appliedList = document.querySelector('.applied-list'); const appliedSettings = document.querySelector('.applied-settings'); const saveBtn = document.getElementById('save-settings'); const resetBtn = document.getElementById('reset-settings'); // Object to store setting names const settingNames = { 0: "Ultra Performance Mode", 1: "Ray Tracing", 2: "Stream-Ready Mode", 3: "Aim Assist", 4: "Low Latency Mode", 5: "DLSS/FSR Upscaling" }; // Function to create particles function createParticles(container) { // Clear any existing particles container.innerHTML = ''; // Create new particles for (let i = 0; i < 10; i++) { const particle = document.createElement('div'); particle.classList.add('particle'); // Random position const top = Math.random() * 20; const left = Math.random() * 50; particle.style.top = `${top}px`; particle.style.left = `${left}px`; // Random color from our palette const colors = ['#ff3366', '#6633ff', '#33ccff', '#00ff99', '#ffcc00']; const color = colors[Math.floor(Math.random() * colors.length)]; particle.style.backgroundColor = color; // Set animation particle.style.animation = `particleAnim ${0
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> :root { --primary: #4F46E5; --primary-light: #818CF8; --primary-dark: #4338CA; --background: #F5F7FA; --text: #1F2937; --text-light: #6B7280; --danger: #EF4444; --success: #10B981; --warning: #F59E0B; --neutral: #9CA3AF; --shadow: rgba(0, 0, 0, 0.08); } * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; } body { background-color: var(--background); color: var(--text); display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; } .privacy-panel { width: 100%; max-width: 650px; background-color: white; border-radius: 16px; box-shadow: 0 10px 25px var(--shadow); overflow: hidden; position: relative; } .panel-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); padding: 25px 30px; color: white; position: relative; overflow: hidden; } .panel-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; position: relative; z-index: 2; } .panel-header p { font-size: 14px; opacity: 0.9; max-width: 80%; position: relative; z-index: 2; } .panel-header::before { content: ''; position: absolute; top: -20px; right: -20px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); } .panel-header::after { content: ''; position: absolute; bottom: -40px; left: 20px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); } .panel-body { padding: 25px 30px; } .section { margin-bottom: 28px; } .section-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; } .section-title svg { margin-right: 8px; color: var(--primary); } .checkbox-group { margin-bottom: 18px; } .checkbox-container { display: flex; align-items: flex-start; margin-bottom: 14px; } .checkbox-container:last-child { margin-bottom: 0; } .checkbox-custom { position: relative; margin-right: 12px; margin-top: 2px; } .checkbox-custom input { opacity: 0; position: absolute; width: 0; height: 0; } .checkbox-mark { display: inline-block; width: 22px; height: 22px; background-color: white; border: 2px solid var(--neutral); border-radius: 6px; transition: all 0.2s ease-in-out; position: relative; cursor: pointer; } .checkbox-mark::after { content: ''; position: absolute; display: none; left: 7px; top: 3px; width: 6px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); } /* Different color states */ .privacy-critical .checkbox-mark { border-color: var(--danger); } .privacy-important .checkbox-mark { border-color: var(--warning); } .privacy-standard .checkbox-mark { border-color: var(--primary); } /* Checked states */ .checkbox-custom input:checked + .checkbox-mark { background-color: var(--primary); border-color: var(--primary); } .privacy-critical input:checked + .checkbox-mark { background-color: var(--danger); border-color: var(--danger); } .privacy-important input:checked + .checkbox-mark { background-color: var(--warning); border-color: var(--warning); } .checkbox-custom input:checked + .checkbox-mark::after { display: block; } /* Hover states */ .checkbox-mark:hover { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); } .privacy-critical .checkbox-mark:hover { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); } .privacy-important .checkbox-mark:hover { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1); } .checkbox-label { font-size: 14px; color: var(--text); } .checkbox-label .main-text { font-weight: 500; margin-bottom: 2px; } .checkbox-label .sub-text { font-size: 12px; color: var(--text-light); line-height: 1.4; } .privacy-level { display: inline-flex; align-items: center; margin-left: 8px; font-size: 11px; font-weight: 500; color: white; padding: 2px 6px; border-radius: 10px; } .level-critical { background-color: var(--danger); } .level-important { background-color: var(--warning); } .level-standard { background-color: var(--primary); } .action-buttons { display: flex; justify-content: space-between; margin-top: 30px; } .button { padding: 10px 16px; font-size: 14px; font-weight: 500; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; border: none; } .primary-button { background-color: var(--primary); color: white; box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2); } .primary-button:hover { background-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(79, 70, 229, 0.25); } .secondary-button { background-color: white; color: var(--text); border: 1px solid var(--neutral); } .secondary-button:hover { background-color: var(--background); } .preset-buttons { display: flex; gap: 10px; margin-bottom: 20px; } .preset-button { padding: 8px 12px; border-radius: 6px; font-size: 12px; background-color: white; border: 1px solid var(--neutral); color: var(--text); cursor: pointer; transition: all 0.15s ease; } .preset-button:hover { border-color: var(--primary-light); color: var(--primary); } .preset-button.active { background-color: var(--primary); color: white; border-color: var(--primary); } .notification { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background-color: white; padding: 16px 20px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); display: flex; align-items: center; z-index: 1000; opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; } .notification.show { transform: translateX(-50%) translateY(0); opacity: 1; } .notification-icon { margin-right: 12px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: white; background-color: var(--success); border-radius: 50%; } .notification-message { font-size: 14px; color: var(--text); } @media (max-width: 600px) { .panel-header { padding: 20px; } .panel-body { padding: 20px; } .section-title { font-size: 15px; } .preset-buttons { flex-wrap: wrap; } .preset-button { font-size: 11px; padding: 6px 10px; } .action-buttons { flex-direction: column-reverse; gap: 10px; } .button { width: 100%; } } /* Privacy score gauge */ .privacy-score { margin: 20px 0; display: flex; align-items: center; justify-content: space-between; } .gauge-container { width: 70%; position: relative; } .gauge-bg { height: 10px; width: 100%; background-color: #f3f4f6; border-radius: 10px; position: relative; overflow: hidden; } .gauge-fill { position: absolute; top: 0; left: 0; height: 100%; width: 0%; background: linear-gradient(90deg, var(--danger), var(--warning) 50%, var(--success) 100%); border-radius: 10px; transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); } .gauge-marker { position: absolute; top: -6px; left: 0%; width: 22px; height: 22px; background-color: white; border: 3px solid var(--primary); border-radius: 50%; transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); transform: translateX(-50%); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); } .score-display { display: flex; flex-direction: column; align-items: center; width: 70px; margin-left: 15px; } .score-number { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1; transition: color 0.3s ease; } .score-label { font-size: 12px; color: var(--text-light); margin-top: 4px; } /* Toggle checkbox animation */ @keyframes checkboxPulse { 0% { transform: scale(1); } 50% { transform: scale(0.9); } 100% { transform: scale(1); } } .checkbox-custom input:checked + .checkbox-mark { animation: checkboxPulse 0.3s ease-in-out; } </style> </head> <body> <div class="privacy-panel"> <div class="panel-header"> <h1>Privacy Control Center</h1> <p>Customize who sees your content and how your personal data is used</p> </div> <div class="panel-body"> <div class="preset-buttons"> <button class="preset-button" data-preset="minimal">Minimal Sharing</button> <button class="preset-button active" data-preset="balanced">Balanced (Recommended)</button> <button class="preset-button" data-preset="social">Full Social Experience</button> <button class="preset-button" data-preset="custom">Custom</button> </div> <div class="privacy-score"> <div class="gauge-container"> <div class="gauge-bg"> <div class="gauge-fill" id="privacyGaugeFill"></div> </div> <div class="gauge-marker" id="privacyGaugeMarker"></div> </div> <div class="score-display"> <div class="score-number" id="privacyScore">70</div> <div class="score-label">Privacy</div> </div> </div> <div class="section"> <div class="section-title"> <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path> <circle cx="9" cy="7" r="4"></circle> <path d="M23 21v-2a4 4 0 0 0-3-3.87"></path> <path d="M16 3.13a4 4 0 0 1 0 7.75"></path> </svg> Content Visibility & Profile </div> <div class="checkbox-group"> <div class="checkbox-container"> <div class="checkbox-custom privacy-standard"> <input type="checkbox" id="profileVisibility" checked> <span class="checkbox-mark"></span> </div> <div class="checkbox-label"> <div class="main-text">Allow others to find my profile</div> <div class="sub-text">Your profile can appear in search results and be discovered by others based on shared connections</div> </div> </div> <div class="checkbox-container"> <div class="checkbox-custom privacy-important"> <input type="checkbox" id="photoVisibility" checked> <span class="checkbox-mark"></span> </div> <div class="checkbox-label"> <div class="main-text">Public photo visibility <span class="privacy-level level-important">Important</span></div> <div class="sub-text">Allow your photos to be visible to people who aren't connected to you</div> </div> </div> <div class="checkbox-container"> <div class="checkbox-custom privacy-critical"> <input type="checkbox" id="locationSharing"> <span class="checkbox-mark"></span> </div> <div class="checkbox-label"> <div class="main-text">Location tagging in posts <span class="privacy-level level-critical">Critical</span></div> <div class="sub-text">Automatically attach precise location data when posting content</div> </div> </div> </div> </div> <div class="section"> <div class="section-title"> <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect> <path d="M7 11V7a5 5 0 0 1 10 0v4"></path> </svg> Data Usage & Analytics </div> <div class="checkbox-group"> <div class="checkbox-container"> <div class="checkbox-custom privacy-standard"> <input type="checkbox" id="cookieConsent" checked> <span class="checkbox-mark"></span> </div> <div class="checkbox-label"> <div class="main-text">Accept essential cookies</div> <div class="sub-text">Necessary for site functionality and security (cannot be disabled)</div> </div> </div> <div class="checkbox-container"> <div class="checkbox-custom privacy-important"> <input type="checkbox" id="analyticsConsent" checked> <span class="checkbox-mark"></span> </div> <div class="checkbox-label"> <div class="main-text">Analytics cookies <span class="privacy-level level-important">Important</span></div> <div class="sub-text">Help us improve our platform by collecting anonymous usage data</div> </div> </div> <div class="checkbox-container"> <div class="checkbox-custom privacy-important"> <input type="checkbox" id="adPersonalization" checked> <span class="checkbox-mark"></span> </div> <div class="checkbox-label"> <div class="main-text">Personalized advertising <span class="privacy-level level-important">Important</span></div> <div class="sub-text">Allow targeted ads based on your activity and interests</div> </div> </div> </div> </div> <div class="section"> <div class="section-title"> <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <circle cx="12" cy="12" r="10"></circle> <circle cx="12" cy="12" r="4"></circle> <line x1="4.93" y1="4.93" x2="19.07" y2="19.07"></line> </svg> Third-Party Sharing </div> <div class="checkbox-group"> <div class="checkbox-container"> <div class="checkbox-custom privacy-critical"> <input type="checkbox" id="dataSharing"> <span class="checkbox-mark"></span> </div> <div class="checkbox-label"> <div class="main-text">Share data with partners <span class="privacy-level level-critical">Critical</span></div> <div class="sub-text">Allow sharing your profile information with trusted third-party partners</div> </div> </div> <div class="checkbox-container"> <div class="checkbox-custom privacy-critical"> <input type="checkbox" id="aiTraining" checked> <span class="checkbox-mark"></span> </div> <div class="checkbox-label"> <div class="main-text">Content for AI training <span class="privacy-level level-critical">Critical</span></div> <div class="sub-text">Allow your non-private content to be used for improving AI recommendation systems</div> </div> </div> </div> </div> <div class="action-buttons"> <button class="button secondary-button" id="resetButton">Reset to Default</button> <button class="button primary-button" id="saveButton">Save Preferences</button> </div> </div> </div> <div class="notification" id="notification"> <div class="notification-icon"> <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"> <polyline points="20 6 9 17 4 12"></polyline> </svg> </div> <div class="notification-message" id="notificationMessage">Privacy settings updated successfully!</div> </div> <script> document.addEventListener('DOMContentLoaded', function() { // Get all checkboxes const checkboxes = document.querySelectorAll('input[type="checkbox"]'); const saveButton = document.getElementById('saveButton'); const resetButton = document.getElementById('resetButton'); const notification = document.getElementById('notification'); const notificationMessage = document.getElementById('notificationMessage'); const presetButtons = document.querySelectorAll('.preset-button'); const privacyGaugeFill = document.getElementById('privacyGaugeFill'); const privacyGaugeMarker = document.getElementById('privacyGaugeMarker'); const privacyScore = document.getElementById('privacyScore'); // Current preset let currentPreset = 'balanced'; // Default presets const presets = { minimal: { profileVisibility: true, photoVisibility: false, locationSharing: false, cookieConsent: true, analyticsConsent: false, adPersonalization: false, dataSharing: false, aiTraining: false }, balanced: { profileVisibility: true, photoVisibility: true, locationSharing: false, cookieConsent: true, analyticsConsent: true, adPersonalization: true, dataSharing: false, aiTraining: true }, social: { profileVisibility: true, photoVisibility: true, locationSharing: true, cookieConsent: true, analyticsConsent: true, adPersonalization: true, dataSharing: true, aiTraining: true } }; // Apply initial preset applyPreset('balanced'); // Calculate and update the privacy score function updatePrivacyScore() { // Assign weights to each setting (critical items have higher weight) const weights = { profileVisibility: 5, photoVisibility: 10, locationSharing: 20, cookieConsent: 5, analyticsConsent: 10, adPersonalization: 15, dataSharing: 20, aiTraining: 15 }; // Calculate the score (unchecked boxes contribute to higher privacy) let totalWeight = 0; let privacyPoints = 0; Object.keys(weights).forEach(key => { const checkbox = document.getElementById(key); totalWeight += weights[key]; if (!checkbox.checked) { privacyPoints += weights[key]; } }); // Convert to a 0-100 scale const score = Math.round((privacyPoints / totalWeight) * 100); // Update the gauge and score privacyGaugeFill.style.width = `${score}%`; privacyGaugeMarker.style.left = `${score}%`; privacyScore.textContent = score; // Update score color based on value if (score < 30) { privacyScore.style.color = 'var(--danger)'; } else if (score < 70) { privacyScore.style.color = 'var(--warning)'; } else { privacyScore.style.color = 'var(--success)'; } // Check if current settings match any preset let matchesPreset = null; Object.keys(presets).forEach(preset => { const presetSettings = presets[preset]; let matches = true; Object.keys(presetSettings).forEach(key => { const checkbox = document.getElementById(key); if (checkbox.checked !== presetSettings[key]) { matches = false; } }); if (matches) { matchesPreset = preset; } }); // Update preset buttons presetButtons.forEach(button => { button.classList.remove('active'); if (matchesPreset && button.dataset.preset === matchesPreset) { button.classList.add('active'); currentPreset = matchesPreset; } else if (!matchesPreset && button.dataset.preset === 'custom') { button.classList.add('active'); currentPreset = 'custom'; } }); } // Apply a preset configuration function applyPreset(preset) { if (presets[preset]) { const presetSettings = presets[preset]; Object.keys(presetSettings).forEach(key => { const checkbox = document.getElementById(key); if (checkbox) { checkbox.checked = presetSettings[key]; } }); // Update active button presetButtons.forEach(button => { button.classList.remove('active'); if (button.dataset.preset === preset) { button.classList.add('active'); } }); currentPreset = preset; updatePrivacyScore(); } } // Show notification with custom message function showNotification(message) { notificationMessage.textContent = message; notification.classList.add('show'); setTimeout(() => { notification.classList.remove('show'); }, 3000); } // Add event listeners to all checkboxes checkboxes.forEach(checkbox => { checkbox.addEventListener('change', () => { if (checkbox.id === 'cookieConsent') { // Essential cookies can't be disabled if (!checkbox.checked) { checkbox.checked = true; showNotification('Essential cookies cannot be disabled'); } } updatePrivacyScore(); }); }); // Add event listeners to preset buttons presetButtons.forEach(button => { button.addEventListener('click', () => { const preset = button.dataset.preset; if (preset !== 'custom') { applyPreset(preset); } }); }); // Save button event listener saveButton.addEventListener('click', () => { // In a real implementation, this would send data to a server showNotification('Privacy settings saved successfully!'); }); // Reset button event listener resetButton.addEventListener('click', () => { applyPreset('balanced'); showNotification('Settings reset to recommended defaults'); }); // Initial privacy score calculation updatePrivacyScore(); }); </script> </body> </html>