SVG和CSS实现小风扇

1 篇文章 0 订阅

 HTML:

<div class="circleBox">
    <div class="circleInner">
	    <svg class="cir1" xmlns="http://www.w3.org/2000/svg" version="1.1">
	        <path d="M80 80 L50 7 L110 7 Z" fill="#0a763d" />
	        <path d="M50 7 S80 -7 110 7" fill="#0a763d"/>
	    </svg>
	    <svg class="cir2" xmlns="http://www.w3.org/2000/svg" version="1.1">
	    	<path d="M80 80 L50 7 L110 7 Z" fill="#0a763d" />
	        <path d="M50 7 S80 -7 110 7" fill="#0a763d"/>
	    </svg>
	    <svg class="cir3" xmlns="http://www.w3.org/666/svg" version="1.1">
		    <path d="M80 80 L50 7 L110 7 Z" fill="#0a763d" />
	        <path d="M50 7 S80 -7 110 7" fill="#0a763d"/>
	     </svg>
	</div>
</div>

 CSS:

.circleBox{
    margin: 0 650px;
    position: relative;
    width: 170px;
    height: 270px;
    overflow:hidden;
}
.circleInner{
    width: 160px;
    height: 160px;
    background: #2b8555;
    position: relative;
    border-radius: 50%;
    border: 5px solid #0a763d;
    animation: aa 0.3s infinite linear;
}
.circleBox::before{
    content: '';
    display: block;
    position: absolute;
    top: 150px;
    left: 70px;
    width: 30px;
    height: 150px;
    background: #0a763d;
    z-index: -1;
}
@keyframes aa{
	0 { transform: rotate(0deg)}
	50% { transform: rotate(180deg)}
	100% { transform: rotate(360deg)}
}
.cir1, .cir2, .cir3{
	position:absolute;
	top:0;
	left:0;
}
.cir2{transform: rotate(120deg); transform-origin: 80px 80px}
.cir3{transform: rotate(240deg); transform-origin: 80px 80px}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值