旋转卡片出现动效(css)`
没话说,直接用
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>卡片旋转动效</title>
<style>
* {
margin: 0;
padding: 0;
}
.box {
width: 100vw;
height: 100vh;
position: fixed;
overflow: hidden;
color: #f5f5f5;
top: 0px;
left: 0px;
right: 0;
bottom: 0;
margin: auto;
}
.card {
position: absolute;
top: 300px;
left: 0px;
right: 0px;
bottom: auto;
margin: auto;
width: 266px;
height: 367px;
perspective: 1000px;
transform-style: preserve-3d;
transform: rotateY(180deg);
animation: roroZ .5s ease-in 1;
transform-origin: 50% 50%;
animation-fill-mode: forwards;
}
@keyframes roroZ {
0% {
transform: rotateY(180deg) scale(0.8);
}
60% {
transform: rotateY(360deg) scale3d(1.3, 1.3, 1);
}
100% {
transform: rotateY(360deg) scale3d(1, 1, 1);
}
}
</style>
</head>
<body>
<div class="box">
<img class="card " src="https://yun.duiba.com.cn/aurora/assets/fc94e140e51a765a65a06fde1ffc2ddcf15114aa.jpeg"
alt="">
</div>
</body>
</html>