c语言上下跳动的小球,CSS实现小球跳动效果

CSS实现小球跳动效果

.bound {

animation-duration: 1s;

}

.ball {

animation-duration: .75s;

}

.dot {

animation-duration: .25s;

}

.dot {

top: 100%;

height: 50%;

width: 50%;

background-color: #fff;

transform: translate(0,-50%);

animation-name: drop;

}

.ball {

top: 100%;

height: 50%;

width: 50%;

transform: translate(0,-50%);

animation-name: drop,roundround;

}

.bound {

top: 0;

animation-name: playalong,roundround;

}

.wrapper {

position: relative;

margin: auto;

width: 100%;

overflow: hidden;

}

.wrapper:before {

content: "";

display: block;

padding-top: 100%;

}

.bound,.ball,.dot {

position: absolute;

margin: auto;

animation-delay: 0;

animation-direction: alternate;

animation-iteration-count: infinite;

animation-timing-function: ease-in-out;

animation-play-state: running;

right: 0%;

bottom: 0%;

left: 0%;

border-radius: 50%;

}

body {

margin: 0;

background: black;

}

* {

Box-sizing: border-Box;

}

@keyframes playalong {

from {

height: 100%;

width: 100%;

}

to {

height: 10%;

width: 10%;

}

}

@keyframes roundround {

to {

transform: rotate(360deg);

}

}

@keyframes drop {

to {

top: 0%;

bottom: 80%;

transform: scale(.25);

}

}

@media (orientation: landscape) {

.wrapper {

width: 100vh;

}

}

@media (orientation: portrait) {

.wrapper {

top: 50%;

-ms-transform:translateY(-50%);

-webkit-transform:translateY(-50%);

-moz-transform:translateY(-50%);

-o-transform:translateY(-50%);

transform:translateY(-50%);

}

body{

height:100vh;

}

}

@-ms-viewport {

width: device-width;

}

@viewport {

zoom: 1.0;

width: device-width;

}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值