added particles

This commit is contained in:
Janis
2022-10-31 16:06:03 +01:00
parent 53555aad6a
commit 63f113ec0b
11 changed files with 1954 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
const subCount = document.getElementById("subCount");
const frame = document.getElementById("frame");
const tfBanner = document.getElementById("teafire-banner");
const tfBanner = document.getElementById("tealfire-banner");
let subCountNumber = 0;
@@ -16,6 +16,8 @@ function updateSubCount() {
}
function sub(subName) {
particlesJS.load("particles-frame", "js/particles-sub.json");
frame.style.animationName = "subAnimation";
frame.style.animationDuration = "2s";
@@ -32,6 +34,8 @@ function sub(subName) {
subCount.style.animationDuration = "20s";
subCount.innerText = subCountNumber;
updateSubCount();
console.log(particlesJS);
particlesJS.load("particles-frame", "js/particles-none.json");
}, 11000);
}
@@ -62,6 +66,8 @@ setInterval(() => {
showTealFireBanner();
setTimeout(() => {
closeTealFireBanner();
}, 20000);
}, 300000);
}, 20000); //20000
}, 300000); // 300000
updateSubCount();
particlesJS.load("tealfire-banner", "js/particles-banner.json");

View File

@@ -0,0 +1,22 @@
{
"name": "particles.js",
"main": "particles.js",
"version": "2.0.0",
"homepage": "https://github.com/VincentGarreau/particles.js",
"authors": [
"Vincent Garreau <vin.garreau@gmail.com>"
],
"description": "A lightweight JavaScript library for creating particles.",
"keywords": [
"particle",
"particles"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}

View File

@@ -0,0 +1,28 @@
{
"name": "particles.js",
"version": "2.0.0",
"description": "A lightweight JavaScript library for creating particles",
"homepage": "http://vincentgarreau.com/particles.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/VincentGarreau/particles.js.git"
},
"keywords": [
"particles",
"particle",
"canvas"
],
"author": "Vincent Garreau",
"license": "MIT",
"files": [
"particles.js",
"particles.min.js"
],
"bugs": {
"url": "https://github.com/VincentGarreau/particles.js/issues"
},
"homepage": "https://github.com/VincentGarreau/particles.js"
}

File diff suppressed because it is too large Load Diff

9
js/modules/particles/particles.min.js vendored Normal file

File diff suppressed because one or more lines are too long

110
js/particles-banner.json Normal file
View File

@@ -0,0 +1,110 @@
{
"particles": {
"number": {
"value": 400,
"density": {
"enable": true,
"value_area": 100
}
},
"color": {
"value": "#00d680"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.7,
"random": true,
"anim": {
"enable": true,
"speed": 1,
"opacity_min": 0,
"sync": false
}
},
"size": {
"value": 2,
"random": true,
"anim": {
"enable": false,
"speed": 1,
"size_min": 0.3,
"sync": false
}
},
"line_linked": {
"enable": false,
"distance": 150,
"color": "#d60e00",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 0.3,
"direction": "none",
"random": true,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 600
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "bubble"
},
"onclick": {
"enable": true,
"mode": "repulse"
},
"resize": true
},
"modes": {
"grab": {
"distance": 200,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 10,
"size": 0,
"duration": 2,
"opacity": 0,
"speed": 1
},
"repulse": {
"distance": 400,
"duration": 0.4
},
"push": {
"particles_nb": 2
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}

110
js/particles-none.json Normal file
View File

@@ -0,0 +1,110 @@
{
"particles": {
"number": {
"value": 0,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#fff"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#fff"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0,
"random": true,
"anim": {
"enable": true,
"speed": 1,
"opacity_min": 0,
"sync": false
}
},
"size": {
"value": 0,
"random": true,
"anim": {
"enable": false,
"speed": 4,
"size_min": 0.3,
"sync": false
}
},
"line_linked": {
"enable": false,
"distance": 150,
"color": "#d60e00",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 1,
"direction": "none",
"random": true,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 600
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "bubble"
},
"onclick": {
"enable": true,
"mode": "repulse"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 250,
"size": 0,
"duration": 2,
"opacity": 0,
"speed": 3
},
"repulse": {
"distance": 400,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}

110
js/particles-sub.json Normal file
View File

@@ -0,0 +1,110 @@
{
"particles": {
"number": {
"value": 200,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#d67d00"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 1,
"random": true,
"anim": {
"enable": true,
"speed": 2,
"opacity_min": 0,
"sync": false
}
},
"size": {
"value": 3,
"random": true,
"anim": {
"enable": false,
"speed": 2,
"size_min": 0.3,
"sync": false
}
},
"line_linked": {
"enable": false,
"distance": 150,
"color": "#d60e00",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 2,
"direction": "none",
"random": true,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 600
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "bubble"
},
"onclick": {
"enable": true,
"mode": "repulse"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 250,
"size": 0,
"duration": 2,
"opacity": 0,
"speed": 3
},
"repulse": {
"distance": 400,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}