Skip to content

Commit 5b0d19b

Browse files
author
Guillermo Moraleda
committed
Restore particles background runtime
1 parent aa0f1c8 commit 5b0d19b

4 files changed

Lines changed: 229 additions & 3 deletions

File tree

_includes/footer.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
<p>Built with Jekyll</p>
44
<p>Original theme by <a href="https://github.com/nrandecker">Nathan Randecker</a></p>
55
</footer>
6+
<script src="//cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
7+
<script src="{{ '/assets/js/sweet-scroll.min.js' | prepend: site.baseurl }}"></script>
68
<script src="{{ '/assets/js/main.js' | prepend: site.baseurl }}"></script>
79
{% include google-analytics.html %}

_includes/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div id="hero">
1+
<div id="particles-js">
22
<div class="header">
33
<p class="site-kicker">{{ site.username }}</p>
44
<h1>

assets/js/main.js

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,115 @@
11
document.addEventListener('DOMContentLoaded', function () {
2-
// Intentionally lightweight to keep the landing page fast and dependency-free.
2+
new SweetScroll({});
3+
4+
particlesJS('particles-js', {
5+
particles: {
6+
number: {
7+
value: 30,
8+
density: {
9+
enable: true,
10+
value_area: 800,
11+
},
12+
},
13+
color: {
14+
value: '#ffffff',
15+
},
16+
shape: {
17+
type: 'polygon',
18+
stroke: {
19+
width: 0,
20+
color: '#000000',
21+
},
22+
polygon: {
23+
nb_sides: 5,
24+
},
25+
image: {
26+
src: 'img/github.svg',
27+
width: 100,
28+
height: 100,
29+
},
30+
},
31+
opacity: {
32+
value: 0.5,
33+
random: false,
34+
anim: {
35+
enable: false,
36+
speed: 1,
37+
opacity_min: 0.1,
38+
sync: false,
39+
},
40+
},
41+
size: {
42+
value: 3,
43+
random: true,
44+
anim: {
45+
enable: false,
46+
speed: 19.18081918081918,
47+
size_min: 0.1,
48+
sync: false,
49+
},
50+
},
51+
line_linked: {
52+
enable: true,
53+
distance: 150,
54+
color: '#ffffff',
55+
opacity: 0.4,
56+
width: 1,
57+
},
58+
move: {
59+
enable: true,
60+
speed: 4,
61+
direction: 'none',
62+
random: true,
63+
straight: false,
64+
out_mode: 'out',
65+
bounce: false,
66+
attract: {
67+
enable: false,
68+
rotateX: 600,
69+
rotateY: 1200,
70+
},
71+
},
72+
nb: 80,
73+
},
74+
interactivity: {
75+
detect_on: 'canvas',
76+
events: {
77+
onhover: {
78+
enable: false,
79+
mode: 'grab',
80+
},
81+
onclick: {
82+
enable: true,
83+
mode: 'push',
84+
},
85+
resize: true,
86+
},
87+
modes: {
88+
grab: {
89+
distance: 400,
90+
line_linked: {
91+
opacity: 1,
92+
},
93+
},
94+
bubble: {
95+
distance: 400,
96+
size: 40,
97+
duration: 2,
98+
opacity: 8,
99+
speed: 3,
100+
},
101+
repulse: {
102+
distance: 200,
103+
duration: 0.4,
104+
},
105+
push: {
106+
particles_nb: 4,
107+
},
108+
remove: {
109+
particles_nb: 2,
110+
},
111+
},
112+
},
113+
retina_detect: true,
114+
});
3115
});

src/js/app.js

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,115 @@
11
document.addEventListener('DOMContentLoaded', function () {
2-
// Intentionally lightweight to keep the landing page fast and dependency-free.
2+
new SweetScroll({});
3+
4+
particlesJS('particles-js', {
5+
particles: {
6+
number: {
7+
value: 30,
8+
density: {
9+
enable: true,
10+
value_area: 800,
11+
},
12+
},
13+
color: {
14+
value: '#ffffff',
15+
},
16+
shape: {
17+
type: 'polygon',
18+
stroke: {
19+
width: 0,
20+
color: '#000000',
21+
},
22+
polygon: {
23+
nb_sides: 5,
24+
},
25+
image: {
26+
src: 'img/github.svg',
27+
width: 100,
28+
height: 100,
29+
},
30+
},
31+
opacity: {
32+
value: 0.5,
33+
random: false,
34+
anim: {
35+
enable: false,
36+
speed: 1,
37+
opacity_min: 0.1,
38+
sync: false,
39+
},
40+
},
41+
size: {
42+
value: 3,
43+
random: true,
44+
anim: {
45+
enable: false,
46+
speed: 19.18081918081918,
47+
size_min: 0.1,
48+
sync: false,
49+
},
50+
},
51+
line_linked: {
52+
enable: true,
53+
distance: 150,
54+
color: '#ffffff',
55+
opacity: 0.4,
56+
width: 1,
57+
},
58+
move: {
59+
enable: true,
60+
speed: 4,
61+
direction: 'none',
62+
random: true,
63+
straight: false,
64+
out_mode: 'out',
65+
bounce: false,
66+
attract: {
67+
enable: false,
68+
rotateX: 600,
69+
rotateY: 1200,
70+
},
71+
},
72+
nb: 80,
73+
},
74+
interactivity: {
75+
detect_on: 'canvas',
76+
events: {
77+
onhover: {
78+
enable: false,
79+
mode: 'grab',
80+
},
81+
onclick: {
82+
enable: true,
83+
mode: 'push',
84+
},
85+
resize: true,
86+
},
87+
modes: {
88+
grab: {
89+
distance: 400,
90+
line_linked: {
91+
opacity: 1,
92+
},
93+
},
94+
bubble: {
95+
distance: 400,
96+
size: 40,
97+
duration: 2,
98+
opacity: 8,
99+
speed: 3,
100+
},
101+
repulse: {
102+
distance: 200,
103+
duration: 0.4,
104+
},
105+
push: {
106+
particles_nb: 4,
107+
},
108+
remove: {
109+
particles_nb: 2,
110+
},
111+
},
112+
},
113+
retina_detect: true,
114+
});
3115
});

0 commit comments

Comments
 (0)