> 웹 프론트엔드 > JS 튜토리얼 > JS 라이브러리 Particles.js 중국어 개발 매뉴얼

JS 라이브러리 Particles.js 중국어 개발 매뉴얼

巴扎黑
풀어 주다: 2017-09-15 09:18:48
원래의
2512명이 탐색했습니다.

제품을 만들어야 하기 때문에 좋은 UI 인터페이스도 매우 중요합니다. 이런 산란 원자 입자 특수 효과도 나쁘지 않다는 것을 알았습니다. 오늘은 Script House 편집장님께서 Particles.js 중국어 개발 매뉴얼과 Particles.js 매개변수를 모두에게 공유해 주셨는데요. 필요한 친구들이 참고하시면 됩니다

제품을 만들어야 하기 때문에 좋은 UI 인터페이스도 매우 중요합니다. 이것을 발견했습니다. 흩어진 원자 입자의 특수 효과가 꽤 좋아서 공식 github을 만들었습니다: https://github.com/VincentGarreau/particles.js/

데모 메이커, FQ가 필요할 수 있습니다

https: //codepen.io /VincentGarreau/pen/pnlso 이것은 만든 데모를 내보낼 수 있습니다

http://vincentgarreau.com/particles.js/이것은 다양한 효과를 구성하는 데 사용할 수 있습니다

사용 방법 particle.js 로드 및 입자 구성:

index.html

<p id="particles-js"></p>
<script src="particles.js"></script>
로그인 후 복사

app.js

/* particlesJS.load(@dom-id, @path-json, @callback (optional)); */
particlesJS.load('particles-js', 'assets/particles.json', function() {
 console.log('callback - particles.js config loaded');
});
로그인 후 복사

particles.json이 기본 구성 파일입니다

파일 순서에 주의하세요. 그렇지 않으면 문제가 발생합니다. 발생합니다

실제 데모

<!DOCTYPE html>
<html >
<head>
 <meta charset="UTF-8">
 <title>particles.js</title>
  <link rel="stylesheet" href="style.css" rel="external nofollow" >
</head>
<body>
<p id="particles-js"></p>
</body>
 <script src=&#39;particles.min.js&#39;></script> 这个玩意需要放在下面
 <script src="index.js"></script>
</html>
로그인 후 복사

데모를 다운로드해야 한다면 QQ 그룹에 가보세요. 검은 원자 효과는 매우 SF적입니다. 나쁘지 않습니다.

나만의 SF를 만들어보세요. CSS 색상 및 json 구성 파일

parameters

에 따른 효과数 키 값 选 매개변수 옵션/설명

예제 ParticleS.number.value 숫자 수량 🎜boolean 🎜🎜🎜true🎜 / 🎜🎜false🎜🎜<span style="color:#111111;font-family:NSimsun">particles.shape.type</span>🎜🎜string 🎜      배열 선택 원형 배열🎜🎜<span style="color:#111111 ;font-family:NSimsun">"원"</span> 🎜<span style="color:#111111;font-family:NSimsun">"가장자리"</span> 🎜<span style="color:#111111;font-family:NSimsun">"삼각형"</span> 🎜<span style="color:#111111;font-family:NSimsun">"다각형" </span> 🎜<span style="color: #111111;font-family:NSimsun">"star"</span> 🎜<span style="color:#111111;font-family:NSimsun">"이미지"</span> 🎜<span style="color:#111111;font-family:NSimsun">["circle", "triangle", "image"]</span> 🎜<span style="color: #111111;font-family:NSimsun">particles.shape.image.height</span>🎜🎜number 🎜(가로세로 비율) 이미지 높이🎜🎜🎜particles.opacity.value🎜🎜🎜숫자(0~1) Opacity🎜🎜🎜🎜0.75🎜🎜🎜🎜🎜particles.opacity.random🎜🎜🎜boolean 무작위 불투명도🎜🎜🎜 🎜 / 🎜🎜false🎜🎜🎜🎜🎜particles.opacity.anim.enable🎜🎜🎜boolean Gradient animation🎜🎜🎜🎜true🎜 / 🎜🎜false🎜particles.opacity.anim.speed20<span style="color:#111111;font-family:NSimsun"></span>particles.size.random🎜🎜🎜🎜boolean 원자 크기 무작위 🎜🎜🎜🎜true🎜🎜 / 🎜🎜false🎜🎜🎜🎜🎜🎜particles.size.anim.speed🎜 🎜🎜🎜숫자 원자 경사 속도🎜🎜🎜🎜3🎜particles.size.anim.size_min150<span style="color:#111111;font-family:NSimsun"></span>particles.line_linked.color🎜🎜🎜🎜HEX(문자열) 연결된 선 색상🎜🎜🎜🎜#ffffff🎜🎜🎜🎜🎜🎜particles.line_linked.opacity🎜🎜🎜🎜숫자(0~1) 연결선 불투명도🎜🎜🎜🎜0.5🎜🎜🎜🎜🎜🎜particles.line_linked.width🎜🎜🎜🎜number 너비 연결선🎜🎜🎜🎜1.5🎜true🎜🎜particles.move.attract.enable🎜🎜🎜boolean 원자 사이의 인력🎜🎜🎜🎜true🎜 / 🎜 🎜 false🎜🎜🎜🎜🎜입자 . move.attract.rotateX🎜🎜🎜number 어트랙션 0px; padding-left: 0px; margin: 0px; padding-right: 0px">🎜🎜🎜particles.move.attract.rotateY🎜 🎜🎜숫자 y 수직 거리🎜🎜🎜🎜1500🎜<span style="color:#111111;font-family:NSimsun">"반발"</span>  击退效果
<span style="color: #111111;font-family:NSimsun">interactivity.events.onclick.enable</span>

boolean  点击效果

🎜<span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>🎜
🎜<span style="color:#111111;font-family:NSimsun">interactivity.events.onclick.mode</span>🎜🎜🎜string 🎜      배열 선택🎜🎜点击效果模式🎜🎜interactivity.events.modes.bubble.duration 스팬>🎜🎜🎜number    원자抓取泡沫效果之间的持续事件🎜     (두번째)interactivity.events.modes.repulse.distance🎜<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.repulse.duration</span> 🎜🎜번호      击退效果持续事件🎜     (두번째)<span style="color:#111111;font-family: NSimsun">interactivity.events.modes.push.particles_nb</span>
<span style="color:#111111;font-family:NSimsun">particles.number.value</span> number   数量 <span style="color:#111111;font-family:NSimsun">40</span>
<span style="color:#111111;font-family:NSimsun">particles.number.density.enable</span> boolean    <span style="color:#111111;font-family:NSimsun">true</span>40 <span style="color:#111111;font-family:NSimsun"></span>🎜🎜🎜particles.number.density.enable🎜
<span style="color:#111111;font -family:NSimsun">particles.number.density.value_area</span><code style="padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px"><span style="color:#111111;font-family:NSimsun">particles.number.density.value_area</span> number   区域散布密度大小 <span style="color:#111111;font-family:NSimsun">800</span>
<span style="color:#111111;font-family:NSimsun">particles.color.value</span> number   区域散布密島大小


<span style="color:#111111;font-family:NSimsun">800</span>


<span style="color:#111111;font-family:NSimsun">particles.color.value</span>

🎜 🎜🎜HEX(문자열) 🎜      RGB(객체) 🎜      HSL(객체) 🎜      배열 선택(HEX) 🎜      무작위(문자열)🎜🎜원래의 颜color🎜
<span style="color:#111111;font-family: NSimsun">"#b61924"</span> <span style="color:#111111;font-family:NSimsun">"#b61924"</span> 
<span style="color:#111111;font-family:NSimsun">{r:182, g:25, b:36}</span> 
<span style="color:#111111;font-family:NSimsun">{h:356, s:76, l:41}</span> 
<span style="color:#111111;font-family:NSimsun">["#b61924", "#333333", "999999"]</span> 
<span style="color:#111111;font-family:NSimsun">"random"</span>
<span style="color:#111111;font-family:NSimsun">particles.shape.type</span> string 
     array selection 原子的形状
<span style="color:#111111;font-family:NSimsun">"circle"</span> 
<span style="color:#111111;font-family:NSimsun">"edge"</span> 
<span style="color:#111111;font-family:NSimsun">"triangle"</span> 
<span style="color:#111111;font-family:NSimsun">"polygon"</span> 
<span style="color:#111111;font-family:NSimsun">"star"</span> 
<span style="color:#111111;font-family:NSimsun">"image"</span>{r:182, g:25, b:36} 
<span style="color:#111111;font-family:NSimsun">{h:356, s:76, l :41}</span> 🎜<span style="color:#111111;font-family:NSimsun">["#b61924", "#333333", "999999"]</span> 🎜<span style="color:#111111;font-family:NSimsun">"random"</span>🎜
<span style="color:#111111;font-family:NSimsun">particles.shape.stroke.width</span> number      原理的宽度 <span style="color:#111111;font-family:NSimsun">2</span>
<span style="color:#111111;font-family:NSimsun">particles.shape.stroke.color</span> HEX (string)  原子颜色 <span style="color:#111111;font-family:NSimsun">"#222222"</span>
<span style="color:#111111;font-family:NSimsun">particles.shape.polygon.nb_slides</span> number       原子的多边形边数 <span style="color:#111111;font-family:NSimsun">5</span>
<span style="color:#111111;font-family:NSimsun">particles.shape.image.src</span> 경로 링크 
     svg / png / gif / jpg  원래자적이미지可以使用 사용자 정의义图 Images
<span style="color:#111111;font-family:NSimsun">"assets/img/yop.svg"</span> <span style="color:#111111;font-family:NSimsun">"assets/img/yop.svg"</span> 
<span style="color:#111111;font-family:NSimsun">"http://mywebsite.com/assets/img/yop.png"</span>
<span style="color:#111111;font-family:NSimsun">particles.shape.image.width</span> number 
     (for aspect ratio)    图片宽度
<span style="color:#111111;font-family:NSimsun">100</span>
<span style="color:#111111;font-family:NSimsun">particles.shape.image.height</span><span style="color:#111111;font-family:NSimsun">"http://mywebsite.com/assets/img/ yop.png"</span>
<span style="color:#111111;font-family: NSimsun">particles.shape.image.width</span>
🎜number 🎜      (가로세로 비율)    图 Images宽degree🎜🎜<span style="color: #111111;font-family:NSimsun">100</span>🎜
<span style="color:#111111;font-family:NSimsun">100</span>
<span style="color:#111111;font-family:NSimsun">particles.opacity.value</span> number (0 to 1)   不透明度 <span style="color:#111111;font-family:NSimsun">0.75</span>
<span style="color:#111111;font-family:NSimsun">particles.opacity.random</span> boolean     随机不透明度 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">particles.opacity.anim.enable</span> boolean            渐变动画 <span style="color:#111111;font-family:NSimsun">true</span>100<span style="color:#111111;font-family:NSimsun"></span>
<span style="color:#111111;font-family:NSimsun">particles.opacity.anim.speed</span> number            渐变动画速度 <span style="color:#111111;font-family:NSimsun">3</span>
<span style="color:#111111;font-family:NSimsun">particles.opacity.anim.opacity_min</span> number (0 to 1)       渐变动画不透明度 <span style="color:#111111;font-family:NSimsun">0.25</span>
<span style="color:#111111;font-family:NSimsun">particles.opacity.anim.sync</span> boolean <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
number                     그라데이션 애니메이션 속도 <span style="color:#111111;font-family:NSimsun"></span>🎜🎜3🎜🎜🎜🎜🎜 🎜🎜🎜p 기사.opacity.anim.opacity_min🎜🎜🎜🎜번호 (0 1) 그라디언트 애니메이션 불투명도🎜🎜🎜🎜0.25🎜🎜🎜🎜🎜🎜🎜🎜particles.opacity.anim.sync🎜🎜🎜🎜boolean🎜🎜🎜🎜true🎜 🎜 / 🎜🎜거짓🎜🎜🎜🎜🎜🎜🎜🎜 입자.크기.값🎜 number 원자 크기 <span style="color:#111111;font-family:NSimsun">20</span>
<span style="color:#111111;font-family:NSimsun">particles.size.random</span> boolean       原子大小随机 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">particles.size.anim.enable</span> boolean      原子渐变 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">particles.size.anim.speed</span>
<span style="color:#111111;font-family:NSimsun">particles.size.anim.size_min</span> number <span style="color:#111111;font-family:NSimsun">0.25</span>
<span style="color:#111111;font-family:NSimsun">particles.size.anim.sync</span> boolean <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">particles.line_linked.enable</span> boolean       连接线 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
number<span style="color:#111111;font-family:NSimsun"></span>🎜🎜0.25🎜🎜🎜🎜🎜🎜🎜🎜particles.size.anim.sync 🎜🎜🎜🎜boolean🎜🎜🎜🎜true🎜 🎜 / 🎜🎜false🎜🎜🎜🎜🎜🎜🎜🎜particles.line_linked.enable🎜🎜🎜🎜boolean 🎜🎜🎜🎜true🎜🎜 / 🎜 🎜false🎜 🎜🎜🎜🎜🎜🎜🎜particles.line_linked.distance🎜 number 연결선 거리 <span style="color:#111111;font-family:NSimsun">150</span>
<span style="color:#111111;font-family:NSimsun">particles.line_linked.color</span> HEX (string)   连接线颜色 <span style="color:#111111;font-family:NSimsun">#ffffff</span>
<span style="color:#111111;font-family:NSimsun">particles.line_linked.opacity</span> number (0 to 1)    连接线不透明度 <span style="color:#111111;font-family:NSimsun">0.5</span>
<span style="color:#111111;font-family:NSimsun">particles.line_linked.width</span>
<span style="color:#111111;font -family:NSimsun">particles.move.enable</span><code style="padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px"><span style="color:#111111;font-family:NSimsun">particles.move.enable</span> boolean     原子移动 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">particles.move.speed</span> number     原子移动速度 <span style="color:#111111;font-family:NSimsun">4</span>
<span style="color:#111111;font-family:NSimsun">particles.move.direction</span> string              原子移动方向 <span style="color:#111111;font-family:NSimsun">"none"</span> 
<span style="color:#111111;font-family:NSimsun">"top"</span> 
<span style="color:#111111;font-family:NSimsun">"top-right"</span> 
<span style="color:#111111;font-family:NSimsun">"right"</span> 
<span style="color:#111111;font-family:NSimsun">"bottom-right"</span>
🎜boolean     原子移动🎜🎜<span style="color:#111111;font-family:NSimsun">true</span>🎜 / <span style="color:#111111;font-family:NSimsun">false</span>🎜🎜🎜🎜🎜particles.move.speed 스팬>🎜🎜🎜숫자     하라자移动速島🎜🎜4🎜🎜🎜🎜🎜<span style="color:#111111;font-family:NSimsun">particles.move.direction</span>🎜🎜🎜string              hara子移动方向🎜🎜"없음"🎜 🎜"상단"🎜 🎜"오른쪽 상단"🎜 🎜"오른쪽"🎜 🎜"오른쪽 아래"🎜 🎜"bottom" 
<span style="color:#111111;font-family:NSimsun">"bottom-left"</span> 
<span style="color:#111111;font-family:NSimsun">"left"</span> 
<span style="color:#111111;font-family:NSimsun">"top-left"</span>
<span style="color:#111111;font-family:NSimsun">particles.move.random</span> boolean              移动随机方向 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">particles.move.straight</span> boolean              直接移动 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">particles.move.out_mode</span> 문자열  
     (캔버스 외부)        是否移动流画布
<span style=" color:#111111;font-family:NSimsun">"out"</span> <span style="color:#111111;font-family:NSimsun">"out"</span> 
<span style="color:#111111;font-family:NSimsun">"bounce"</span>
<span style="color:#111111;font-family:NSimsun">particles.move.bounce</span><span style="color:#111111;font-family:NSimsun">"바운스"</span>
<span style="color:#111111;font-family:NSimsun">particles.move.bounce</span>
🎜boolean 🎜(입자간) 점프 및 이동 여부
<span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">particles.move.attract.enable</span> boolean           原子之间吸引 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">particles.move.attract.rotateX</span> number   原子之间吸引X水平距离 <span style="color:#111111;font-family:NSimsun">3000</span>
<span style="color:#111111;font-family:NSimsun">particles.move.attract.rotateY</span> / false
<span style="color:#111111;font -family:NSimsun">interactivity.Detect_on</span><code style="padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px"><span style="color:#111111;font-family:NSimsun">interactivity.detect_on</span> string        原子之间互动检测 <span style="color:#111111;font-family:NSimsun">"canvas", "window"</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.onhover.enable</span> boolean    悬停 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.onhover.mode</span> string        원자지间互动检测


<span style="color:#111111;font-family:NSimsun">"캔버스", "창"</span>

🎜🎜interactivity.events.onhover.enable🎜🎜🎜boolean    悬停🎜🎜true🎜 / <span style="color:#111111;font-family:NSimsun">false</span>🎜🎜🎜🎜🎜<span style="color:#111111;font-family:NSimsun">interactivity.events.onhover.mode</span>🎜🎜🎜🎜string 🎜      배열 선택🎜🎜悬停模式 🎜
<span style="color:#111111;font-family: NSimsun">"grab"</span>     抓取临近的<span style="color:#111111;font-family:NSimsun">"grab"</span>     抓取临近的
<span style="color:#111111;font-family:NSimsun">"bubble"</span>  泡沫球效果
<span style="color:#111111;font-family:NSimsun">"repulse"</span>  击退效果
<span style="color:#111111;font-family:NSimsun">["grab", "bubble"]</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.onclick.enable</span> boolean  点击效果 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.onclick.mode</span><span style="color:#111111;font-family:NSimsun">"거품"</span>  泡沫球效果 <span style="color:#111111;font-family:NSimsun ">["grab", "bubble"]</span>

<span style="color:#111111;font-family:NSimsun">"push"</span> 
<span style="color:#111111;font-family:NSimsun">"remove"</span> 
<span style="color:#111111;font-family:NSimsun">"bubble"</span> 
<span style="color:#111111;font-family:NSimsun">"repulse"</span> 
<span style="color:#111111;font-family:NSimsun">["push", "repulse"]</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.resize</span> boolean         互动事件调整 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.grab.distance</span> number        原子互动抓取距离 <span style="color:#111111;font-family:NSimsun">100</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.grab.line_linked.opacity</span> number (0 to 1)        原子互动抓取距离连线不透明度 <span style="color:#111111;font-family:NSimsun">0.75</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.bubble.distance</span> 숫자       하라자抓取泡沫效果之间的距离 100<span style="color:#111111;font-family:NSimsun">100</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.bubble.size</span> number       原子抓取泡沫效果之间的大小 <span style="color:#111111;font-family:NSimsun">40</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.bubble.duration</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.bubble.size</span>
🎜🎜number       원자자抓取泡沫效果之间的大小🎜🎜<span style="color:#111111;font-family:NSimsun">40</span>🎜🎜 /tr>
0.4<span style="color:#111111;font-family:NSimsun">0.4</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.repulse.distance</span> number       击退效果距离 <span style="color:#111111;font-family:NSimsun">200</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.repulse.duration</span>

number       击退效果距离🎜🎜<span style="color:#111111;font-family:NSimsun">200</span>🎜
<span style="color:#111111;font -family:NSimsun">1.2</span><span style="color:#111111;font-family:NSimsun">1.2</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.push.particles_nb</span> number         粒子推出的数量 <span style="color:#111111;font-family:NSimsun">4</span>
<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.push.particles_nb</span> number <span style="color:#111111;font-family:NSimsun">4</span>
<span style="color:#111111;font-family:NSimsun">retina_detect</span> boolean <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>
number         粒子推出的数weight🎜🎜<span style="color:#111111;font-family:NSimsun">4</span>🎜🎜🎜<span style="color:#111111;font-family:NSimsun">interactivity.events.modes.push.particles_nb</span>🎜🎜number🎜🎜<span style="color:#111111;font-family:NSimsun">4</span>🎜🎜 🎜<span style="color:#111111;font-family:NSimsun">retina_Detect</span>🎜🎜boolean🎜 <span style="color:#111111;font-family:NSimsun">true</span> / <span style="color:#111111;font-family:NSimsun">false</span>🎜🎜🎜🎜

위 내용은 JS 라이브러리 Particles.js 중국어 개발 매뉴얼의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿