Process Flow
HTML
- Application of
type='range'andtype='color' - Set up of
data-*attribute
CSS
- Application of CSS variable
- Set up global variable inside
:root - Use
var(variable)to apply CSS variable
JavaScript
- For picking color, we can attach
changeevent - For scrolling the wheel, we can attach
mousemoveevent. - Solution 1
- Use
switchto bind DOM respectively - Use
style.propertyto change CSS style one by one
- Use
- Solution 2
- Use
setProperty()andLogical operators
- Use