js实现点击粒子火花效果代码

代码语言:html

所属分类:粒子

代码描述:js实现点击粒子火花效果代码

代码标签: 粒子 火花 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


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

<head>

  <meta charset="UTF-8">

  
<style>
@import url("https://fonts.googleapis.com/css2?family=Crafty+Girls&display=swap");
body {
  background: #111111;
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  font-family: "Crafty Girls", cursive;
  display: flex;
  justify-content: center;
  align-items: center;
}

p {
  color: yellow;
  font-size: 32px;
  text-shadow: 2px 2px 4px #9a9696;
  user-select: none;
}

@keyframes ringRotate {
  0% {
    transform: rotateZ(0deg) rotateY(0deg) rotateX(0deg);
  }
  100% {
    transform: rotateZ(-360deg) rotateY(-360deg) rotateX(-360deg);
  }
}
firefly {
  position: absolute;
  background: yellow;
  left: 0;
  border-radius: 100%;
  pointer-events: none;
  top: 0;
  transform-style: preserve-3d;
  opacity: 0;
  box-shadow: 5px 5px 44px #649bc8;
}
</style>



</head>

<body >
  <p class="p-text">Click arround</p>

  
      <script  >
console.clear();
let am = 30;
let ptext = document.querySelector(".p-text");

document.addEventListener("click", (e) => {
	let xx = e.pageX;
	let yy = e.pageY;

	for (let.........完整代码请登录后点击上方下载按钮下载查看

网友评论0