html太极旋转css,纯CSS3技术——制作一个旋转的太极

制作一个太极

效果就是下面这个样子的:

063fbcf68cb0faf8a87fa094a4f0e12b.gif

怎么样很帅吧~

嘿嘿~

首先还是分析一下如何实现这个图形,先来规划好位置~我们先来做一半,剩下的一半直接复制代码,修改一下参数就好了~

第一步:

首先由三个矩形,做好大致的骨架~

5ff758e3b95a3c61264e7a6720bd4cb1.png

第二步:

修改样式(形状、背景色等等)。

3b822cc94dda676b2bee6b09bb1746e4.png

(领会精神就好,这毕竟是个草图)

第三步:

完成另一半的制作并且添加动画效果。

063fbcf68cb0faf8a87fa094a4f0e12b.gif

这样我们的太极动画效果就完成了

是不是超级简单~

好的~现在我们开始动手操作吧~

先来规划一下图像的位置,(我们这边先设置一下border的值,方便我们观察,后面会清除掉的)

首先完成第一步

创建 div 标签

class="square">

class="inner_circle rect_one_one">

样式代码:

margin: 0; padding: 0; }body { width: 100vw; height: 100vh; overflow:

hidden;}.square{ width:400px; height:400px; position:relative;

margin:10% auto; border:1px #d2d2d2 solid;}.rect{ width:400px;

height:200px; position:relative; border:1px #d2d2d2

solid;}.inner_circle{ width:200px; height:200px; position:absolute;

z-index:1; border:1px #d2d2d2 solid;}.dot{ width:50px; height:50px;

position:absolute; left:0; right:0; top:0; bottom:0; margin:auto;

border:1px #d2d2d2 solid;}.rect_one_one{ bottom:-100px;

right:0;}

页面效果:

e004c81272f791f0bbfcb23efa9b542e.png

现在调整图形的形状和背景颜色

代码:

.inner_circle{

width:200px; height:200px; border-radius:200px; position:absolute;

z-index:1; border:1px #d2d2d2 solid;}.dot{ width:50px; height:50px;

position:absolute; left:0; right:0; top:0; bottom:0; margin:auto;

border-radius:50%; border:1px #d2d2d2 solid;}.rect_one{

border-radius:200px 200px 0 0; background:black;}.rect_one_one{

bottom:-100px; right:0; background:black;}.rect_one_two{

background:white;}

页面效果:

05d6b29806f6db1f57b15f4519d89d6c.png

现在我们努努力把另一半也做出来~(复制上面的代码和样式,修改部分参数,把我们做的辅助线清除掉)

c14a9d84a41a83b63542dcc1cb67c53c.png

现在就是重要的一步了,给它添加一个动画~

代码:

.square{

width:400px; height:400px; position:relative; margin:10% auto;

animation:rotate infinite linear 5s; -webkit-animation:rotate infinite

linear 5s; -moz-animation:rotate infinite linear 5s;}

@keyframes

rotate{ from{ transform:rotate(0deg); -webkit-transform:rotate(0deg);

}to{ transform:rotate(360deg); -webkit-transform:rotate(360deg);}

现在我们来回顾一下制作太极的全过程~

1ed4242c363e25bf46b0a802f30d5813.gif

那么我们的旋转太极就做好了

源代码已经贴在上面了

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值