<div class="wrap">
hover me
<div class="box">
<h3>Blogarticle</h3>
</div>
</div>
body {
font-family: sans-serif;
display: flex;
width: 100vw;
overflow: hidden;
height: 100vh;
padding: 0;
margin: 0;
align-items: center;
justify-content: center;
}
:root {
--shadowSize: 25px;
--shadow: var(--shadowSize) var(--shadowSize) 0 2px rgba(255, 0, 0, 0.3),
calc(var(--shadowSize) * -1) calc(var(--shadowSize) * -1) 0 2px
rgba(0, 255, 0, 0.33);
--bigShadow: calc(var(--shadowSize) * 2) calc(var(--shadowSize) * 2) 0 2px
rgba(255, 0, 0, 0.5),
calc((var(--shadowSize) * 2) * -1) calc((var(--shadowSize) * 2) * -1) 0 2px
rgba(0, 255, 0, 0.5);
}
@keyframes appear {
0% {
opacity: 0;
transform: scale3d(9, 1, 1) translateX(-10vw);
box-shadow: var(--bigShadow);
}
40% {
box-shadow: none;
transform: scale3d(1, 1, 1) translateX(0);
}
45% {
opacity: 1;
transform: scale3d(0.35, 1.8, 1);
}
75% {
box-shadow: none;
transform: scale3d(0.35, 1.8, 1);
}
80% {
box-shadow: var(--shadow);
transform: scale3d(1.1, 1, 1);
}
85% {
transform: scale3d(1.4, 1, 1);
}
100% {
}
}
.box {
font-weight: 900;
display: flex;
align-items: center;
justify-content: center;
width: 350px;
background: white;
border: 2px solid black;
height: 250px;
transform-origin: 100% 50%;
}
.wrap {
padding: 200px;
&:hover,
&:active {
.box {
animation: appear 1s
cubic-bezier(0.77, 0.33, 1, 0.72)
1;
}
}
}
button {
position: fixed;
left: 10px;
top: 10px;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.