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
| // setup | |
| const wait = value => new Promise(resolve => { | |
| setTimeout(() => resolve(value), 3000); | |
| }); | |
| const fetchFoo = () => wait('foo'); | |
| const fetchBar = () => wait('bar'); | |
| const fetchBaz = () => wait('baz'); | |
| const fetchDataSlowly = async time => { |
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
| var cameraZ = camera.position.z; | |
| var planeZ = 5; | |
| var distance = cameraZ - planeZ; | |
| var aspect = viewWidth / viewHeight; | |
| var vFov = camera.fov * Math.PI / 180; | |
| var planeHeightAtDistance = 2 * Math.tan(vFov / 2) * distance; | |
| var planeWidthAtDistance = planeHeightAtDistance * aspect; | |
| // or |
A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
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
| /* | |
| * PixiJS Background Cover/Contain Script | |
| * Returns object | |
| * . { | |
| * container: PixiJS Container | |
| * . doResize: Resize callback | |
| * } | |
| * ARGS: | |
| * bgSize: Object with x and y representing the width and height of background. Example: {x:1280,y:720} | |
| * inputSprite: Pixi Sprite containing a loaded image or other asset. Make sure you preload assets into this sprite. |
HETIC - Année 2015
- Avant qu'on parle de responsive web design : A Dao of Web Design de John Allsopp
- L'article fondateur de Ethan Marcotte : Responsive Web Design
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
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
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
| var _vent = require('./vent.js').shared(); | |
| _vent.trigger('blah'); |
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
NewerOlder