纯前端绘制的下雨效果

news2024/10/6 2:25:52

先上效果:
在这里插入图片描述
再上代码:

<!--黏糊糊的菜单-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="main.css">
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;800&display=swap" rel="stylesheet">
    <style>
        *, *::before, *::after {
            padding: 0;
            margin: auto 4px;
            box-sizing: border-box;
        }

        body {
            background-color: #222;
            color: #fff;
            min-height: 100vh;
            display: grid;
            place-items: center;
            perspective: 1200px;
        }
        body *:not(:empty) {
            transform-style: preserve-3d;
        }

        .scene {
            position: relative;
        }

        .drop {
            position: absolute;
            left: 0;
            bottom: -25vh;
            width: 1px;
            height: 100vh;
            transform: translate3d(var(--tx, 0), 0, var(--tz, 0));
            transform-style: preserve-3d;
            background-image: linear-gradient(transparent 95vh, #def3);
            -webkit-animation: drop 12s var(--delay, 0s) ease-in infinite;
            animation: drop 12s var(--delay, 0s) ease-in infinite;
        }
        @-webkit-keyframes drop {
            0%, 75% {
                background-position-y: 5vh;
            }
            100% {
                background-position-y: 105vh;
            }
        }
        @keyframes drop {
            0%, 75% {
                background-position-y: 5vh;
            }
            100% {
                background-position-y: 105vh;
            }
        }
        .drop:nth-child(1) {
            --delay: 0s;
            --tx: 8.75vmin;
            --tz: 4.25vmin;
        }
        .drop:nth-child(2) {
            --delay: -0.25s;
            --tx: -13.25vmin;
            --tz: 7.75vmin;
        }
        .drop:nth-child(3) {
            --delay: -0.5s;
            --tx: 11.75vmin;
            --tz: -21.75vmin;
        }
        .drop:nth-child(4) {
            --delay: -0.75s;
            --tx: 22.75vmin;
            --tz: -13.25vmin;
        }
        .drop:nth-child(5) {
            --delay: -1s;
            --tx: -22.25vmin;
            --tz: 0vmin;
        }
        .drop:nth-child(6) {
            --delay: -1.25s;
            --tx: 4.5vmin;
            --tz: -8.25vmin;
        }
        .drop:nth-child(7) {
            --delay: -1.5s;
            --tx: 7.5vmin;
            --tz: -1.75vmin;
        }
        .drop:nth-child(8) {
            --delay: -1.75s;
            --tx: 8.25vmin;
            --tz: 17vmin;
        }
        .drop:nth-child(9) {
            --delay: -2s;
            --tx: 4.5vmin;
            --tz: 4.5vmin;
        }
        .drop:nth-child(10) {
            --delay: -2.25s;
            --tx: -13.5vmin;
            --tz: -19.75vmin;
        }
        .drop:nth-child(11) {
            --delay: -2.5s;
            --tx: 2.5vmin;
            --tz: -20vmin;
        }
        .drop:nth-child(12) {
            --delay: -2.75s;
            --tx: 9vmin;
            --tz: -6.75vmin;
        }
        .drop:nth-child(13) {
            --delay: -3s;
            --tx: -8.5vmin;
            --tz: 8.25vmin;
        }
        .drop:nth-child(14) {
            --delay: -3.25s;
            --tx: -24.75vmin;
            --tz: -16.5vmin;
        }
        .drop:nth-child(15) {
            --delay: -3.5s;
            --tx: -21vmin;
            --tz: -1vmin;
        }
        .drop:nth-child(16) {
            --delay: -3.75s;
            --tx: -2.25vmin;
            --tz: 9.75vmin;
        }
        .drop:nth-child(17) {
            --delay: -4s;
            --tx: 17vmin;
            --tz: 6vmin;
        }
        .drop:nth-child(18) {
            --delay: -4.25s;
            --tx: 1.75vmin;
            --tz: -22vmin;
        }
        .drop:nth-child(19) {
            --delay: -4.5s;
            --tx: 18.5vmin;
            --tz: 7.75vmin;
        }
        .drop:nth-child(20) {
            --delay: -4.75s;
            --tx: -19vmin;
            --tz: -20vmin;
        }
        .drop:nth-child(21) {
            --delay: -5s;
            --tx: -23.5vmin;
            --tz: 13vmin;
        }
        .drop:nth-child(22) {
            --delay: -5.25s;
            --tx: -10vmin;
            --tz: -4.5vmin;
        }
        .drop:nth-child(23) {
            --delay: -5.5s;
            --tx: 21.25vmin;
            --tz: -6.75vmin;
        }
        .drop:nth-child(24) {
            --delay: -5.75s;
            --tx: 11vmin;
            --tz: 6.75vmin;
        }
        .drop:nth-child(25) {
            --delay: -6s;
            --tx: -10.75vmin;
            --tz: 14.25vmin;
        }
        .drop:nth-child(26) {
            --delay: -6.25s;
            --tx: -10.75vmin;
            --tz: 5vmin;
        }
        .drop:nth-child(27) {
            --delay: -6.5s;
            --tx: 8vmin;
            --tz: 4.75vmin;
        }
        .drop:nth-child(28) {
            --delay: -6.75s;
            --tx: -13.5vmin;
            --tz: -11.25vmin;
        }
        .drop:nth-child(29) {
            --delay: -7s;
            --tx: 14.25vmin;
            --tz: 14.75vmin;
        }
        .drop:nth-child(30) {
            --delay: -7.25s;
            --tx: 25vmin;
            --tz: -11.25vmin;
        }
        .drop:nth-child(31) {
            --delay: -7.5s;
            --tx: 1.5vmin;
            --tz: -19.75vmin;
        }
        .drop:nth-child(32) {
            --delay: -7.75s;
            --tx: 12.25vmin;
            --tz: -15vmin;
        }
        .drop:nth-child(33) {
            --delay: -8s;
            --tx: -23.25vmin;
            --tz: 11.75vmin;
        }
        .drop:nth-child(34) {
            --delay: -8.25s;
            --tx: -1.75vmin;
            --tz: 21.5vmin;
        }
        .drop:nth-child(35) {
            --delay: -8.5s;
            --tx: -12.25vmin;
            --tz: 14vmin;
        }
        .drop:nth-child(36) {
            --delay: -8.75s;
            --tx: -2.75vmin;
            --tz: 12.25vmin;
        }
        .drop:nth-child(37) {
            --delay: -9s;
            --tx: 15vmin;
            --tz: 16vmin;
        }
        .drop:nth-child(38) {
            --delay: -9.25s;
            --tx: -3vmin;
            --tz: 6.75vmin;
        }
        .drop:nth-child(39) {
            --delay: -9.5s;
            --tx: -5.5vmin;
            --tz: -23.75vmin;
        }
        .drop:nth-child(40) {
            --delay: -9.75s;
            --tx: 13.5vmin;
            --tz: 24.75vmin;
        }
        .drop:nth-child(41) {
            --delay: -10s;
            --tx: -12.25vmin;
            --tz: 3.25vmin;
        }
        .drop:nth-child(42) {
            --delay: -10.25s;
            --tx: -13vmin;
            --tz: 3.75vmin;
        }
        .drop:nth-child(43) {
            --delay: -10.5s;
            --tx: 14.5vmin;
            --tz: -21.5vmin;
        }
        .drop:nth-child(44) {
            --delay: -10.75s;
            --tx: 14vmin;
            --tz: 4.5vmin;
        }
        .drop:nth-child(45) {
            --delay: -11s;
            --tx: 23.25vmin;
            --tz: -12vmin;
        }
        .drop:nth-child(46) {
            --delay: -11.25s;
            --tx: 20.75vmin;
            --tz: 21vmin;
        }
        .drop:nth-child(47) {
            --delay: -11.5s;
            --tx: -24.75vmin;
            --tz: 21.75vmin;
        }
        .drop:nth-child(48) {
            --delay: -11.75s;
            --tx: -21vmin;
            --tz: -0.25vmin;
        }
        .drop::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            width: 60vmin;
            height: 60vmin;
            background-image: radial-gradient(closest-side, transparent, #def, transparent, #eff, transparent, #def, transparent);
            -webkit-animation: waves 12s calc(var(--delay, 0s) - 0.36s) linear infinite;
            animation: waves 12s calc(var(--delay, 0s) - 0.36s) linear infinite;
        }
        @-webkit-keyframes waves {
            0% {
                transform: translate(-50%, 50%) rotateX(-90deg) scale(0);
                opacity: 0.05;
            }
            100% {
                transform: translate(-50%, 50%) rotateX(-90deg) scale(2);
                opacity: 0;
            }
        }
        @keyframes waves {
            0% {
                transform: translate(-50%, 50%) rotateX(-90deg) scale(0);
                opacity: 0.05;
            }
            100% {
                transform: translate(-50%, 50%) rotateX(-90deg) scale(2);
                opacity: 0;
            }
        }
        header {
            top:0;
            position: fixed;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0;
            width: 100%;
            z-index: 3;
            height: 7em;
            font-family: "Bebas Neue", sans-serif;
            font-size: clamp(0.66rem, 2vw, 1rem);
            letter-spacing: 0.5em;
        }

        a{
            color: #eeffff;
            text-decoration: none;
        }
    </style>
</head>
<body>
<header>
    <div>Animated Sections</div>
    <div><a href="https://blog.csdn.net/qq_35241329?type=blog">Original By TiMi先生</a></div>
</header>
<div class="scene">
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
    <div class="drop"></div>
</div>

</body>
</html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/537393.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Golang笔记:使用os.Args和flag包编写命令行界面(CLIs)

文章目录 目的os.ArgsflagFlagSet总结 目的 命令行界面&#xff08;Command-line Interfaces&#xff09;是比较常用的一种软件形式。对于大部分开发运维人员来说很多时候CLIs可能比图形界面更加方便。软件开发时也经常会有需要开发命令行界面形式软件的情况&#xff0c;使用G…

Maven基础篇

Maven基本概念 Maven是什么 maven的本质是一个项目管理工程&#xff0c;将项目开发和管理过程抽象成一个项目对象模型&#xff08;POM&#xff09; POM&#xff08;Project Object Model&#xff09;&#xff1a;项目对象模型 作用 项目构建&#xff1a;提供标准的、跨平台…

什么是Selenium?如何使用Selenium进行自动化测试

目录 什么是 Selenium&#xff1f; Selenium 的优势是什么? 软件测试的需要 手动测试的挑战 自动化测试胜过手动测试 Selenium 对比 QTP 和 RFT Selenium 工具套件 Selenium 有哪些组件? Selenium RC &#xff08;远程控制&#xff09; Selenium IDE&#xff08;集成…

MIT6824——lab2(实现一个Raft库)的一些实现,问题,和思考

MIT 6824 关于lab2的实现&#xff0c;由于开源许可的问题&#xff0c;代码暂时不开源&#xff0c;下面是自己在实现过程中的思路&#xff0c;遇到的问题&#xff0c;以及总结 1 总结 1.1 raft整个流程 应用程序&#xff1a;kv数据库启动raft库&#xff0c;选举leader&#xf…

跳槽前,把自己逼成卷王...

前段时间席卷全互联网行业的内卷现象&#xff0c;想必有不少人都深陷其中。其实刚开始测试行业人才往往供不应求&#xff0c;而在发展了十几年后&#xff0c;很多人涌入这个行业开始面对存量竞争。红利期过去了&#xff0c;仅剩内部争夺。 即便如此&#xff0c;测试行业仍有许…

AspNetCore中的配置文件详解

1 配置文件 程序开发中&#xff0c;有些信息是要根据环境改变的&#xff0c;比如开发环境的数据库可能是本地数据&#xff0c;而生产环境下需要连接生产数据库&#xff0c;我们需要把这些信息放到程序外面&#xff0c;在程序运行时通过读取这些外部信息实现不改变程序代码适应…

计算机图形学-GAMES101-8

引言 着色是针对某一个点(片段)的应用&#xff0c;这里需要考虑着色的频率。  漫反射项代表光向四面八方均匀的反射出去&#xff0c;和观察方向无关。  Blinn-Phong反射模型结构如下&#xff1a; ) 一、Blinn-Phong模型 &#xff08;1&#xff09;Specular 什么时候才能看到…

SpringBoot实操篇1

一、工程打包与运行&#xff08;windows版&#xff09; 在浏览器中就可以访问到了&#xff0c;此时IDEA并没有启动。服务器就是命令行窗口。 跳过测试&#xff1a;可以看到多了很多数据&#xff0c;是因打包的时候将功能测试了一遍。在IDEA中可以关掉。 注意&#xff1a;必须…

nginx+php+mysql安装以及环境的搭建

目录 一、nginx的安装 二、php的下载安装 1.进入到/usr/local/下&#xff0c;下载php的安装包 2.解压 3.进入到php-8.2.6下&#xff0c;安装需要的依赖包 4.预编译php 5.编译 6.为php提供配置文件 7.为php-fpm提供配置文件 8.添加用户和用户组 9.修改php-fpm.conf配置…

JavaScript全解析-this指向

this指向&#xff08;掌握&#xff09; ●this 是一个关键字&#xff0c;是一个使用在作用域内的关键字 ●作用域分为全局作用域和局部作用域&#xff08;私有作用域或者函数作用域&#xff09; 全局作用域 ●全局作用域中this指向window 局部作用域 ●函数内的 this, 和 函…

OS之作业调度算法

目录 一、基本概念 二、先来先服务算法(FCFS) 三、短作业算法(SJF/SPF) 四、轮转调度算法(RR) 五、优先级调度算法 六、多级反馈队列调度算法 一、基本概念 T(周转)T(完成)-T(到达) 二、先来先服务算法(FCFS) 不利于短作业&#xff0c;非抢占式算法 算法思想&#xff…

Linux日志文件服务器搭建

文章目录 Linux日志文件服务器搭建节点规划案例实施(1)修改主机名(2)配置日志服务器(3)重新启动查看rsyslogd(4)配置客户端(5)测试 Linux日志文件服务器搭建 节点规划 IP主机名节点192.168.100.10serverlog日志服务器192.168.100.20clientlog日志客户端 必须两台机器可以ping…

IPv6之组播地址分类

本文目录 1、IPv6组播地址的结构2、特殊的预留地址和预留组播地址 1、IPv6组播地址的结构 IPv6组播地址是由固定的8bit地址前缀FF::/8&#xff0c;4bit的标志位&#xff0c;4bit组播范围和112bit多播组标识符&#xff08;组ID&#xff09;组成 FF::/8 IPv6的组播地址的最高8bi…

linux环境下设置python定时任务

linux环境下设置python定时任务 Linux 系统提供了使用者控制计划任务的命令 :crontab 命令 1、在linux环境执行命令,进入编辑界面 crontab -e2、按键盘 i 键&#xff0c;进入编辑模式&#xff0c;输入以下内容&#xff0c;设置2个定时任务 定时任务1&#xff1a;每隔10分钟执…

MindFusion.JavaScript Pack 2023.R1 Crack

图表控件添加了径向树布局和套索缩放工具。 2023年5月17日-10:53新版 特征 JavaScript图表中的新增功能 径向树布局-添加了新的类&#xff0c;它将树级别排列在围绕根的同心圆中。 套索缩放工具-控件现在支持使用套索工具进行缩放的几种方法&#xff1a; 可以将行为属性设置为…

单点登录协议

认证和授权 认证&#xff1a;确认该用户的身份是他所声明的那个人 授权&#xff1a;根据用户身份授予他访问特定资源的权限 当用户登录应用系统时&#xff0c;系统需要先认证用户身份&#xff0c;然后依据用户身份再进行授权。认证与授权需要联合使用&#xff0c;才能让用户真…

浏览器网络请求——HTTP详解

文章目录 HTTP 是什么HTTP 发展历程HTTP 1.0HTTP 1.1HTTP 2.0 常用方法头部信息 (Headers)请求头&#xff08;request Headers响应头&#xff08;response Headers&#xff09; 状态码HTTP无状态理解&#xff1a;cookie与session总结 HTTP 是什么 HTTP&#xff08;Hyper Text T…

【Linux】2.4 第一个小程序——进度条(C语言)

文章目录 character缓冲区的问题&#xff1a;ps. sleep 函数 倒计时进度条1.打印进度条2.让进度条“动起来”3.预留进度条的位置并用提示符显示进度条的状态4.颜色打印只用颜色来表示进度条 character 回车 与 换行 键盘上的 Enter 键&#xff1a; 换行的过程&#xff1a; …

程序员如何成为一名独立开发者?

这里有一个最简单粗暴的方式让你确定你是否能成为一个独立的开发者。 Lv.1 顺畅地完成一个独立外包项目 一个最低成本的试错方式就是去独立地完成一个外包项目&#xff0c;一般来说外包项目的难度较低&#xff0c;但也具有作为开发者必备的大多数流程&#xff0c;如果不确定自…

ChatGPT+小红书爆文,牛!

随着AI技术的不断发展&#xff0c;它已经逐渐渗透到了我们的生活之中&#xff0c;包括内容营销领域。 我们通过AI算法生成文本、优化搜索引擎排名、提高用户体验等&#xff0c;现在AI已逐渐在改变时代的进步&#xff0c;AI也将成为下一个十年的一个变革。我们每个创业者、内容…