change speed parameter base to 100

This commit is contained in:
Asif Bacchus 2020-04-08 05:26:04 -06:00
parent fe51090807
commit fb5a4675f8
2 changed files with 5 additions and 2 deletions

View File

@ -8,7 +8,7 @@
href="css/index.min.css"
crossorigin="anonymous"/>
</head>
<body onload='particles(false, false, 2, 0.5)'>
<body onload='particles(false, false, 2, 10)'>
<canvas id="particles"></canvas>
<!-- javascript -->
<script

View File

@ -1,4 +1,4 @@
function particles(avoidMouse = true, hover = true, particles = 2, speed = 0.5){
function particles(avoidMouse = true, hover = true, particles = 2, speed = 50){
/* create particles animation
based on the amazing tutorial by 'Franks Labratory'
https://youtu.be/d620nV6bp0A
@ -7,6 +7,9 @@ function particles(avoidMouse = true, hover = true, particles = 2, speed = 0.5){
const canvas = document.getElementById('particles');
const canvasContext = canvas.getContext('2d');
// divide the speed parameter by 100
speed = (speed / 100);
// read css colour variables from root element
const particleColour = getComputedStyle(document.documentElement).getPropertyValue('--col-particle');
const strokeColour = getComputedStyle(document.documentElement).getPropertyValue('--col-particle-stroke');