微信小程序运用css实现摩天轮样式

效果样式及视频
在这里插入图片描述

摩天轮样式视频

1.wxml页面

<view class="new-member-gift">
    <!--摩天轮-->
    <view class="motel-box">
        <view class="motel-line1"></view>
        <view class="motel-line2"></view>
        <view class="motel-item motel-item01"></view>
        <view class="motel-item motel-item02"></view>
        <view class="motel-item motel-item03"></view>
        <view class="motel-item motel-item04"></view>
    </view>
</view>

2.wxss页面


.motel-box {
    position: relative;
    align-items: center;
    width: 500rpx;
    height: 500rpx;
    margin: 100rpx auto;
    border-radius: 500rpx;
    border: 2rpx solid #555;
    background: #eee;
    animation: xuanzuan 10s linear infinite;
}
.motel-line1 {
    width: 500rpx;
    height: 4rpx;
    background: #555;
    position: absolute;
    top: 50%;

}
.motel-line2 {
    width: 500rpx;
    height: 4rpx;
    background: #555;
    transform: rotate(90deg);
    position: absolute;
    top: 50%;

}
.motel-item {
    position: absolute;
    width: 100rpx;
    height: 100rpx;
    background: red;
}
.motel-item01 {
    top: -50rpx;
    left: 50%;
    margin-left: -50rpx;

    animation: xuanzuan 10s linear infinite reverse;
}
.motel-item02 {
    bottom: -50rpx;
    left: 50%;
    background: greenyellow;
    margin-left: -50rpx;
    animation: xuanzuan 10s linear infinite reverse;
}
.motel-item03 {
    top: 50%;
    right: -50rpx;
    background: rgb(10, 24, 221);
    margin-top: -50rpx;
    animation: xuanzuan 10s linear infinite reverse;

}
.motel-item04 {
    top: 50%;
    left:  -50rpx;
    background: rgb(146, 9, 226);
    margin-top: -50rpx;
    animation: xuanzuan 10s linear infinite reverse;

}
@keyframes xuanzuan {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

可以根据自己需求,将圈换成轮子图片等!

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值