最新下载
24小时阅读排行榜
- 1 摩根大通推出IndexGPT:智能化投资建议引领新潮流
- 2 Linux系统的VPS性能怎么测试
- 3 php redis如何实现定时任务
- 4 mysql标识列的特点有哪些
- 5 现场对标ChatGPT!又一AI大模型发布,还要渗透这么多行业
- 6 VR在智慧旅游行业的应用
- 7 中国首个Pocket Gallery虚拟展厅亮相中央美术学院美术馆
- 8 重大安全风险!美光公司产品对中国关键信息基础设施构成威胁
- 9 新一代天猫精灵评测:里面住了个温暖还话痨的AI朋友
- 10 苹果江郎才尽?前营销高管不看好苹果AR/VR头显。
- 11 MySQL的循环语句有哪些
- 12 AIGC能为元宇宙里的「人」做些什么?|1号AIGC季②
- 13 AI将夺走人类的“饭碗”?听听科技大咖们怎么说!
- 14 升级到 Windows 11 后如何避免垃圾邮件
- 15 苹果限制员工使用ChatGPT等外部AI,担心泄露机密数据
最新教程
-
- Webpack4.x---十天技能课堂
- 2070 2024-02-02
-
- Bootstrap4.x---十天精品课堂
- 2146 2024-01-30
-
- ECMAScript6 / ES6---十天技能课堂
- 2725 2024-01-26
-
- Laravel---API接口
- 2135 2024-01-23
-
- php-src源码分析探索
- 1220 2024-01-22
-
- 搭建网站 vscode+xdebug调试php代码 调试环境搭建
- 2360 2024-01-18
<head>
<meta charset="utf-8">
<title>逼真的CSS3日食动画特效</title>
<style>
html, body {
width: 100%;
overflow-x: hidden;
}
*, *:before, *:after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.universe {
width: 100vw;
height: 100vh;
background: #030613;
display: block;
position: relative;
-webkit-animation: skyDim 4s 8s linear forwards;
animation: skyDim 4s 8s linear forwards;
}
.universe:before {
content: "";
box-shadow: 10vw 1vh #fff, 14vw 29vh 2px #FFF, 23vw 34vh 1px #FFF, 1vw 99vh 1px #FFF, 20vw 80vh #FFF, 90vw 10vh 2px #fff, 55vw 9vh #FFF, 24vw 4vh 1px #FFF, 50vw 99vh 1px #FFF, 74vw 40vh 1px #FFF, 80vw 9vh 1px #FFF, 20vw 80vh #FFF, 85vw 78vh #fff;
width: 4px;
height: 4px;
position: absolute;
border-radius: 50%;
-webkit-animation: starsFloating 100s -200s linear both infinite;
animation: starsFloating 100s -200s linear both infinite;
}
.universe:after {
content: "";
box-shadow: 37vw 78vh #fff, 17vw 69vh #FFF, 68vw 4vh 1px #FFF, 98vw 9vh 1px #FFF, 45vw 67vh #FFF, 95vw 1vh 2px #fff, 35vw 75vh 2px #FFF, 44vw 47vh 1px #FFF, 54vw 5vh 1px #FFF, 22vw 29vh 1px #FFF, 39vw 71vh 1px #FFF, 11vw 11vh #FFF, 88vw 82vh #fff;
width: 2px;
height: 2px;
position: absolute;
border-radius: 50%;
-webkit-animation: starsFloating 100s 3s linear backwards infinite;
animation: starsFloating 100s 3s linear backwards infinite;
}
.sun {
height: 200px;
width: 200px;
border-radius: 50%;
background: #cfcfd4;
box-shadow: 0 0 60px gold, 0 0 100px #b9a018, inset 0 5px 35px 53px #dbdbdb, inset 48px 8px 34px 25px #c4c4c4;
left: calc(50% - 100px);
top: calc(50% - 100px);
position: absolute;
-webkit-animation: sunFreakOut 5s 7.1s linear forwards;
animation: sunFreakOut 5s 7.1s linear forwards;
}
.moon {
height: 50px;
width: 50px;
border-radius: 50%;
background: rgba(0, 0, 0, 0.99);
box-shadow: inset 5px 1px 10px -8px #d4d4d6;
-webkit-transition: 1s;
transition: 1s;
top: calc(40% - 100px);
position: absolute;
z-index: 5;
-webkit-animation: move 20s ease-in-out forwards;
animation: move 20s ease-in-out forwards;
}
@-webkit-keyframes move {
0% {
-webkit-transform: translateX(100vw);
transform: translateX(100vw);
}
40%, 60% {
top: calc(50% - 100px);
}
50%, 50.5% {
width: 200px;
height: 200px;
-webkit-transform: translateX(calc(50vw - 100px));
transform: translateX(calc(50vw - 100px));
box-shadow: inset 20px 1px 35px -15px #d4d4d6;
top: calc(50% - 100px);
}
60% {
box-shadow: inset -20px 1px 35px -15px #d4d4d6;
}
100% {
width: 50px;
height: 50px;
-webkit-transform: translateX(calc(-1vw - 60px));
transform: translateX(calc(-1vw - 60px));
top: calc(40% - 100px);
box-shadow: inset -5px 1px 10px -8px #d4d4d6;
}
}
@keyframes move {
0% {
-webkit-transform: translateX(100vw);
transform: translateX(100vw);
}
40%, 60% {
top: calc(50% - 100px);
}
50%, 50.5% {
width: 200px;
height: 200px;
-webkit-transform: translateX(calc(50vw - 100px));
transform: translateX(calc(50vw - 100px));
box-shadow: inset 20px 1px 35px -15px #d4d4d6;
top: calc(50% - 100px);
}
60% {
box-shadow: inset -20px 1px 35px -15px #d4d4d6;
}
100% {
width: 50px;
height: 50px;
-webkit-transform: translateX(calc(-1vw - 60px));
transform: translateX(calc(-1vw - 60px));
top: calc(40% - 100px);
box-shadow: inset -5px 1px 10px -8px #d4d4d6;
}
}
@-webkit-keyframes skyDim {
0%, 100% {
background: #030613;
}
50%, 70% {
background: black;
}
}
@keyframes skyDim {
0%, 100% {
background: #030613;
}
50%, 70% {
background: black;
}
}
@-webkit-keyframes sunFreakOut {
0%, 100% {
box-shadow: 0 0 60px gold, 0 0 100px #b9a018, inset 0 5px 35px 53px #dbdbdb, inset 48px 8px 34px 25px #c4c4c4;
}
50%, 70% {
box-shadow: 0 0 50px #e30000, 0 0 0px #b91818, inset 0 5px 35px 53px #dbdbdb, inset 48px 8px 34px 25px #c4c4c4;
}
}
@keyframes sunFreakOut {
0%, 100% {
box-shadow: 0 0 60px gold, 0 0 100px #b9a018, inset 0 5px 35px 53px #dbdbdb, inset 48px 8px 34px 25px #c4c4c4;
}
50%, 70% {
box-shadow: 0 0 50px #e30000, 0 0 0px #b91818, inset 0 5px 35px 53px #dbdbdb, inset 48px 8px 34px 25px #c4c4c4;
}
}
@-webkit-keyframes starsFloating {
0% {
opacity: 0;
}
10% {
opacity: 1;
}
100% {
-webkit-transform: translateY(-100vh);
transform: translateY(-100vh);
}
}
@keyframes starsFloating {
0% {
opacity: 0;
}
10% {
opacity: 1;
}
100% {
-webkit-transform: translateY(-100vh);
transform: translateY(-100vh);
}
}
</style>
</head>
这是一款非常逼真的使用纯CSS3实现的一个天狗食月日食动画特效,当日全食时,还有背景星星闪烁动画特效,效果很漂亮