效果
文章来源地址https://www.toymoban.com/news/detail-686341.html
源码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vanilla JS Particles</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script type="text/javascript">
document.addEventListener("mousemove", function(e){
let body = document.querySelector('body');
let heart = document.createElement("span");
let x = e.offsetX;
let y = e.offsetY;
heart.style.left = x+'px';
heart.style.top = y+'px';
let size = Math.random() * 8;
let transformValue = Math.random() * 360;
heart.style.width = 2 + size+'px';
heart.style.height =
文章来源:https://www.toymoban.com/news/detail-686341.html
到了这里,关于27.CSS粒子特效的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!