HTML 动态夜空特效

news/2024/10/20 5:44:50/

1.程序代码

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE> New Document </TITLE><META NAME="Generator" CONTENT="EditPlus"><META NAME="Author" CONTENT=""><META NAME="Keywords" CONTENT=""><META NAME="Description" CONTENT=""><style>body,html {margin: 0;height: 100%;width: 100%;overflow: hidden;position: relative;background: -webkit-radial-gradient(center, #000046 0%, #000 60%);}::after,::before {content: " ";display: block;}::after,::before,.moon,.sky,.star,.asteroid {position: absolute;}.moon {color: #ffd;background: radial-gradient(circle at -30% 50%, rgba(0, 0, 0, 0) 175px, currentColor 100%);z-index: 999;border-radius: 50%;height: 200px;width: 200px;left: 50%;top: 50%;transform: translate(-50%, -50%);filter: drop-shadow(0 0 20px currentColor);}.sky {left: 0;top: 0;width: 100%;height: 100%;animation: rotate 400s infinite linear;}.star {width: 3px;height: 3px;background-color: white;border-radius: 50%;animation: shine 800s infinite linear;}.star.scale1 {transform: scale(1);}.star.scale2 {transform: scale(0.5);}.star.scale3 {transform: scale(1.3);}.star.animate1 {animation-duration: 0.5s;}.star.animate2 {animation-duration: 1s;}.star.animate3 {animation-duration: 1.5s;}.star.animate4 {animation-duration: 2s;}.star.opacity1 {opacity: 1;}.star.opacity2 {opacity: 0.5;}.star.opacity3 {opacity: 0.2;}.asteroid {top: -200px;left: -200px;width: 200px;height: 200px;opacity: 0.8;animation-name: assteroid;animation-timing-function: linease-inear;animation-iteration-count: infinite;animation-duration: 7s;animation-delay: 2s;}.asteroid:before {width: 10px;height: 10px;background: #fff;-webkit-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;-moz-background-clip: padding;-webkit-background-clip: padding-box;background-clip: padding-box;-webkit-box-shadow: 0px 0px 7px 2px #fff;-moz-box-shadow: 0px 0px 7px 2px #fff;box-shadow: 0px 0px 7px 2px #fff;bottom: 0;right: 0;}.asteroid:after {width: 0;height: 0;border-left: 3px solid transparent;border-bottom: 200px solid #fff;border-right: 3px solid transparent;bottom: -22px;right: 75px;-webkit-transform: rotate(-45deg);-moz-transform: rotate(-45deg);transform: rotate(-45deg);-o-transform: rotate(-45deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=-1deg);}@keyframes shine {0% {box-shadow: 0 0 15px 0px rgba(255, 255, 255, 0.05);}50% {box-shadow: 0 0 15px 4px rgba(255, 255, 255, 0.4);}100% {box-shadow: 0 0 15px 0px rgba(255, 255, 255, 0.05);}}@-webkit-keyframes shine {0% {box-shadow: 0 0 15px 0px rgba(255, 255, 255, 0.05);}50% {box-shadow: 0 0 15px 4px rgba(255, 255, 255, 0.4);}100% {box-shadow: 0 0 15px 0px rgba(255, 255, 255, 0.05);}}@keyframes rotate {0% {-webkit-transform: rotate(0deg);}100% {-webkit-transform: rotate(360deg);}}@keyframes rotate {0% {-webkit-transform: rotate(0deg);}100% {-webkit-transform: rotate(360deg);}}@keyframes assteroid {0% {top: -200px;left: -200px;filter: alpha(opacity=80);opacity: 0.8;}10% {top: 200px;left: 200px;filter: alpha(opacity=0);opacity: 0;}100% {filter: alpha(opacity=0);opacity: 0;}}@-webkit-keyframes assteroid {0% {top: -200px;left: -200px;filter: alpha(opacity=80);opacity: 0.8;}10% {top: 200px;left: 200px;filter: alpha(opacity=0);opacity: 0;}100% {filter: alpha(opacity=0);opacity: 0;}}</style>
</HEAD><BODY><div class="sky"></div>
<div class="moon"></div>
<div class="asteroid"></div>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>/*===============================================================Barev and welcome to my little playground!My name is Ani and I'm a Web Developer from Yerevan. Here you will find some of my personal experiments. Feel free to use them for whatever you want.===============================================================*/function init(){var styles = ["animate4", "animate1", "animate2", "animate3"];var scales = ["scale1", "scale2", "scale3"];var opacities = ["opacity1", "opacity1", "opacity1", "opacity2", "opacity2", "opacity3"];function rand(min, max) {return Math.floor(Math.random() * (max - min)) + min;}var stars = "";var count = 300;var widthWindow = window.innerWidth;var heightWindow = window.innerHeight;for (var i = 0; i < count; i++) {stars += "<span class='star " + styles[rand(0, 4)] + " " + opacities[rand(0, 6)] + " "+ scales[rand(0, 3)] + "' style='animation-delay: ." + rand(0, 9)+ "s; left: "+ rand(0, widthWindow) + "px; top: " + rand(0, heightWindow) + "px;'></span>";}document.querySelector(".sky").innerHTML = stars;}window.onload = init;window.onresize = init;
</script>
</BODY>
</HTML>

2.效果图

 


http://www.ppmy.cn/news/380117.html

相关文章

大模型微调方法调研

文章目录 Freeze方法PT方法Lora方法AdaloraPrompt TuningAdapter TuningPrefix tuning遗留问题 Freeze方法 对原始模型部分参数进行冻结操作&#xff0c;仅训练部分参数 PT方法 P-Tuning&#xff0c;仅对大模型的Embedding加入新的参数。 P-Tuning 提出将 Prompt 转换为可以…

二层和三层交换机到底有啥区别?二者如何切换?

概要 计算机网络中的交换机是用于在局域网&#xff08;LAN&#xff09;中转发数据包的重要设备。其中&#xff0c;二层交换机和三层交换机是两种常见的交换机类型。本文将详细介绍二层交换机和三层交换机的特点、工作原理、各自的优缺点以及在思科、华为、瞻博网络三家厂商如何…

ai绘画生成器有哪些?分享3款好用的ai自动绘画生成器

文字和绘画是两种看似不同的艺术形式&#xff0c;但它们之间却有着一种神奇的联系。你或许曾经在一些创意绘画作品中发现过使用文字进行表达的元素&#xff0c;那么&#xff0c;文本究竟如何生成这些令人惊叹的艺术作品呢&#xff1f;今天&#xff0c;我们就来探索一下文字怎样…

Layui禁止表格部分复选框,layui禁止表格自带第一列复选框,layui禁止表格部分复选框,layui获取表格复选框选中数据

前言 禁止某些行可以勾选操作&#xff0c;及选中后的操作和行操作 效果 实现 执行一个table示例 <table id"data_table" class"layui-hide" lay-filter"data_table"></table>cols 的第一列就是需要重写的复选框 table.render({…

万物云原生下的服务进化 | 京东云技术团队

导读&#xff1a; 在万物云原生下的环境下&#xff0c;Java的市场份额也因耗资源、启动慢等缺点&#xff0c;导致在云原生环境里被放大而降低&#xff0c;通过这篇文章&#xff0c;读者可以更好地了解如何在云原生环境下通过升级相关版本和使用GraalVM打出原生镜像到方式&…

Python3 使用xpath匹配爬取彼岸壁纸高清美女图片

Python3 使用xpath匹配爬取高清美女图片&#xff01; 写代码必做的三件事&#xff1a; 1.做笔记&#xff0c;注意细节&#xff01; 2.代码一定要加上注释&#xff01; 3.思路一定要清晰&#xff01; 最终结果图&#xff1a; 全部都是高清大图&#xff1a;1920x1080 网站链接&…

美女福利图片API接口,免费好用

1、前言 美女图片福利查询接口&#xff0c;能获取一些青春靓女的图片&#xff0c;拿来做一些demo非常合适。 查看接口完整信息&#xff1a;https://www.idmayi.com/doc/detail?id15 2、接口明细 注意&#xff1a;app_id和app_secret是临时秘钥&#xff0c;如果真正使用&#x…

Swagger 2.0 规范 详解

目录 前言 顶级标签 元数据 基本网址 标签信息 媒体类型&#xff08;MIME TYPE) 路径与操作 参数 &#xff08;parameters) Common Parameters 同一路径的公共参数 不同路径的公共参数 描述响应体 RequestBody 响应体 空响应体 默认响应 重用响应 完整的Demo …