<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
.parent{
width: 100px;
height: 100px;
border: 10px solid black;
padding: 100px;
margin: 30px auto;
}
.son{
position: relative;
width: 100px;
height: 100px;
transition: 1s;
transform-style: preserve-3d;
perspective:500px;
transform-origin: center center 50px;
animation: 1s move6 5s both linear infinite;
}
.son div{
position: absolute;
width: 100px;
height: 100px;
}
.son div:nth-child(1){
animation: 1s move1 both;
}
.son div:nth-child(2){
animation: 1s move2 1s both;
}
.son div:nth-child(3){
animation: 1s move3 2s both;
}
.son div:nth-child(4){
animation: 1s move4 3s both;
}
.son div:nth-child(5){
animation: 1s move5 4s both;
}
.son div:nth-child(6){
background: yellow;
}
@keyframes move1 {
100%{
position: absolute;
top: -100px;
width: 100px;
height: 100px;
background: magenta;
transform-origin: bottom;
transform: rotateX(-90deg);
}
}
@keyframes move2 {
100%{
position: absolute;
left: -100px;
width: 100px;
height: 100px;
background: greenyellow;
transform-origin: right;
transform: rotateY(90deg);
}
}
@keyframes move3 {
100%{
position: absolute;
top: 100px;
width: 100px;
height: 100px;
background: lemonchiffon;
transform-origin: top;
transform: rotateX(90deg);
}
}
@keyframes move4 {
100%{
position: absolute;
left: 100px;
width: 100px;
height: 100px;
background: mediumblue;
transform-origin: left;
transform: rotateY(-90deg);
}
}
@keyframes move5 {
100%{
position: absolute;
width: 100px;
height: 100px;
background: lightcoral;
transform: translateZ(100px);
}
}
@keyframes move6 {
100%{
transform: rotateX(360deg) rotateY(360deg);
}
}
</style>
</head>
<body>
<div class="parent">
<div class="son">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
</div>
</body>
</html>
3d魔方动画
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 二零一零年~二零一七年,将近十年的时光,耗尽了我对生活的激情。现在的自己,颓废,失落,沉浸在自己的世界里,不敢走出...
- 由于眼部皮肤没有皮脂腺、汗腺,薄嫩程度是正常脸部皮肤的10分之1,外加每个人每天眨动约25000次 ,眼部要比脸部...