html and css in one script. only code
- User
html and css in one script. only code
Assistant
Here's a standalone HTML/CSS/JS volume fader (0-600) with custom styling in one script:
<!DOCTYPE html> <html> <head> <title>Volume Fader</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background: #1a1a1a; color: white; font-family: 'Arial', sans-serif; } .volume-slider-container { text-align: center; padding: 20px; background: #2d2d2d; border-radius: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.3); } input[type="range"] { -webkit-appearance: none; width: 300px; margin: 15px 0; background: transparent; height: 8px; border-radius: 4px; outline: none; } /* Track */ input[type="range"]::-webkit-slider-track { background: #444; border-radius: 4px; } /* Thumb */ input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; background: #ff6b6b; border-radius: 50%; cursor: pointer; transition: 0.2s; box-shadow: 0 0 5px rgba(255,107,107,0.7); } input[type="range"]::-webkit-slider-thumb:hover { background: #ff4e4e; } .volume-display { font-size: 2em; margin: 20px 0; color: #ff6b6b; } </style> </head> <body> <div class="volume-slider-container"> <input type="range" min="0" max="600" value="300" class="volume-slider" > <div class="volume-display" id="volumeDisplay">300</div> </div> <script> const slider = document.querySelector('.volume-slider'); const display = document.getElementById('volumeDisplay'); slider.addEventListener('input', function() { const value = Math.round(this.value); display.textContent = value; // Add your actual volume control logic here // Example: setVolume(value); }); </script> </body> </html>Features included:
- Dark mode styling with neon accents
- Smooth slider thumb with hover effect
- Real-time volume display
- Responsive layout
- Custom slider track and thumb styling
- Smooth transitions
- Modern aesthetic
To use:
- Save this code as an .html file
- Open in any modern browser
- Drag the slider to see the value change between 0-600
The slider thumb has a red accent color (#ff6b6b) with a subtle shadow effect. The volume value is displayed in large text below the slider. You can modify the colors and dimensions in the CSS section to match your preferences.
The JavaScript part updates the displayed value in real-time as you drag the slider. You'll need to add your actual volume control logic where indicated (replace the comment with your implementation).
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.