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" href="css/index.min.css"
crossorigin="anonymous"/> crossorigin="anonymous"/>
</head> </head>
<body onload='particles(false, false, 2, 0.5)'> <body onload='particles(false, false, 2, 10)'>
<canvas id="particles"></canvas> <canvas id="particles"></canvas>
<!-- javascript --> <!-- javascript -->
<script <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 /* create particles animation
based on the amazing tutorial by 'Franks Labratory' based on the amazing tutorial by 'Franks Labratory'
https://youtu.be/d620nV6bp0A 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 canvas = document.getElementById('particles');
const canvasContext = canvas.getContext('2d'); const canvasContext = canvas.getContext('2d');
// divide the speed parameter by 100
speed = (speed / 100);
// read css colour variables from root element // read css colour variables from root element
const particleColour = getComputedStyle(document.documentElement).getPropertyValue('--col-particle'); const particleColour = getComputedStyle(document.documentElement).getPropertyValue('--col-particle');
const strokeColour = getComputedStyle(document.documentElement).getPropertyValue('--col-particle-stroke'); const strokeColour = getComputedStyle(document.documentElement).getPropertyValue('--col-particle-stroke');