Created
February 27, 2019 12:04
-
-
Save zet777/2f50db0cbfdd19d5f6b0f49d0cd284ad to your computer and use it in GitHub Desktop.
Анимация градиента с плагином granim.js
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
<canvas id="canvas-basic"></canvas> | |
<canvas id="canvas-radial"></canvas> |
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
#canvas-basic, | |
#canvas-radial { | |
position: relative; | |
display: block; | |
width: 100%; | |
height: 300px; | |
margin-bottom: 20px; | |
} |
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
var granimInstance = new Granim({ | |
element: '#canvas-basic', | |
name: 'basic-gradient', | |
direction: 'left-right', | |
opacity: [1, 1], | |
isPausedWhenNotInView: true, | |
states : { | |
"default-state": { | |
gradients: [ | |
['#1967c3', '#4a90e2'], | |
['#02AAB0', '#00CDAC'], | |
['#DA22FF', '#9733EE'] | |
] | |
} | |
} | |
}); | |
var granimInstance = new Granim({ | |
element: '#canvas-radial', | |
name: 'radial-gradient', | |
direction: 'radial', | |
opacity: [1, 1], | |
isPausedWhenNotInView: true, | |
states : { | |
"default-state": { | |
gradients: [ | |
['#ffb347', '#ffcc33'], | |
['#83a4d4', '#b6fbff'], | |
['#9D50BB', '#6E48AA'] | |
] | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment