<script src="https://kit.fontawesome.com/a7e9f794eb.js" crossorigin="anonymous"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;800&display=swap" rel="stylesheet">
<div class="container">
<div class="block">
<div class="overlay"></div>
<div class="block--text">
<div class="text--head">Dreams</div>
<div class="text--quote">“All our dreams can come true, if we have the courage to pursue them.”</div>
<div class="text--person">Walt Disney</div>
</div>
</div>
<div class="block">
<div class="overlay"></div>
<div class="block--text">
<div class="text--head">Never Give Up</div>
<div class="text--quote">“It’s hard to beat a person who never gives up.”</div>
<div class="text--person">Babe Ruth</div>
</div>
</div>
<div class="block">
<div class="overlay"></div>
<div class="block--text">
<div class="text--head">Do it</div>
<div class="text--quote">“Do one thing every day that scares you.”</div>
<div class="text--person">Eleanor Roosevelt</div>
</div>
</div>
</div>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.container {
width: 100vw;
height: 100vh;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 20px;
font-family: "Montserrat", sans-serif;
}
.block {
width: 300px;
height: 300px;
margin: 20px;
position: relative;
overflow: hidden;
box-shadow: 2px 2px 15px 2px #111;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-position: center;
background-size: cover;
}
.block:nth-child(1) {
background-image: url("https://images.unsplash.com/photo-1595960684234-49d2a004e753?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=628&q=80");
}
.block:nth-child(2) {
background-image: url("https://images.unsplash.com/photo-1536602012356-86c345795580?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80");
}
.block:nth-child(3) {
background-image: url("https://images.unsplash.com/photo-1547469447-4afec158715b?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80");
}
.overlay {
z-index: 5;
width: 80%;
height: 100%;
background-color: rgba(139, 135, 135, 0.5);
transform: rotate(45deg) scaleY(2) scaleX(0);
transition: all 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
border-left: #fdca40 2px solid;
border-right: #fdca40 2px solid;
}
.block:hover .overlay {
transform: rotate(45deg) scaleY(2) scaleX(1);
}
.block--text {
position: absolute;
top: 25%;
width: 100%;
height: 100%;
padding: 20px;
color: antiquewhite;
transform-origin: bottom center;
transition: all 300ms ease-in;
z-index: 100;
opacity: 0;
transition: all 300ms 200ms ease-in;
}
.block:hover .block--text {
opacity: 1;
}
.text--head {
text-align: center;
font-weight: 600;
letter-spacing: 2px;
padding-bottom: 15px;
font-size: 20px;
text-transform: uppercase;
color: #fdca40;
}
.text--quote {
font-size: 14px;
line-height: 150%;
}
.text--person {
padding-top: 15px;
position: relative;
text-align: end;
color: #fdca40;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.