barrior / jparticles Goto Github PK
View Code? Open in Web Editor NEWA lightweight, efficient and easy-to-use Canvas library for building some cool particle effects.
Home Page: https://jparticles.js.org
License: MIT License
A lightweight, efficient and easy-to-use Canvas library for building some cool particle effects.
Home Page: https://jparticles.js.org
License: MIT License
ts是用的越来越顺手,大神有时间的话,方便写个.d.ts吗?
https://jparticles.js.org/#/examples/line
JParticles is a lightweight JavaScript library for build user interfaces base on the Canvas. That provide some cool particle effects to bring a surprise for the users.
https://jparticles.js.org/#/examples/particle
JParticles is a lightweight JavaScript library for build user interfaces base on the Canvas. That provide some cool particle effects to bring a surprise for the users.
https://jparticles.js.org/#/en/examples/wave
JParticles is a lightweight JavaScript library for build user interfaces base on the Canvas. That provide some cool particle effects to bring a surprise for the users.
使用Vue引入
代码:
import { Particle } from "jparticles";
new Particle.WaveLoading('#mainLoad', {
fillColor: '#27C9E5',
crestHeight: 5,
crestCount: 3,
speed: 0.2,
// 加载进度文本格式为空字符串时,不显示进度文本
textFormatter: '',
// 取消边框圆角
borderRadius: '',
// 设置遮罩图片,实现遮罩效果(如果希望防止图片闪烁,可提前加载完图片后再创建特效)
mask: 'https://raw.githubusercontent.com/Barrior/assets/main/github-logo-text.svg',
})
报错:
jparticles__WEBPACK_IMPORTED_MODULE_2__.Particle.WaveLoading is not a constructor"
found in
和
jparticles__WEBPACK_IMPORTED_MODULE_2__.Particle.WaveLoading is not a constructor
直接使用
new Particle('#mainLoad', { fillColor: '#27C9E5', crestHeight: 5, crestCount: 3, speed: 0.2, // 加载进度文本格式为空字符串时,不显示进度文本 textFormatter: '', // 取消边框圆角 borderRadius: '', // 设置遮罩图片,实现遮罩效果(如果希望防止图片闪烁,可提前加载完图片后再创建特效) mask: 'https://raw.githubusercontent.com/Barrior/assets/main/github-logo-text.svg', })
是可以的,但是其他效果都是报错,我网上也查不到相关问题,请作者大大回复下我,谢谢。
https://jparticles.js.org/#/examples/quick-start
JParticles is a lightweight JavaScript library for build user interfaces base on the Canvas. That provide some cool particle effects to bring a surprise for the users.
能否添加粒子的随机旋转?
I have recently used this package for adding particles animation. I used it in React (Next.js) . i got this error when trying to use it.
node_modules/jparticles/lib/common/constants.js (6:31) @ window ⨯ ReferenceError: window is not defined
Here is my Next.js Component
"use client";
import { Particle } from 'jparticles';
import React, { memo, useEffect } from 'react'
const ParticleEffect = () => {
if(typeof window !== 'undefined')
{
// Your client-side code that uses window goes here
}
useEffect(()=>{
new Particle("#demo", {
color: "#004AAD",
lineShape: "spider",
range: 200,
proximity: 100,
});
},[]);
return (
typeof window !== 'undefined' && <div className="absolute w-full h-3/4" id="demo"></div>
)
}
export default memo(ParticleEffect);
https://jparticles.js.org/#/examples/snow
JParticles is a lightweight JavaScript library for build user interfaces base on the Canvas. That provide some cool particle effects to bring a surprise for the users.
https://jparticles.js.org/#/cn/examples/wave-loading
JParticles is a lightweight JavaScript library for build user interfaces base on the Canvas. That provide some cool particle effects to bring a surprise for the users.
使用layui+JParticles想要实现一个轮播图的粒子运动效果,同时放置了3个JParticles对象,但是出现的效果是:第一张很正常,第二张和第三章图渲染出来的canvas高度和宽度都只有100,这个是为什么?渲染出来的canvas如下:
<canvas style="display: block; background: rgba(0, 0, 0, 0);" width="100" height="100"></canvas>
html代码如下:
<div class="layui-carousel " width="100%" height="600px" id="demo" lay-filter="login">
<div carousel-item>
<div>
<div class="jp1"></div>
</div>
<div>
<div class="jp2"></div>
</div>
<div>
<div class="jp3"></div>
</div>
</div>
</div>
//粒子线条
$(".jp1").jParticle({
background: "green",//背景颜色
color: "#fff",//粒子和连线的颜色
particlesNumber:100,//粒子数量
//disableLinks:true,//禁止粒子间连线
//disableMouse:true,//禁止粒子间连线(鼠标)
particle: {
minSize: 1,//最小粒子
maxSize: 3,//最大粒子
speed: 30,//粒子的动画速度
}
});
$(".jp2").jParticle({
background: "red",//背景颜色
color: "#fff",//粒子和连线的颜色
particlesNumber:100,//粒子数量
//disableLinks:true,//禁止粒子间连线
//disableMouse:true,//禁止粒子间连线(鼠标)
particle: {
minSize: 1,//最小粒子
maxSize: 3,//最大粒子
speed: 30,//粒子的动画速度
}
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.