/*
optical effect
The diagonal black lines are parallel, but they look like they are not. Mouse over to reveal
*/
@property --color {
syntax: '<color>';
initial-value: #f00;
inherits: true;
}
body {
--color: #000;
margin: 0;
font-size: 1vmax;
height: 100vh;
overflow: hidden;
transition: --color 1s;
background: #fd5;
}
body:hover {
--color: #0000;
}
body::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
translate: -50% -50%;
width: 300em;
height: 300em;
background:
repeating-linear-gradient(#0000 0 18em, #000 0 20em),
conic-gradient(at 1em 8em, #0000 75%, var(--color) 0) 0 -5em / 2em 20em;
transform: skewY(-45deg);
}
body::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
translate: -50% -50%;
width: 300em;
height: 300em;
background:
repeating-linear-gradient(#0000 0 18em, #000 0 20em),
conic-gradient(at 1em 8em, #0000 75%, var(--color) 0) 0 -5em / 2em 20em;
transform: rotate(90deg) skewY(45deg) translate(0.25em, 12em);
}
- Colors / Themes: Change canvas color via
background: #fd5 on body. Adjust illusion tile color --color: #000 and initial value initial-value: #f00 inside @property --color. Tweak hover reveal state via --color: #0000. - Gradients & Visual Effects: Modify grid line spacing by editing
repeating-linear-gradient(#0000 0 18em, #000 0 20em) stop offsets. Alter distortion block positioning through conic-gradient(at 1em 8em, #0000 75%, var(--color) 0) 0 -5em / 2em 20em inside pseudo-elements. - Sizing, Layout & Scales: Change viewport scale density via
font-size: 1vmax on body. Adjust tilt severity by modifying transform: skewY(-45deg) on body::before and transform: rotate(90deg) skewY(45deg) on body::after.