CSS

语言:

CSSSCSS

确定

body {

background-color: MidnightBlue;

}

.sun {

position: absolute;

left: 30%;

top: 150px;

}

.sun > * {

position: absolute;

top: 0;

left: 0;

}

.sun .ball {

width: 40px;

min-height: 40px;

height: 40px;

border-radius: 20px;

background-color: Goldenrod;

}

.sun .ray {

background-color: OrangeRed;

border-radius: 3px;

width: 40px;

min-height: 40px;

}

.sun .ray:first-of-type {

-webkit-animation: sunShineRotatedRay 8s 0s linear infinite both;

animation: sunShineRotatedRay 8s 0s linear infinite both;

}

.sun .ray:nth-child(2) {

-webkit-animation: sunShineRegularRay 8s 0s linear infinite both;

animation: sunShineRegularRay 8s 0s linear infinite both;

}

@-webkit-keyframes sunShineRegularRay {

to {

-webkit-transform: rotate(360deg);

transform: rotate(360deg);

}

}

@keyframes sunShineRegularRay {

to {

-webkit-transform: rotate(360deg);

transform: rotate(360deg);

}

}

@-webkit-keyframes sunShineRotatedRay {

from {

-webkit-transform: rotate(45deg);

transform: rotate(45deg);

}

to {

-webkit-transform: rotate(405deg);

transform: rotate(405deg);

}

}

@keyframes sunShineRotatedRay {

from {

-webkit-transform: rotate(45deg);

transform: rotate(45deg);

}

to {

-webkit-transform: rotate(405deg);

transform: rotate(405deg);

}

}

.stars,

.home {

position: absolute;

top: 0;

left: 0;

width: 100%;

min-height: 100%;

}

.stars {

background-color: MidnightBlue;

}

.star {

background-color: White;

position: absolute;

-webkit-animation: starTwinkle 25s 0s ease infinite both;

animation: starTwinkle 25s 0s ease infinite both;

}

.small-star {

width: 2px;

min-height: 2px;

height: 2px;

border-radius: 1px;

}

.big-star {

width: 4px;

min-height: 4px;

height: 4px;

border-radius: 2px;

}

.home {

background-color: transparent;

display: -webkit-box;

display: -webkit-flex;

display: -ms-flexbox;

display: flex;

-webkit-box-align: center;

-webkit-align-items: center;

-ms-flex-align: center;

align-items: center;

-webkit-box-pack: center;

-webkit-justify-content: center;

-ms-flex-pack: center;

justify-content: center;

}

.earth {

width: 100px;

min-height: 100px;

height: 100px;

border-radius: 50px;

background: Teal;

position: static;

}

.moon {

width: 20px;

min-height: 20px;

height: 20px;

border-radius: 10px;

background-color: LightSlateGray;

-webkit-animation: moonOrbit 5s 0s infinite linear;

animation: moonOrbit 5s 0s infinite linear;

-webkit-transform-origin: 100px 50%;

-ms-transform-origin: 100px 50%;

transform-origin: 100px 50%;

margin-right: 30px;

}

.moon .crater {

background-color: DimGray;

position: absolute;

}

.crater.big-crater {

width: 6px;

min-height: 6px;

height: 6px;

border-radius: 3px;

top: 2px;

left: 8px;

}

.crater.small-crater {

width: 3px;

min-height: 3px;

height: 3px;

border-radius: 1.5px;

top: 12px;

left: 2px;

}

@-webkit-keyframes starTwinkle {

0% {

opacity: .5;

}

50% {

opacity: .2;

}

100% {

opacity: .6;

}

}

@keyframes starTwinkle {

0% {

opacity: .5;

}

50% {

opacity: .2;

}

100% {

opacity: .6;

}

}

@-webkit-keyframes moonOrbit {

from {

-webkit-transform: rotateZ(0deg);

transform: rotateZ(0deg);

}

to {

-webkit-transform: rotateZ(360deg);

transform: rotateZ(360deg);

}

}

@keyframes moonOrbit {

from {

-webkit-transform: rotateZ(0deg);

transform: rotateZ(0deg);

}

to {

-webkit-transform: rotateZ(360deg);

transform: rotateZ(360deg);

}

}

html中怎么制作太阳月亮交替,CSS3 简单的地球/太阳/月亮动画相关推荐

  1. html中怎么制作太阳月亮交替,使用纯CSS实现太阳和地球和月亮运转模型动画的方法...

    使用纯CSS实现太阳和地球和月亮运转模型动画的方法 发布时间:2020-09-22 10:42:05 来源:亿速云 阅读:140 作者:小新 使用纯CSS实现太阳和地球和月亮运转模型动画的方法?这个问 ...

  2. html制作透明正方形,用css3简单的制作3d半透明立方体图片详解

    new document //css部分 html{ font-size:62.5%; } img{ width:300px; height:300px; } #stage{ //搭建一个舞台 mar ...

  3. android圆形变方形动画,CSS3 简单的圆形/方形变形动画

    CSS 语言: CSSSCSS 确定 html, body { width: 100%; height: 100%; background-color: #221e40; } *, *:after, ...

  4. css 文字 3d旋转动画,CSS3 简单的三维文字旋转动画

    CSS 语言: CSSSCSS 确定 *, *:after, *:before { box-sizing: border-box; } html { height: 100vh; background ...

  5. CSS3打造的10种创意动画菜单效果

    CSS3新增添了实现动画效果的新功能,通过本文,你可以对这些新功能有个初步了解.本文将为大家带来一些充满创意的菜单悬停效果.它由图标,主标题,副标题等简单的元素构成,通过CSS3最新的过渡(trans ...

  6. opengl: 太阳地球和月亮

    // Solar.c // OpenGL SuperBible // Demonstrates OpenGL nested coordinate transformations // and pers ...

  7. MATLAB-实现太阳、地球、月亮三者之间运转关系的模拟

    例题:宇宙中存在着诸多的天体,以行星地球为例,地球绕着太阳进行公转,同时自身进行着自转.同样的,月亮在围绕地球旋转的同时自身也在自转.为了问题的简单化,假设太阳处于固定位置,且自身只有自转,只考虑太阳 ...

  8. openGL绘制带纹理太阳、地球、月亮,并且地球自转并且围绕太阳旋转。月亮自转也会围绕地球旋转

    openGL系列文章目录 前言 使用openGL绘制太阳.地球.月亮,太阳自转,地球自转并且围绕太阳旋转.月亮自转也会围绕地球旋转,其实月亮也会围绕太阳旋转的. 一.效果 还是有不满意的地方: 1.没 ...

  9. Three.js - 模拟太阳、地球、月亮的运动(十一)

    简介 本节我们简单的模拟地球绕着太阳转,月球绕着地球转.从月球的角度看,它是在地球的 "局部空间 "中绕着地球转,地球和月球合成一组是在全局空间绕着太阳转. 基础场景 <!D ...

最新文章

  1. 使用Apache TVM将机器学习编译为WASM和WebGPU
  2. 揭秘!Greenplum并行执行引擎到底是如何工作的?
  3. SQL------Hint
  4. 为什么说线索二叉树是一种物理结构
  5. php session修改时间,PHP如何修改SESSION有效时间?
  6. java程序员高薪持续的原因有哪些
  7. 借助opencv将unsigned char数组显示为图像
  8. 天呐,这群“员工”的业务能力太强了
  9. JAVA中用于处理字符串的 三兄弟
  10. 【译】Part 1: 介绍和安装
  11. ubuntu执行python脚本_在启动时运行python脚本作为守护进程(Ubuntu)
  12. 《tcpip详解》卷一第2章
  13. MMORPG开发入门
  14. 【Power BI+Excel+Python】2019年4月全国数据分析招聘岗位可视化分析
  15. 光盘如何重装系统教程
  16. 营救(广度优先搜索)题解
  17. fftw3/gsl/kissfft/OouraFFT库中傅里叶变换/反傅里叶变换函数和Matlab中的fft/ifft的对应关系
  18. 完整的 Markdown 新手指南
  19. 面向对象案例:学生管理系统
  20. 光模块自动测试系统软件,一种用于测试光模块的多通道自动测试方法及系统

热门文章

  1. 【开餐馆】 动态规划
  2. 4G IoT设备开发,一板搞定
  3. 大数据分析工具Power BI(一):Power BI介绍
  4. html5做ui自动化,案例赏析:某WEB系统UI自动化测试方案
  5. iOS基础 获取状态栏的高度
  6. getLocation需要在app.json中声明permission字段
  7. easyuefi如何添加引导_easyuefi怎么用?easyuefi基本使用方法介绍
  8. Core.bitwise_and()函数解释
  9. 内核网络协议栈offload功能盘点
  10. 信奥中的数学之入门组(面向小学四年级至六年级以及初一学生)