当前位置: 首页 > wzjs >正文

如何做网站方案游戏ui素材网站

如何做网站方案,游戏ui素材网站,kali wordpress,减少wordpress响应时间【css酷炫效果】纯CSS实现粒子旋转动画 缘创作背景html结构css样式完整代码效果图 想直接拿走的老板,链接放在这里:https://download.csdn.net/download/u011561335/90492008 缘 创作随缘,不定时更新。 创作背景 刚看到csdn出活动了&…

【css酷炫效果】纯CSS实现粒子旋转动画

  • 创作背景
  • html结构
  • css样式
  • 完整代码
  • 效果图

想直接拿走的老板,链接放在这里:https://download.csdn.net/download/u011561335/90492008

创作随缘,不定时更新。

创作背景

刚看到csdn出活动了,赶时间,直接上代码。

html结构

	<div id="particle-container" class='particle-container'></div>

css样式

/* 基本样式重置 */
body, html {margin: 0;padding: 0;width: 100%;height: 100%;overflow: hidden; /* 防止滚动条出现 */background-color: #000; /* 设置背景颜色为黑色 */
}/* 粒子容器 */
.particle-container {position: relative;width: 100%;height: 100%;pointer-events: none; /* 使容器内的粒子不影响鼠标事件 */
}/* 粒子样式 */
.particle-container::before,
.particle-container::after,
.particle {content: '';position: absolute;top: 50%;left: 50%;width: 2px;height: 2px;background-color: rgba(255, 255, 255, 0.8); /* 设置粒子颜色为白色,带有一定的透明度 */border-radius: 50%;box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); /* 添加一些模糊效果 */animation: particleAnimation 5s infinite ease-in-out;pointer-events: none;
}/* 使用伪元素生成一些粒子 */
.particle-container::before,
.particle-container::after {width: 4px;height: 4px;
}/* 使用大量类生成更多粒子 */
.particle:nth-child(1) { top: 5%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { top: 15%; left: 20%; animation-delay: 0.2s; }
.particle:nth-child(3) { top: 25%; left: 30%; animation-delay: 0.4s; }/* 粒子动画关键帧 */
@keyframes particleAnimation {0% {transform: translate(-50%, -50%) rotate(0deg);opacity: 1;}100% {transform: translate(-50%, -50%) rotate(360deg) translate(200px, -200px);opacity: 0;}
}

完整代码

<!DOCTYPE html>
<html lang="en"> 
<head><title>页面特效</title>
<style type="text/css">
/* 基本样式重置 */
body, html {margin: 0;padding: 0;width: 100%;height: 100%;overflow: hidden; /* 防止滚动条出现 */background-color: #000; /* 设置背景颜色为黑色 */
}/* 粒子容器 */
.particle-container {position: relative;width: 100%;height: 100%;pointer-events: none; /* 使容器内的粒子不影响鼠标事件 */
}/* 粒子样式 */
.particle-container::before,
.particle-container::after,
.particle {content: '';position: absolute;top: 50%;left: 50%;width: 2px;height: 2px;background-color: rgba(255, 255, 255, 0.8); /* 设置粒子颜色为白色,带有一定的透明度 */border-radius: 50%;box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); /* 添加一些模糊效果 */animation: particleAnimation 5s infinite ease-in-out;pointer-events: none;
}@keyframes particleAnimation {0% {transform: translate(-50%, -50%) rotate(0deg);opacity: 1;}100% {transform: translate(-50%, -50%) rotate(360deg) translate(200px, -200px);opacity: 0;}
}</style></head>
<body><h1 style='color:red;'>斗破苍穹!</h1><div id="particle-container" class='particle-container'></div></body><script>const container = document.getElementById('particle-container');const numberOfParticles = 100;setInterval(function(){for (let i = 0; i < numberOfParticles; i++) {const particle = document.createElement('div');particle.classList.add('particle');particle.style.top = Math.random() * 95+ 'vh';particle.style.left = Math.random() * 95+ 'vw';particle.style.animationDelay = Math.random() * 5 * 0.4+`s`;particle.style.width = (Math.floor(Math.random() * 4) + 1)+`px`;particle.style.height = Math.floor(Math.random() * 4) + 1+`px`;container.appendChild(particle);}},3000);</script></html>

效果图

在这里插入图片描述

http://www.dtcms.com/wzjs/615928.html

相关文章:

  • 建个小型网站服务器男女做暧昧视频网站
  • 汉沽做网站软件开发项目管理办法
  • 衡阳购物网站开发案例高端模板网站建设价格
  • 有没有专门做艺术的网站网站如何在google提交收录
  • 企业网站建设栏目结构图浙江网站建设企业
  • 做夜场网站网站建设公司计划书
  • 中文网站建设中项目管理网络图
  • 卖水果网站模板海淘网站建设的目的
  • ps可以做网站动态图荣耀手机官方官网
  • 企业网站管理系统多少钱一年用vue做的网站怎么实现响应式
  • 海口室内设计公司排名南宁网站优化推广
  • 下列关于网站开发中网页网站开源
  • 网站建设佰金手指科杰二九企业网站数据库
  • 男女做暧暧试看网站49专业上海网站建设
  • .net 大型网站开发顺德网站
  • 抽奖网站怎么做免费平台发布销售信息
  • 网站策划方案钢板出租铺路钢板出租
  • 怎样网站seowordpress设置客户端缓存时间
  • 杭州网站基建做网站思路
  • 无锡大型网站建设公司公司网站建设找哪家
  • 怎么模仿网站做ppt汕头seo外包
  • 海南省建设注册中心网站广州小程序开发多少钱
  • 建设银行网站怎么登录密码忘了怎么办想学习网站建设
  • wordpress 做外贸站网站建设系统多少钱
  • 淘宝联盟网站建设网站外链发布
  • 图片站手机网站怎么做wordpress数据库断开
  • 网络营销方式哪些营销网站的专业性诊断评价和优化
  • 大连市城乡建设厅网站织梦cms仿网站教程
  • linux网站环境网站设计收费
  • 建筑工程外架安全网海南网站seo