()
| 11722 | loadTextures(); |
| 11723 | |
| 11724 | function init() { |
| 11725 | canvas = document.querySelector('#container'); |
| 11726 | |
| 11727 | var dpi = window.devicePixelRatio; |
| 11728 | canvas.width = window.innerWidth * dpi; |
| 11729 | canvas.height = window.innerHeight * dpi; |
| 11730 | canvas.style.width = window.innerWidth + "px"; |
| 11731 | canvas.style.height = window.innerHeight + "px"; |
| 11732 | |
| 11733 | raindrops = new _raindrops2["default"](canvas.width, canvas.height, dpi, dropAlpha, dropColor); |
| 11734 | raindrops.trailRate = 1; |
| 11735 | raindrops.trailScaleRange = [0.2, 0.45]; |
| 11736 | |
| 11737 | textureFg = (0, _createCanvas2["default"])(textureFgSize.width, textureFgSize.height); |
| 11738 | textureFgCtx = textureFg.getContext('2d'); |
| 11739 | textureBg = (0, _createCanvas2["default"])(textureBgSize.width, textureBgSize.height); |
| 11740 | textureBgCtx = textureBg.getContext('2d'); |
| 11741 | |
| 11742 | generateTextures(textureRainFg, textureRainBg); |
| 11743 | |
| 11744 | renderer = new _rainRenderer2["default"](canvas, raindrops.canvas, textureFg, textureBg, null, { |
| 11745 | brightness: 1.04, |
| 11746 | alphaMultiply: 10, |
| 11747 | alphaSubtract: 3, |
| 11748 | minRefraction: 128 |
| 11749 | }); |
| 11750 | |
| 11751 | setupEvents(); |
| 11752 | } |
| 11753 | |
| 11754 | function setupEvents() { |
| 11755 |
no test coverage detected