css3多变形,CSS3 多边形 球体随机运动

CSS

语言:

CSSSCSS

确定

.thing:nth-child(1) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -0.5s;

animation-delay: -0.5s;

}

.thing:nth-child(2) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -1s;

animation-delay: -1s;

}

.thing:nth-child(3) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -1.5s;

animation-delay: -1.5s;

}

.thing:nth-child(4) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -2s;

animation-delay: -2s;

}

.thing:nth-child(5) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -2.5s;

animation-delay: -2.5s;

}

.thing:nth-child(6) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -3s;

animation-delay: -3s;

}

.thing:nth-child(7) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -3.5s;

animation-delay: -3.5s;

}

.thing:nth-child(8) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -4s;

animation-delay: -4s;

}

.thing:nth-child(9) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -4.5s;

animation-delay: -4.5s;

}

.thing:nth-child(10) {

position: absolute;

width: 4rem;

height: 4rem;

background: transparent;

border-top-right-radius: 4rem;

border-top-left-radius: 4rem;

border-bottom-right-radius: 0;

border-bottom-left-radius: 4rem;

box-shadow: 1px 1px 3px rgba(66, 66, 66, 0.1);

border: 0.75rem solid #fff;

-webkit-animation: thing_animation 5s infinite linear;

animation: thing_animation 5s infinite linear;

-webkit-animation-delay: -5s;

animation-delay: -5s;

}

.thing:before {

position: absolute;

z-index: -1;

top: 100px;

left: 100px;

-webkit-transform: translate(-50%, -50%);

-ms-transform: translate(-50%, -50%);

transform: translate(-50%, -50%);

content: '';

display: inline-block;

width: 1.6rem;

height: 1.6rem;

border-radius: 1.6rem;

background: #474747;

-webkit-animation: thing2_animation 10s infinite linear;

animation: thing2_animation 10s infinite linear;

}

.thing:after {

position: absolute;

z-index: -1;

top: 60px;

left: 80px;

-webkit-transform: translate(-50%, -50%);

-ms-transform: translate(-50%, -50%);

transform: translate(-50%, -50%);

content: '';

display: inline-block;

width: 0.8rem;

height: 0.8rem;

border-radius: 0.8rem;

background: #949494;

-webkit-animation: thing3_animation 4s infinite linear;

animation: thing3_animation 4s infinite linear;

-webkit-animation-direction: reverse;

animation-direction: reverse;

}

@-webkit-keyframes thing_animation {

50% {

-webkit-transform: rotate(360deg);

transform: rotate(360deg);

}

}

@keyframes thing_animation {

50% {

-webkit-transform: rotate(360deg);

transform: rotate(360deg);

}

}

@-webkit-keyframes thing2_animation {

50% {

-webkit-transform: translateY(-500px) scale(0.1, 0.1);

transform: translateY(-500px) scale(0.1, 0.1);

}

}

@keyframes thing2_animation {

50% {

-webkit-transform: translateY(-500px) scale(0.1, 0.1);

transform: translateY(-500px) scale(0.1, 0.1);

}

}

@-webkit-keyframes thing3_animation {

50% {

-webkit-transform: translateX(300px) scale(0.1, 0.1);

transform: translateX(300px) scale(0.1, 0.1);

}

}

@keyframes thing3_animation {

50% {

-webkit-transform: translateX(300px) scale(0.1, 0.1);

transform: translateX(300px) scale(0.1, 0.1);

}

}

.wrap {

width: 5.5rem;

height: 5.5rem;

position: absolute;

top: 50%;

left: 50%;

-webkit-transform: translate(-2rem, -2rem);

-ms-transform: translate(-2rem, -2rem);

transform: translate(-2rem, -2rem);

}

.wrap:before {

position: absolute;

z-index: 10;

top: 50%;

left: 50%;

-webkit-transform: translate(-2rem, -2rem);

-ms-transform: translate(-2rem, -2rem);

transform: translate(-2rem, -2rem);

content: '';

display: block;

width: 4rem;

height: 4rem;

border-radius: 4rem;

background: tomato;

}

body {

background: #f2f2f2;

overflow: hidden;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值