Merge pull request #1 from 9x/add-particle-animation

Add interactive particle animation background
This commit is contained in:
Jens Mohrmann
2025-02-16 23:05:11 +01:00
committed by GitHub
4 changed files with 135 additions and 35 deletions

View File

@@ -18,14 +18,20 @@ main {
/* ---- particles.js container ---- */
#particles-js{
/* background: #314159; */
position:fixed;
filter: blur(5px);
position: fixed;
width: 100%;
height: 100%;
z-index: -10;
top: 0;
left: 0;
z-index: 0;
filter: blur(10px);
}
canvas {
display: block;
pointer-events: auto !important;
}
#bg{
background: #314159;
position:fixed;

View File

@@ -17,9 +17,9 @@
</head>
<body>
<!-- <div id="particles-js" style="position:fixed"></div> -->
<div id="bg"></div>
<main>
<div id="particles-js"></div>
<main style="position: relative; z-index: 1;">
<div class="intro">Dr. Jens Mohrmann</div>
<div class="tagline">Physicist | Product Development Engineer</div>
@@ -49,8 +49,8 @@
<span class="sr-only">YouTube</span>
</a>
</div>
<!-- <script src="js/particles.js"></script> -->
<!-- <script src="js/app.js"></script> -->
<script src="js/particles.min.js"></script>
<script src="js/particles-config.js"></script>
</main>
</body>
</html>

85
js/particles-config.js Normal file
View File

@@ -0,0 +1,85 @@
particlesJS('particles-js', {
particles: {
number: {
value: 50,
density: {
enable: true,
value_area: 800
}
},
color: {
value: '#ffffff'
},
shape: {
type: 'circle'
},
opacity: {
value: 0.6,
random: true,
anim: {
enable: true,
speed: 1,
opacity_min: 0.3,
sync: false
}
},
size: {
value: 5,
random: true,
anim: {
enable: true,
speed: 2,
size_min: 0.5,
sync: false
}
},
line_linked: {
enable: true,
distance: 150,
color: '#ffffff',
opacity: 0.4,
width: 3
},
move: {
enable: true,
speed: 1,
direction: 'none',
random: true,
straight: false,
out_mode: 'out',
bounce: false,
attract: {
enable: false,
rotateX: 600,
rotateY: 1200
}
}
},
interactivity: {
detect_on: 'window',
events: {
onhover: {
enable: true,
mode: 'grab'
},
onclick: {
enable: true,
mode: 'repulse'
},
resize: true
},
modes: {
grab: {
distance: 200,
line_linked: {
opacity: 0.5
}
},
repulse: {
distance: 100,
duration: 0.4
}
}
},
retina_detect: true
});

9
js/particles.min.js vendored Normal file

File diff suppressed because one or more lines are too long