<div class="triangles">
<div class="triangle"></div>
<div class="triangle"></div>
<div class="triangle"></div>
<div class="triangle"></div>
</div>
* {
box-sizing: border-box;
}
html, body {
height: 100vh;
min-height: 100vh;
overflow: hidden;
}
html {
mix-blend-mode: overlay;
background-image: linear-gradient(
to bottom,
rgba(#ddd, 0.03) 0%,
transparent 100%
);
background-size: 50px 50px;
&:after {
content: "";
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-image: url(http://api.thumbr.it/whitenoise-100x100.png);
mix-blend-mode: multiply;
pointer-events: none;
opacity: 0.4;
z-index: 10;
}
}
body {
display: flex;
justify-content: center;
align-items: center;
background-image: linear-gradient(
to bottom right,
rgba(#da5a56, 0.9) 0%,
rgba(#2f5056, 0.8) 60%
);
&:before {
content: "";
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
mix-blend-mode: lighten;
border: 20px solid rgba(#2b2b2b, 0.3);
}
}
.triangles {
position: relative;
height: 350px;
width: 400px;
&:hover {
.triangle:not(:nth-child(4)) {
transform: translateX(13px) translateY(-10px) scale(.71);
}
}
}
.triangle {
position: absolute;
top: 0;
left: 0;
height: 0;
width: 0;
width: 400px;
height: 350px;
z-index: 1;
background-image: linear-gradient(to bottom right, #fefefe 0%, #36a6ca 60%);
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
mix-blend-mode: screen;
opacity: 0.7;
transition: 400ms ease transform;
transform-origin: 50% 50%;
&:nth-child(1) {
transform: translateY(-60px) translateX(30px);
}
&:nth-child(2) {
transform: translateY(-20px) translateX(-20px);
}
&:nth-child(3) {
transform: translateY(10px) translateX(30px);
}
&:nth-child(4) {
mix-blend-mode: normal;
background-image: linear-gradient(
to bottom right,
rgba(#da5a56, 0.9) 0%,
rgba(#2f5056, 0.8) 60%
);
border-left: 0;
border-right: 0;
border-bottom: 0;
width: 288px;
height: 251px;
transform: translateX(69px) translateY(39px);
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
z-index: 10;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.