Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrated from particles.js to tsParticles #34

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/blog-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ <h2>Conclusion</h2>
'visible': scrolled,
'': !scrolled
}"></a></div>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-slim@2.3.2/tsparticles.slim.bundle.min.js"></script>
<script src="./js/bundle.js"></script>

</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ <h2 class="subtitle is-6 is-light is-thin">
'visible': scrolled,
'': !scrolled
}"></a></div>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-slim@2.3.2/tsparticles.slim.bundle.min.js"></script>
<script src="./js/bundle.js"></script>

</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/css/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ico.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ <h1 class="title is-3 is-light is-semibold is-spaced main-title has-text-centere
'visible': scrolled,
'': !scrolled
}"></a></div>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-slim@2.3.2/tsparticles.slim.bundle.min.js"></script>
<script src="./js/bundle.js"></script>

</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
</div>

<!-- Animated particles -->
<div x-data="initHero()" x-init="initParticles()" id="particles-js"></div>
<div x-data="initHero()" x-init="initParticles()" id="tsparticles"></div>

<!-- Hero Image and Title -->
<div class="hero-body">
Expand Down Expand Up @@ -1364,7 +1364,7 @@ <h4 class="subtitle is-6 is-light has-text-centered is-compact">Viderer malorum
'visible': scrolled,
'': !scrolled
}"></a></div>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-slim@2.3.2/tsparticles.slim.bundle.min.js"></script>
<script src="./js/bundle.js"></script>

</body>
Expand Down
91 changes: 19 additions & 72 deletions docs/js/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7313,54 +7313,31 @@
function initHero() {
return {
initParticles: function initParticles() {
particlesJS("particles-js", {
tsParticles.load("tsparticles", {
fullScreen: {
enable: false
},
particles: {
number: {
value: 50,
density: {
enable: true,
value_area: 1000,
area: 1000,
},
},
color: {
value: ["#5507fc"],
value: "#5507fc"
},
shape: {
type: "circle",
stroke: {
width: 5,
color: "#5507fc",
},
polygon: {
nb_sides: 5,
},
image: {
src: "img/github.svg",
width: 100,
height: 100,
},
type: "circle"
},
opacity: {
value: 0.6,
random: false,
anim: {
enable: false,
speed: 1,
opacity_min: 0.1,
sync: false,
},
value: 0.6
},
size: {
value: 2,
random: true,
anim: {
enable: false,
speed: 40,
size_min: 0.1,
sync: false,
},
value: { min: 0, max: 2 }
},
line_linked: {
links: {
enable: true,
distance: 120,
color: "#5507fc",
Expand All @@ -7369,58 +7346,28 @@
},
move: {
enable: true,
speed: 3,
speed: 1.5,
direction: "top",
random: false,
straight: false,
out_mode: "out",
bounce: false,
attract: {
enable: false,
rotateX: 600,
rotateY: 1200,
},
outModes: "out"
},
},
interactivity: {
detect_on: "canvas",
detectsOn: "window",
events: {
onhover: {
onHover: {
enable: true,
mode: "grab",
},
onclick: {
enable: false,
},
resize: true,
}
},
modes: {
grab: {
distance: 140,
line_linked: {
links: {
opacity: 1,
},
},
bubble: {
distance: 400,
size: 40,
duration: 2,
opacity: 8,
speed: 3,
},
repulse: {
distance: 200,
duration: 0.4,
},
push: {
particles_nb: 4,
},
remove: {
particles_nb: 2,
},
},
},
retina_detect: true,
}
}
}
});
},
};
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ <h2 class="subtitle is-5 is-light is-thin">
'visible': scrolled,
'': !scrolled
}"></a></div>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-slim@2.3.2/tsparticles.slim.bundle.min.js"></script>
<script src="./js/bundle.js"></script>

</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/token.html
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ <h4 class="subtitle is-6 is-light has-text-centered is-compact">Viderer malorum
'visible': scrolled,
'': !scrolled
}"></a></div>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-slim@2.3.2/tsparticles.slim.bundle.min.js"></script>
<script src="./js/bundle.js"></script>

</body>
Expand Down
85 changes: 16 additions & 69 deletions src/js/libs/components/hero/hero.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,32 @@
export function initHero() {
return {
initParticles() {
particlesJS("particles-js", {
tsParticles.load("tsparticles", {
"fullScreen": {
"enable": false
},
"particles": {
"number": {
"value": 50,
"density": {
"enable": true,
"value_area": 1000
"area": 1000
}
},
"color": {
"value": ["#5507fc"]
"value": "#5507fc"
},

"shape": {
"type": "circle",
"stroke": {
"width": 5,
"color": "#5507fc"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
"type": "circle"
},
"opacity": {
"value": 0.6,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 2,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
"value": { min: 0, max: 2 }
},
"line_linked": {
"links": {
"enable": true,
"distance": 120,
"color": "#5507fc",
Expand All @@ -58,58 +35,28 @@ export function initHero() {
},
"move": {
"enable": true,
"speed": 3,
"speed": 1.5,
"direction": "top",
"random": false,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
"outModes": "out"
}
},
"interactivity": {
"detect_on": "canvas",
"detectsOn": "window",
"events": {
"onhover": {
"onHover": {
"enable": true,
"mode": "grab"
},
"onclick": {
"enable": false
},
"resize": true
}
},
"modes": {
"grab": {
"distance": 140,
"line_linked": {
"links": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{> footer}}
{{> backtotop}}

<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-slim@2.3.2/tsparticles.slim.bundle.min.js"></script>
<script src="./js/bundle.js"></script>

</body>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/ico.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{> footer}}
{{> backtotop}}

<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-slim@2.3.2/tsparticles.slim.bundle.min.js"></script>
<script src="./js/bundle.js"></script>

</body>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>

<!-- Animated particles -->
<div x-data="initHero()" x-init="initParticles()" id="particles-js"></div>
<div x-data="initHero()" x-init="initParticles()" id="tsparticles"></div>

<!-- Hero Image and Title -->
<div class="hero-body">
Expand Down
2 changes: 1 addition & 1 deletion src/scss/layout/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ body {
}

//Js particles
#particles-js {
#tsparticles {
position: absolute;
top: 0;
left: 0;
Expand Down