SVG 模拟太阳 地球 月亮旋转

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="800px">
<defs>
<g id="E" transform="translate(-340,-90)">
<path id="path2" d="M390,80 h 0 a50,19 0 1,0 1,1 z" fill="none" stroke="blue" stroke-width="1"/>
<circle cx="0" cy="0" r="5" fill="white" stroke="black" stroke-width="1" >
<animateMotion dur="1s" repeatCount="indefinite">
<mpath xlink:href="#path2" />
</animateMotion>
</circle>
</g>
<radialGradient id="sunfill" cx="50%" cy="50%" r="100%">
<stop stop-color="red" offset="0%" stop-opacity="1"/>
<stop stop-color="blue" offset="95%" stop-opacity="1"/>
<stop stop-color="yellow" offset="100%" stop-opacity="1"/>
</radialGradient>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="black" />
<circle cx="660" cy="250" r="60" fill="red" />
<path id="path1" d="M1200,200 h 0 a600,200 0 1,0 1,1 z" fill="none" stroke="white" stroke-width="1"/>
<use x="0" y="0" xlink:href="#E">
<animateMotion dur="3s" repeatCount="indefinite" >
<mpath xlink:href="#path1" />
</animateMotion>
</use>
</svg>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值