Invert the colors
28. Ноябрь, 2021 в 16:38,
Нет комментариев
HTML+JS:
<script type="text/javascript">
var i=1;function colorTheme(){
if(i%2==0){
document.body.style.backgroundColor="white";
}
else{
document.body.style.backgroundColor="#313030";
document.body.style.color= white;
}
i++;
}
</script>
<br>
<button onclick="colorTheme()">Click me</button>
CSS:
.normal {
filter: invert(0%);
}
.inverted {
filter: invert(100%);
}