之前写的h5css3动画——月食

逛codepen看到一些项目的时候就很想写,这个是特别喜欢,配色太戳我了,我就自己动了一动

效果图:

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>c3</title>

<style>
* {
box-sizing: border-box;
}

body {
background-color: #478a92;
overflow: hidden;
animation: bianse 18s infinite linear;
}

.diqiu {
width: 270px;
height: 270px;
border-radius: 50%;
background-color: #edffc0;
position: absolute;
left: 40%;
top: 20%;
/* box-shadow: 0px 0px 50px #fff; */
animation: diqiude 18s infinite linear;
}

.yue {
width: 270px;
height: 270px;
border-radius: 50%;
background-color: #478a92;
position: absolute;
margin-top: 118px;
transform: translate(10px);
/* box-shadow: inset 0px 0px 50px #478a92; */
animation: yundong 18s infinite linear;
}

@keyframes yundong {
0% {
transform: translate(200px);
background-color: #80d0dd;
}
15% {
background-color: #76c4d0;
}
35% {
background-color: #35737a;
transform: translate(350px);
}
50% {
background-color: #1d565c;
transform: translate(450px);
}
70% {
background-color: #1d565c;
transform: translate(550px);
}
85% {
background-color: #76c4d0;
transform: translate(680px);
}
100% {
background-color: #80d0dd;
transform: translate(760px);
}
}

@keyframes bianse {
0% {
background-color: #80d0dd;
}
15% {
background-color: #76c4d0;
}
35% {
background-color: #35737a;
}
50% {
background-color: #1d565c;
}
70% {
background-color: #1d565c;
}
85% {
background-color: #76c4d0;
}

100% {
background-color: #80d0dd;
}
}

@keyframes diqiude {
0% {
background-color: #edffb9;
}
15% {
background-color: #edffba;
}
35% {
background-color: #edffc3;
}
50% {
background-color: #edffc3;
box-shadow: 0px 0px 30px #EEE0E5;
}
85% {
background-color: #edffba;
box-shadow: 0px 0px 10px #EEE0E5;
}

100% {
background-color: #edffb9;
box-shadow: 0px 0px 0px;
}
}
</style>

<body>
<div class="diqiu">

</div>

<div class="yue"></div>

</body>

</html>

数值是真的很难调好。。。强迫症恨不得剁手→_→在此感谢codepen这个调色达人,好喜欢你的颜色,导致我写的时候就直接用了!3Q

时间: 2024-08-05 00:58:59

之前写的h5css3动画——月食的相关文章

纯css写一个带动画的弹框 visibility + opcity

css能实现各种各样的动态效果,比js实现简单,性能也比js实现高,现在我们就用纯css实现弹窗,主要用到了两个属性 opcity 和 visibility, opctiy 这个属性很简单 控制元素透明度 ,visibility控制元素的显示和隐藏,他和display有一个很重要的区别,visibility可以用transition来进行过渡,而display并不可以,这就是我们不用display的原因 可以配合上transform: scale() 让弹窗更有动态感觉 全部代码: <!DOCT

自己写的光圈动画

.circle_normal { width: 18px; height: 18px; margin: 0 auto; background: #45de3c; cursor: pointer; display: inline-block; position: relative; border-radius: 50%; } .circle_normal:after { content: ''; position: absolute; width: 70px; height: 70px; bord

仿造android 写的 JS动画

<html> <head> <title>Animation</title> <meta http-equiv="X-UA-Compatible" content="edge" /> <meta http-equiv="X-UA-Compatible" content="IE=10"> <meta http-equiv="X-UA-Comp

animation写动画

最近,接到项目需求,需要写大量的动画,那么怎么写呢? 动画是使元素从一种样式逐渐变化为另一种样式的效果.可以用百分比来规定变化发生的时间,或用关键词 "from" 和 "to",等同于 0% 和 100%.0% 是动画的开始,100% 是动画的完成.为了得到最佳的浏览器支持,应该始终定义 0% 和 100% 选择器. 我们知道CSS3的Animation有八个属性 animation-name animation-duration animation-delay a

仿写及比较标哥的iOS时钟动画

一.前言 以前看各种绚丽的UI特效动画代码,采用的方法是会先运行一篇,然后直接去看实现代码.初学时抱着瞻仰的态度去接触,去认识,是没有错的.但是在了解了像素.动画渲染机制,CoreAnimation API,推导过二维.三维的仿射矩阵之后,我们可以改变阅读UI动画博文或者是源码的方式了. Talk is cheap, show me the code——Linus Torvalds. 大量的仿写:一定一定要多写——叶孤城__ 在CodeReview线下大会上的发言. 最近安居客.猿题库.蘑菇街.

写多个物件css3循环动画案例原理

div { background-color: #67CF22; height: 100%; width: 6px; display: inline-block; -webkit-animation: stretchdelay 1.2s infinite ease-in-out; animation: stretchdelay 1.2s infinite ease-in-out; } .spinner .rect2 { -webkit-animation-delay: -1.1s; animat

CSS3学习(CSS3过渡、CSS3动画)

CSS3过渡:transition属性--专门应对颜色.长度.宽度.位置等变化的过渡 通过CSS3,我们可以在不使用Flash和JavaScript的情况下,为当前某元素从某样式改变为某样式的时候添加过渡效果.我们仅仅使用到了一个transition属性,专门来写过渡从一个样式到另一个样式过渡时所花费的时间,以秒为单位.若时长不规定,默认为0,即没有过渡时间.在使用这个过渡效果的时候,我们使用了类似于超链接的l(link).v(visited).h(hover).a(active)样式的控制.此

CSS3学习总结3-3D与动画

前言:这是篇CSS3中关于3D效果与动画相关的内容. (1)在CSS3的3D效果中,需要结合透视perspective的属性才能看到3d的效果,这个属性在屏幕上实现了元素近大远小的效果,所以要使用CSS3的3d相关属性,需要记得写perspective. (2)在CSS3的3d坐标系与数学中的坐标系有所区别,主要是在y轴正方向的规定上. x轴正方向:从左往右 y轴正方向:从上至下 z轴正方向:从里至外 旋转 在C3的2D变换中,rotate代表了元素围绕Z轴旋转一个角度,3d中还有围绕X和Y轴旋

超级强大的SVG SMIL animation动画详解

本文花费精力惊人,具有先驱前瞻性,转载规则以及申明见文末,当心予以追究.本文地址:http://www.zhangxinxu.com/wordpress/?p=4333 //zxx: 本文的SVG在有缓存时候是无动画效果,此时您可以试着[右键-新标签页打开图片]. 一.SVG SMIL animation概览 1. SMIL是什么?SMIL不是指「水蜜梨」,而是Synchronized Multimedia Integration Language(同步多媒体集成语言)的首字母缩写简称,是有标准