Last active
February 7, 2020 17:39
-
-
Save navin-moorthy/d1571fde39982879ef7021f418178444 to your computer and use it in GitHub Desktop.
CloneCSS-GASP SpeedLines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 600 600"> | |
<g class="speedLines"> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
<line x1="0" y1="0" x2="0" y2="0"></line> | |
</g> | |
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": [ | |
"https://cdnjs.cloudflare.com/ajax/libs/gsap/3.0.5/gsap.min.js" | |
], | |
"styles": [] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const colorArray = ["violet", "blue", "green", "yellow", "red", "orange", "white", "pink"]; | |
gsap | |
.fromTo( | |
".speedLines line", | |
{ | |
attr: { | |
y1: 0, | |
y2: "random(20, 200)" | |
}, | |
x: "random(0, 600)", | |
y: -200, | |
stroke: gsap.utils.wrap(colorArray) | |
}, | |
{ | |
duration: "random(0.2, 0.6)", | |
y: 600, | |
ease: "none", | |
stagger: { | |
each: 0.2, | |
repeat: -1, | |
repeatRefresh: true | |
} | |
} | |
) | |
.seek(100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url("https://fonts.googleapis.com/cssfamily=Montserrat:400,700&display=swap"); | |
* { | |
box-sizing: border-box; | |
} | |
body { | |
height: 100vh; | |
margin: 0; | |
padding: 0; | |
overflow: hidden; | |
background-color: #1d1d1d; | |
display: grid; | |
place-items: center; | |
font-family: Montserrat; | |
} | |
.svg { | |
width: 100%; | |
height: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment