CSS
По клику меняется цвет фона и текстовое содержимое. Без js.
by akogch
HTML
<input type="checkbox" />
<div class="section-1">
<h1>Don't click anywhere!</h1>
<h3>(By the way, are you using a webkit browser?)</h3>
<p>You never know what <strong>will happen.</strong></p>
</div>
<div class="section-2">
<h1>Well, looks like you clicked.</h1>
<h3>
Your parents must have been mad at you more than you think when you were a
child! ;)
</h3>
<p>
Hope you enjoy your time here. <strong>You can always click back.</strong>
</p>
</div>
SCSS
* {
-webkit-font-smoothing: antialiased;
}
@mixin section {
z-index: 10;
position: fixed;
height: 100%;
width: 100%;
top: 0;
pointer-events: none;
padding: 40px;
font-family: Helvetica, Arial;
}
html {
height: 100%;
margin: 0;
}
body {
height: 100%;
width: 100%;
margin: 0;
}
input[type=checkbox] {
-webkit-appearance: none;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
outline: none;
border: none;
display: block;
background-color: tomato;
transition: background-color 1s;
&:checked {
background-color: white;
transition: background-color 1s;
&~.section-2 {
display: block;
}
&~.section-1 {
display: none;
}
}
}
.section-1 {
display: block;
color: white;
@include section;
}
.section-2 {
display: none;
color: tomato;
@include section;
}