css图形动画,CSS3 实现图形下落动画效果

  • Post author:
  • Post category:其他


先看效果

9723c3ba1917227fb90bb6ea39884e93.png

实现代码

* {

margin: 0;

padding: 0;

box-sizing: border-box;

}

body {

width: 100%;

height: auto;

background: #f90;

overflow: hidden;

}

.box {

width: 50px;

height: 50px;

background: #f70;

transform: rotate(45deg);

position: absolute;

box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);

}

.box1 {

left: calc(50% – 25px);

top: calc(100% – 75px);

animation: box1 cubic-bezier(1, 0, 0.45, 1.4) 2s 1;

}

.box2 {

left: calc(50% – 65px);

top: calc(100% – 115px);

animation: box2 cubic-bezier(1, 0, 0.45, 1.4) 2.5s 1;