Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thomasDOTwtf
hub
Commits
03e01e3e
Commit
03e01e3e
authored
3 years ago
by
Dj
Browse files
Options
Downloads
Patches
Plain Diff
fix(parallax-css-testpage): Remove object destructuring to increase compatibility.
parent
7d28b015
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parallax-css-testpage/particles.js
+16
-14
16 additions, 14 deletions
src/parallax-css-testpage/particles.js
with
16 additions
and
14 deletions
src/parallax-css-testpage/particles.js
+
16
−
14
View file @
03e01e3e
...
...
@@ -66,9 +66,6 @@ function RandomPoint2D(minMaxX, minMaxY) {
return
Point2D
(
x
,
y
)
}
function
Particle
({
position
,
direction
,
size
,
color
})
{
return
{
position
,
direction
,
size
,
color
}
}
//
...
...
@@ -216,7 +213,12 @@ function Animate(scene, particles) {
}
}
function
CreateScene
({
canvasId
,
contentId
,
depth
,
fps
})
{
function
CreateScene
(
cfg
)
{
var
canvasId
=
cfg
.
canvasId
,
contentId
=
cfg
.
contentId
,
depth
=
cfg
.
depth
,
fps
=
cfg
.
fps
var
contentNode
=
document
.
getElementById
(
contentId
),
height
=
getNodeHeight
(
contentNode
),
width
=
window
.
innerWidth
,
...
...
@@ -243,19 +245,19 @@ function CreateScene({ canvasId, contentId, depth, fps }) {
}
function
CreateParticles
(
scene
,
{
density
,
color
,
size
,
speed
,
lifespan
,
})
{
function
CreateParticles
(
scene
,
cfg
)
{
var
density
=
cfg
.
density
,
color
=
cfg
.
color
,
size
=
cfg
.
size
,
speed
=
cfg
.
speed
,
lifespan
=
cfg
.
lifespan
return
Array
.
from
(
{
length
:
calcParticleCount
(
scene
,
density
)
},
function
create
Particle
()
{
return
Particle
(
{
function
Particle
()
{
return
{
position
:
RandomPoint2D
(
MinMax
(
0
,
(
scene
.
width
-
(
size
*
2
))),
...
...
@@ -278,7 +280,7 @@ function CreateParticles(scene, {
:
+
1
,
},
color
}
)
}
}
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment