效果如下图所示:
HTML代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HINGE</title>
<link rel="stylesheet" type="text/css" href="../lib/css/hinge.css"/>
</head>
<body>
<div class="box">Hinge SHUAI</div>
</body>
</html>
css代码:
body{
margin: 0;
padding: 0;
/* font-family: "Open Sans", sans-serif; */
display: flex;
height: 100vh;
align-items: center;
justify-content: center;
}
.box{
background-color: #3498db;
color: #fff;
padding: 10px 20px;
font-size: 80px;
font-weight: 900;
transform-origin: top left;
animation: hinge 2s ease-in-out;
}
@keyframes hinge{
20%,60%{
transform: rotate(70deg);
}
40%,80%{
transform: rotate(55deg);
opacity: 1;
}
100%{
transform: translateY(600px);
opacity: 0;
}
}