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