change speed parameter base to 100
This commit is contained in:
parent
fe51090807
commit
fb5a4675f8
@ -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
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user