html5——动画案例(太阳系)
太阳系主要利用定位,伪元素
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
* {
padding: 0;
margin: 0;
} html, body {
width: 100%;
height: 100%;
overflow: hidden;
} body {
background-color: #000;
} .sun {
width: 80px;
height: 80px;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
margin-left: -40px;
margin-top: -40px;
background-color: orange;
box-shadow: 0px 0px 30px 2px yellow;
} .earth {
width: 300px;
height: 300px;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
margin-left: -150px;
margin-top: -150px;
border: 1px solid #fff;
animation: gun 10s infinite linear;
} .earth::before {
content: "";
position: absolute;
width: 40px;
height: 40px;
top: 50%;
margin-top: -20px;
left: -20px;
border-radius: 50%;
background-color: blue;
} .moon {
position: absolute;
width: 100px;
height: 100px;
top: 50%;
margin-top: -50px;
left: -50px;
border-radius: 50%;
/*border: 1px solid #fff;*/
animation: gun 2.5s infinite linear;
} .moon:before {
content: "";
position: absolute;
width: 18px;
height: 18px;
top: 50%;
margin-top: -9px;
left: -9px;
border-radius: 50%;
background-color: silver;
} .mars {
width: 460px;
height: 460px;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
margin-left: -230px;
margin-top: -230px;
border: 1px solid #fff;
animation: gun 15s infinite linear;
} .mars::before {
content: "";
position: absolute;
width: 50px;
height: 50px;
top: 50%;
margin-top: -25px;
left: -25px;
border-radius: 50%;
background-color: orange;
} .venus {
width: 600px;
height: 600px;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
margin-left: -300px;
margin-top: -300px;
border: 1px solid #fff;
animation: gun 20s infinite linear;
} .venus::before {
content: "";
position: absolute;
width: 60px;
height: 60px;
top: 50%;
margin-top: -30px;
left: -30px;
border-radius: 50%;
background-color: silver;
} @keyframes gun {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="sun"></div>
<div class="earth">
<div class="moon"></div>
</div>
<div class="mars"></div>
<div class="venus"></div>
</body>
</html>
参考资料:cssRules js操作cssRules
html5——动画案例(太阳系)的更多相关文章
- html5——动画案例(时钟)
1.秒钟转360度需要60s分60步 2.分针转360度需要3600s分60步 3.秒钟转360度需要43200s分60步 <!DOCTYPE html> <html lang=&q ...
- html5——动画案例(无缝滚动)
无缝滚动:是两组拼在一起的 <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...
- html5——动画案例(大海)
太阳的发散效果主要是利用transform: scale(1.3),将物体变大 <!DOCTYPE html> <html lang="en"> <h ...
- 精选19款华丽的HTML5动画和实用案例
下面是本人收集的19款超酷HTML5动画和实用案例,觉得不错,分享给大家. 1.HTML5 Canvas火焰喷射动画效果 还记得以前分享过的一款HTML5烟花动画HTML5 Canvas烟花特效,今天 ...
- 使用css3的动画模拟太阳系行星公转
本文介绍使用css3的animation画一个太阳系行星公转的动画,再加以改进,讨论如何画椭圆的运行轨迹.然后分析京东和人人网使用animation的实际案例,最后结合css3的clip-path做一 ...
- HTML5 动画效果的多种实现方式
HTML5 动画效果的多种实现方式 1. CSS3 transform + transition https://www.w3.org/TR/css-transforms-1/ https://ww ...
- 给你推荐10款优秀的 HTML5 动画工具
HTML5 在过去三年快速增长,已经成为 Web 开发人员最喜欢的编程语言之一.强大的编程语言拥有开发更好的网页应用的能力. HTML5 中引入的新技术都非常好,像 Chrome.Firefox.Sa ...
- HTML5 Maker – 在线轻松制作 HTML5 动画效果
HTML5 Maker 是一个在线动画制作工具,帮助你使用 HTML,CSS 和 JavaScript 创建动态,互动的内容.它非常容易使用,同时可以帮你实现非常好的效果.它可以制作跨浏览器的动画内容 ...
- HTML5动画软件工具编辑器 HTML5动画分类 工具推荐
接下来介绍几款制作HTML5动画的工具,它们可以分为几类: 1.导出canvas动画: Flash CC(13.1).Animation.Radi 2.导出DIV+CSS3动画: HTML5 Make ...
随机推荐
- resin4开启jmx
https://blog.csdn.net/liuxiao723846/article/details/51321010 https://blog.csdn.net/u010342008/articl ...
- Hyper-v交换机添加出错解决方法
这个问题中文找不到解决方法,只能重新安装系统了 重新安装系统后,按照顺序操作,不要去动设备管理器中的东西,也不用动驱动,先删除虚拟机的网络连接,在删除虚拟交换机就可以了,没有再出现问题
- subclipse 和 eclipse结合遇到的问题
subclipse是eclipse的一个SVN插件.但是我在使用的时候不断的报出下面的错误: the applet is attempting to access the "exists&q ...
- Eclipse Java Build Path详解
Eclipse Java Build Path详解 1.设置"source folder"与"output folder". * source folder:存 ...
- windows 2008 64位在指定的 DSN 中,驱动程序和应用程序之间的体系结构不匹配
在本机32位环境中使用access数据库正常. 公布到server上时提示:在指定的 DSN 中,驱动程序和应用程序之间的体系结构不匹配 server是64位环境.windows 2008,64位的t ...
- 1. CountDiv 数数有几个 Compute number of integers divisible by k in range [a..b].
package com.code; public class Test05_1 { public static int solution(int A, int B, int K) { // handl ...
- #HDU 3790 最短路径问题 【Dijkstra入门题】
题目: 最短路径问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- Unity3D-碰撞測试
碰撞測试这个再游戏的开发中是非常有必要的.当敌人的攻击的时候,发生碰撞这时候就会造成一定的伤害,因此我们须要依据受到的伤害对用户的生命值进行控制,因此碰撞的測试是 我们在游戏的开发过程中须要的一种比較 ...
- Unity游戏小地图生成
孙广东 2015.6.25 这个在AssetStore上有几个不错的插件, 除了知道原理,能自己实现还是好的. 非常多插件是不会直接使用的.而是要依据自己项目的需求进行改动或者就是自己写. 那么我们 ...
- HDU 5325 Crazy Bobo(思路+dfs 记忆化)
Crazy Bobo Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Tota ...