This file contains hidden or 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
/** | |
* Will gracefuly scroll the page | |
* This function will scroll the page using | |
* an `ease-in-out` effect. | |
* | |
* You can use it to scroll to a given element, as well. | |
* To do so, pass the element instead of a number as the position. | |
* Optionally, you can pass a `queryString` for an element selector. | |
* | |
* The default duration is half a second (500ms) |
This file contains hidden or 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
"use strict"; | |
class MyCustomMaterial extends THREE.ShaderMaterial { | |
// constructor takes appropriate parameters. | |
// Default values using object destructuring (ES6) | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Object_destructuring | |
constructor({ | |
color = 0xffffff, | |
emissive = 0x000000, |