CODEPEN:
Github:https://github.com/furkangulsen98/HTML-CSS-JAVASCRIPT/tree/master/Growing%20Card%20Flip
HTML CODE:
<div class="container">
<div class="card">
<div class="front">
Front
</div>
<div class="back">
Back
</div>
</div>
</div>
CSS CODE:
body{
background: #eee;
padding: 0;
margin: 0;
}
.container{
font-family: Verdana;
font-weight: bold;
font-size: 75px;
width: 400px;
height: 250px;
border-radius: 10px;
perspective: 1400px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.card {
position: relative;
height: 100%;
border-radius: 10px;
width: 100%;
transform-style: preserve-3d;
transition-delay: 1s;
transition: 1s ease-in-out;
cursor: pointer;
}
.front, .back {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
backface-visibility: hidden;
border-radius: 10px;
text-align: center;
}
.back {
color: #fff;
background: #bc2828;
transform: rotateY(180deg);
}
.front {
position: absolute;
top: 0;
left: 0;
background: #fff;
color: #bc2828;
}
.card.active {
transform: rotateY(180deg) rotateX(360deg) scale(2.5);
}
JS CODE:
let card = document.querySelector(".card");
card.addEventListener("click", function () {
card.classList.toggle("active");
});
At this time it looks like WordPress is the top blogging platform
out there right now. (from what I’ve read) Is that
what you are using on your blog?
LikeLike