├── README.md ├── README.txt ├── favicon.png ├── icons ├── facebook.png ├── googleplus.png └── twitter.png ├── img └── social-thumbnail.jpg ├── index.html ├── js ├── CanvasWrapper.js ├── GSRVMock.js ├── WebGLSupport.js ├── loadScene.js └── shims.js ├── lib ├── CanvasWrapper.js ├── GSRVMock.js ├── WebGLSupport.js ├── analytics.js ├── animationpack.js ├── cannon.min.js ├── dat.gui.js ├── fsmpack.js ├── goo-control.js ├── goo.js ├── jquery-1.10.2.min.js ├── loadScene.js ├── passpack.js ├── physicspack.js ├── quadpack.js ├── scriptpack.js ├── style.css └── timelinepack.js ├── res ├── 12aefd66a637bdbfff7bb26441494dccf7ed1fd5.bin ├── 12fb4906a5f4ee0a2ee779e044d26d73cfda6a17.bin ├── 1f032a6ca477911a7489324c137bae00d0854c94.png ├── 3d516e623726c39abae0163b3643e2b0a84acd50.jpg ├── 57a56886feec2760996af827dde557aaf4fc5958.png ├── 5a0b1f200dfbb3cee7059e02689c87e2a6681cbc.bin ├── 6b13fe43b03b4671d3ab4faf13a8117b57478d5f.jpg ├── 72656ff2a16db88257ce98556d0bcde0bb7b1c0a.bin ├── 7c970405b450e5e304f13d6104f9f9f514bf43b7.png ├── 85b214637d0b81e8362d204078fd4562a9a8a6b0.bin ├── 9249972d93397064b8b984618485308094e8970c.png └── root.bundle └── style └── style.css /README.md: -------------------------------------------------------------------------------- 1 | # Motionblur 2 | 3 | Motion Blur shader for Goo Create, based on this article: http://john-chapman-graphics.blogspot.se/2013/01/what-is-motion-blur-motion-pictures-are.html 4 | 5 | The motion blur is a script. add it anywhere in the scene to turn on the effect. 6 | 7 | Here's the public Goo Create scene: https://create.goocreate.com/edit/474b80717f5c4e679781936c4b0fbeff.scene 8 | 9 | ## Caveats 10 | 11 | The effect does not seem to work for skyboxes. Get around this by making a skybox manually (create a big cube or sphere). 12 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | This archive contains a template for hosting your Goo Create project on a web server. 2 | Look in index.html for some guidance on how to do this. -------------------------------------------------------------------------------- /favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schteppe/motionblur/45e733a20600094014a1903b2ec09b3839452ab7/favicon.png -------------------------------------------------------------------------------- /icons/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schteppe/motionblur/45e733a20600094014a1903b2ec09b3839452ab7/icons/facebook.png -------------------------------------------------------------------------------- /icons/googleplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schteppe/motionblur/45e733a20600094014a1903b2ec09b3839452ab7/icons/googleplus.png -------------------------------------------------------------------------------- /icons/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schteppe/motionblur/45e733a20600094014a1903b2ec09b3839452ab7/icons/twitter.png -------------------------------------------------------------------------------- /img/social-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schteppe/motionblur/45e733a20600094014a1903b2ec09b3839452ab7/img/social-thumbnail.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MotionBlur - Goo Create 7 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 |
74 |
75 |

MotionBlur

76 | 77 |

Loading

78 |
79 |
80 |
81 |
82 |
83 | 88 | 89 |
90 | 91 |
92 |
93 | 94 |

No 3D Magic?

95 | 96 |
97 |

98 | We could not find a WebGL rendering context.
99 | Check out the link below for some help to get things running. 100 |

101 | 106 |
107 | 108 |
109 |

110 | WebGL seems to be disabled. Check out the link below, for some guidance on solving this problem. 111 |

112 | 113 | 114 | 119 |
120 | 121 |
122 | 123 |

124 | WebGL seems to be disabled! To enable it, follow these steps: 125 |

126 | 127 |
    128 |
  • 129 | Open a new tab, and enter chrome://flags. 130 |
  • 131 |
  • 132 | Find the post disable WebGL, if it is enabled, disable it. 133 |
  • 134 |
  • 135 | Restart chrome. After restarting, the scene you were trying to reach here, should load. If not, you will unfortunately need to read the next step. 136 |
  • 137 | 138 |
  • 139 | Open a new tab and enter chrome://gpu. Under Graphics Feature Status you will find the post WebGL. If the status of WebGL in the feature status still states Hardware acceleration disabled after making sure that the disable WebGL flag is not enabled, your graphics card is probably not supported or running properly. 140 |
  • 141 | 142 |
143 | 144 | 148 |
149 | 150 |
151 |

152 | WebGL seems to be disabled! To enable it, follow these steps: 153 |

154 | 155 |
    156 |
  • Open the Safari menu.
  • 157 |
  • Select Preferences.
  • 158 |
  • Open the Advanced tab.
  • 159 |
  • Enable the Developer menu by checking the Show Develop menu in menu bar checkbox.
  • 160 |
  • Open the Develop menu in the menu bar.
  • 161 |
  • Select Enable WebGL.
  • 162 |
  • You will then may have to restart your browser to enable the changes.
  • 163 |
  • If this has not worked for you, try checking out...
  • 164 |
165 | 166 | 170 | 171 |
172 | 173 |
174 |

175 | You will need to run iOS 8 or greater to take advantage of WebGL.
176 |

177 | 178 |

179 | The release date of iOS 8 is rumored to be some time during this autumn. 180 |

181 |
182 |
183 |
184 | 185 | 186 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /js/CanvasWrapper.js: -------------------------------------------------------------------------------- 1 | window.CanvasWrapper = (function() { 2 | 'use strict'; 3 | var _canvas, _config, _canvasInnerWrapper, _canvasOuterWrapper; 4 | 5 | var CanvasWrapper = { 6 | setup: function(canvas, config) { 7 | _canvas = canvas; 8 | _canvas.id = 'goo'; 9 | _config = config || {}; 10 | }, 11 | 12 | add: function() { 13 | _canvas.tabIndex = 0; 14 | _canvasOuterWrapper = document.getElementById('canvas-outer'); 15 | _canvasInnerWrapper = document.getElementById('canvas-inner'); 16 | _canvasInnerWrapper.appendChild(_canvas); 17 | 18 | // Put the goo logo inside the inner canvas wrapper. 19 | var gooLogo = document.getElementById('goologo'); 20 | if(gooLogo){ 21 | _canvasInnerWrapper.appendChild(gooLogo); 22 | } 23 | 24 | // Make sure the canvas is updated when the window is resized. 25 | window.addEventListener('resize', CanvasWrapper.resize); 26 | window.addEventListener('orientationchange', CanvasWrapper.resize); 27 | 28 | _canvas.addEventListener('mousedown', CanvasWrapper.uninterruptedPan, true); 29 | _canvas.addEventListener('mouseup', CanvasWrapper.allowSelection, true); 30 | 31 | function prevent(e) { 32 | e.preventDefault(); 33 | e.stopPropagation(); 34 | } 35 | 36 | _canvas.addEventListener('mousewheel', prevent, true); 37 | _canvas.addEventListener('DOMMouseScroll', prevent, true); 38 | 39 | CanvasWrapper.resize(); 40 | }, 41 | 42 | hide: function() { 43 | _canvas.style.visibility = 'hidden'; 44 | }, 45 | 46 | show: function() { 47 | _canvas.style.visibility = 'visible'; 48 | }, 49 | 50 | /** 51 | * Resizes the camera according to the configuration included in the 52 | * bundle. 53 | */ 54 | resize: function() { 55 | if (_config.mode === 'Resolution' && _config.resolution) { 56 | setSize(_config.resolution.width, _config.resolution.height); 57 | } else if (_config.mode == 'AspectRatio' && _config.aspect) { 58 | var aspectWidth = _config.aspect.width; 59 | var aspectHeight = _config.aspect.height; 60 | 61 | var ratio = aspectWidth / aspectHeight; 62 | var windowAspectRatio = window.innerWidth / window.innerHeight; 63 | 64 | var width, height; 65 | 66 | // Top/Bottom letterbox 67 | if (ratio > windowAspectRatio) { 68 | width = window.innerWidth; 69 | height = width / ratio; 70 | // Left/Right letterbox 71 | } else { 72 | height = window.innerHeight; 73 | width = height * ratio; 74 | } 75 | 76 | setSize(width, height); 77 | } else { 78 | setSize(); 79 | } 80 | }, 81 | 82 | uninterruptedPan: function() { 83 | var htmlEntities = document.querySelectorAll('.goo-entity'); 84 | for (var i = 0; i < htmlEntities.length; i++) { 85 | htmlEntities[i].classList.add('no-pointer'); 86 | } 87 | }, 88 | 89 | allowSelection: function() { 90 | var htmlEntities = document.querySelectorAll('.goo-entity'); 91 | for (var i = 0; i < htmlEntities.length; i++) { 92 | htmlEntities[i].classList.remove('no-pointer'); 93 | } 94 | } 95 | }; 96 | 97 | 98 | /** 99 | * Sets a custom size on the canvas. 100 | * 101 | * @param {number} width 102 | * The new width of the canvas. 103 | * @param {number} height 104 | * The new height of the canvas. 105 | */ 106 | function setSize(width, height) { 107 | var classList = _canvasOuterWrapper.classList; 108 | 109 | if (width && height) { 110 | classList.add('custom'); 111 | _canvasInnerWrapper.style.width = width + 'px'; 112 | _canvasInnerWrapper.style.height = height + 'px'; 113 | 114 | if (window.innerWidth > width) { 115 | classList.add('center-h'); 116 | } else { 117 | classList.remove('center-h'); 118 | } 119 | 120 | if (window.innerHeight > height) { 121 | classList.add('center-v'); 122 | } else { 123 | classList.remove('center-v'); 124 | } 125 | } else { 126 | classList.remove('custom'); 127 | 128 | _canvasInnerWrapper.style.width = ''; 129 | _canvasInnerWrapper.style.height = ''; 130 | } 131 | }; 132 | 133 | 134 | return CanvasWrapper; 135 | })(); 136 | -------------------------------------------------------------------------------- /js/GSRVMock.js: -------------------------------------------------------------------------------- 1 | window.gsrv = { 2 | track: function(){}, 3 | exit: function(){} 4 | } 5 | -------------------------------------------------------------------------------- /js/WebGLSupport.js: -------------------------------------------------------------------------------- 1 | window.WebGLSupport = (function() { 2 | 3 | 'use strict'; 4 | 5 | var WebGLSupport = { 6 | ERRORS: { 7 | NO_ERROR: 'no error', 8 | NO_RENDERING_CONTEXT: 'noRenderingContext', 9 | WEBGL_DISABLED: 'webglDisabled' 10 | }, 11 | 12 | BROWSERS: { 13 | CHROME: 'chrome', 14 | FIREFOX: 'firefox', 15 | OPERA: 'opera', 16 | IOS: 'ios', 17 | IE: 'ie', 18 | LUDEI: 'ludei', 19 | SAFARI: 'safari' 20 | }, 21 | 22 | /* 23 | * Checks for a present webgl rendering context and if webgl is 24 | * disabled. 25 | * 26 | * The client's browser is checked and returned as well. 27 | */ 28 | check: function() { 29 | 30 | var result = { 31 | error: null, 32 | browser: null 33 | }; 34 | 35 | result.browser = this.getBrowser(); 36 | 37 | if (!window.WebGLRenderingContext) { 38 | result.error = this.ERRORS.NO_RENDERING_CONTEXT; 39 | } else if (isWebGLDisabled() === true) { 40 | result.error = this.ERRORS.WEBGL_DISABLED; 41 | } else { 42 | result.error = this.ERRORS.NO_ERROR; 43 | } 44 | 45 | return result; 46 | }, 47 | 48 | getBrowser: function() { 49 | 50 | var iOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); 51 | var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; 52 | var isChrome = !!window.chrome; 53 | var isFirefox = typeof InstallTrigger !== 'undefined'; 54 | var isSafari = navigator.userAgent.indexOf('Safari') >= 0; 55 | var isIE = document.documentMode || false; 56 | var isCocoonJS = navigator.appName === "Ludei CocoonJS"; 57 | 58 | if (!(isFirefox || isChrome)) { 59 | console.warn('Chrome or Firefox will generally work better with Goo.'); 60 | } 61 | 62 | var browser = null; 63 | 64 | if (iOS === true) { 65 | browser = this.BROWSERS.IOS; 66 | } else if (isOpera === true) { 67 | browser = this.BROWSERS.OPERA; 68 | } else if (isChrome === true) { 69 | browser = this.BROWSERS.CHROME; 70 | } else if (isFirefox === true) { 71 | browser = this.BROWSERS.FIREFOX; 72 | } else if (isSafari === true) { 73 | browser = this.BROWSERS.SAFARI; 74 | } else if (isIE === true) { 75 | browser = this.BROWSERS.IE; 76 | } else if (isCocoonJS === true) { 77 | browser = this.BROWSERS.LUDEI; 78 | } else { 79 | console.warn('Browser was not determined!'); 80 | } 81 | 82 | return browser; 83 | } 84 | 85 | }; 86 | 87 | function isWebGLDisabled() { 88 | var gl = null; 89 | var canvas = document.createElement('canvas'); 90 | 91 | try { 92 | gl = canvas.getContext('webgl'); 93 | } 94 | catch (_error) { 95 | console.error(_error); 96 | gl = null; 97 | } 98 | 99 | if (gl === null) { 100 | try { 101 | gl = canvas.getContext('experimental-webgl'); 102 | } 103 | catch (_error) { 104 | console.error(_error); 105 | gl = null; 106 | } 107 | } 108 | 109 | if (gl === null && window.WebGLRenderingContext) { 110 | return true; 111 | } else { 112 | return false; 113 | } 114 | }; 115 | 116 | return WebGLSupport; 117 | })(); -------------------------------------------------------------------------------- /js/loadScene.js: -------------------------------------------------------------------------------- 1 | (function ( 2 | CanvasWrapper, 3 | WebGLSupport 4 | ) { 5 | 'use strict'; 6 | 7 | function setup(gooRunner, scene, loader) { 8 | // Application code goes here! 9 | 10 | /* 11 | To get a hold of entities, one can use the World's selection functions: 12 | var allEntities = gooRunner.world.getEntities(); // all 13 | var entity = gooRunner.world.by.name('EntityName').first(); // by name 14 | */ 15 | } 16 | 17 | /** 18 | * Converts camelCase (js) to dash-case (html) 19 | */ 20 | function camel2dash(str) { 21 | return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 22 | } 23 | 24 | /** 25 | * Shows the fallback help content on index.html 26 | */ 27 | function showFallback(errorObject) { 28 | // Show the fallback 29 | var fallbackEl = document.getElementById('fallback'); 30 | fallbackEl.classList.add('show'); 31 | fallbackEl.style.backgroundImage = fallbackEl.getAttribute('data-background'); 32 | var browsers = WebGLSupport.BROWSERS; 33 | 34 | 35 | var id; 36 | if (errorObject.browser === browsers.IOS) { 37 | id = 'ios-error'; 38 | } else { 39 | 40 | id = camel2dash(errorObject.error); 41 | 42 | if (errorObject.error == WebGLSupport.ERRORS.WEBGL_DISABLED) { 43 | if (errorObject.browser == browsers.CHROME) { 44 | id += '-chrome'; 45 | } else if (errorObject.browser == browsers.SAFARI) { 46 | id += '-safari'; 47 | } 48 | } 49 | } 50 | 51 | var errorElement = document.getElementById(id); 52 | errorElement.classList.add('show'); 53 | hideLoadingOverlay(); 54 | } 55 | 56 | 57 | function getLoadingOverlay() { 58 | return document.getElementById('goo-loading-overlay'); 59 | } 60 | 61 | 62 | function showLoadingOverlay() { 63 | getLoadingOverlay().classList.add('loading'); 64 | } 65 | 66 | 67 | function hideLoadingOverlay() { 68 | getLoadingOverlay().classList.remove('loading'); 69 | } 70 | 71 | 72 | function showCanvas() { 73 | document.getElementById('canvas-outer').classList.remove('hidden'); 74 | } 75 | 76 | 77 | function init() { 78 | // Check that WebGL is supported. 79 | var result = WebGLSupport.check(); 80 | if (result.error !== WebGLSupport.ERRORS.NO_ERROR) { 81 | showFallback(result); 82 | return; 83 | } 84 | 85 | // Prevent browser peculiarities to mess with our controls. 86 | document.body.addEventListener('touchstart', function (event) { 87 | 88 | if(event.target.nodeName === 'A' ) { return } 89 | var node = event.target.parentElement; 90 | for (var i = 0; i < 5; i++) { 91 | if (!node) { 92 | break; 93 | } 94 | if (node.nodeName === 'A') { 95 | return; 96 | } 97 | node = node.parentElement; 98 | } 99 | event.preventDefault(); 100 | return; 101 | }, false); 102 | 103 | // Init the GooEngine 104 | var gooRunner = initGoo(); 105 | var world = gooRunner.world; 106 | 107 | var transformSystem = world.getSystem('TransformSystem'); 108 | var lightingSystem = world.getSystem('LightingSystem'); 109 | var cameraSystem = world.getSystem('CameraSystem'); 110 | var boundingSystem = world.getSystem('BoundingUpdateSystem'); 111 | var animationSystem = world.getSystem('AnimationSystem'); 112 | var renderSystem = world.getSystem('RenderSystem'); 113 | var renderer = gooRunner.renderer; 114 | 115 | // Crazy hack to make orientation change work on the webview in iOS. 116 | goo.SystemBus.addListener('goo.viewportResize', function () { 117 | var dpx = gooRunner.renderer.devicePixelRatio; 118 | renderer.domElement.style.width = '1px'; 119 | renderer.domElement.style.height = '1px'; 120 | renderer.domElement.offsetHeight; 121 | renderer.domElement.style.width = ''; 122 | renderer.domElement.style.height = ''; 123 | }); 124 | 125 | // Load the scene 126 | loadScene(gooRunner).then(function (loaderAndScene) { 127 | 128 | 129 | world.processEntityChanges(); 130 | transformSystem._process(); 131 | lightingSystem._process(); 132 | cameraSystem._process(); 133 | boundingSystem._process(); 134 | if (goo.Renderer.mainCamera) { gooRunner.renderer.checkResize(goo.Renderer.mainCamera); } 135 | return setup(gooRunner, loaderAndScene.scene, loaderAndScene.loader); 136 | }).then(function () { 137 | new goo.EntityCombiner(world).combine(); 138 | world.processEntityChanges(); 139 | transformSystem._process(); 140 | lightingSystem._process(); 141 | cameraSystem._process(); 142 | boundingSystem._process(); 143 | animationSystem._process(); 144 | renderSystem._process(); 145 | 146 | return renderer.precompileShaders(renderSystem._activeEntities, renderSystem.lights); 147 | }).then(function () { 148 | return renderer.preloadMaterials(renderSystem._activeEntities); 149 | }).then(function () { 150 | showCanvas(); 151 | hideLoadingOverlay(); 152 | CanvasWrapper.show(); 153 | 154 | var shareButtons = document.getElementsByClassName('share-buttons')[0]; 155 | if (shareButtons) { 156 | shareButtons.style.display = 'block'; 157 | } 158 | var logo = document.getElementById('goologo'); 159 | if (logo) { 160 | logo.style.display = 'block'; 161 | } 162 | 163 | CanvasWrapper.resize(); 164 | // Start the rendering loop! 165 | gooRunner.startGameLoop(); 166 | gooRunner.renderer.domElement.focus(); 167 | }).then(null, function (e) { 168 | // If something goes wrong, 'e' is the error message from the engine. 169 | alert('Failed to load scene: ' + e); 170 | }); 171 | } 172 | 173 | 174 | function initGoo() { 175 | // Create typical Goo application. 176 | var gooRunner = new goo.GooRunner({ 177 | antialias: true, 178 | manuallyStartGameLoop: true, 179 | useDevicePixelRatio: true, 180 | logo: false 181 | }); 182 | 183 | gooRunner.world.add(new goo.AnimationSystem()); 184 | gooRunner.world.add(new goo.StateMachineSystem(gooRunner)); 185 | gooRunner.world.add(new goo.HtmlSystem(gooRunner.renderer)); 186 | gooRunner.world.add(new goo.TimelineSystem()); 187 | gooRunner.world.add(new goo.PhysicsSystem()); 188 | gooRunner.world.add(new goo.ColliderSystem()); 189 | 190 | return gooRunner; 191 | } 192 | 193 | 194 | function loadScene(gooRunner) { 195 | /** 196 | * Callback for the loading screen. 197 | * 198 | * @param {number} handled 199 | * @param {number} total 200 | */ 201 | var progressCallback = function (handled, total) { 202 | var loadedPercent = (100 * handled / total).toFixed(); 203 | var progress = document.getElementById("progress"); 204 | progress.style.width = loadedPercent + "%"; 205 | }; 206 | 207 | // The loader takes care of loading the data. 208 | var loader = new goo.DynamicLoader({ 209 | world: gooRunner.world, 210 | rootPath: 'res' 211 | }); 212 | 213 | return loader.load('root.bundle').then(function(result) { 214 | var scene = null; 215 | 216 | // Try to get the first scene in the bundle. 217 | for (var key in result) { 218 | if (/\.scene$/.test(key)) { 219 | scene = result[key]; 220 | break; 221 | } 222 | } 223 | 224 | 225 | 226 | if (!scene || !scene.id) { 227 | alert('Error: No scene in bundle'); // Should never happen. 228 | return null; 229 | } 230 | 231 | // Setup the canvas configuration (sizing mode, resolution, aspect 232 | // ratio, etc). 233 | var canvasConfig = scene ? scene.canvas : {}; 234 | CanvasWrapper.setup(gooRunner.renderer.domElement, canvasConfig); 235 | CanvasWrapper.add(); 236 | CanvasWrapper.hide(); 237 | 238 | return loader.load(scene.id, { 239 | preloadBinaries: true, 240 | progressCallback: progressCallback 241 | }) 242 | .then(function (scene) { 243 | return { scene: scene, loader: loader }; 244 | }); 245 | }); 246 | } 247 | init(); 248 | })(CanvasWrapper, WebGLSupport); -------------------------------------------------------------------------------- /js/shims.js: -------------------------------------------------------------------------------- 1 | // Modified version of https://gist.github.com/devongovett/1381839 (removed unused stuff) 2 | if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') { 3 | Object.defineProperty(HTMLElement.prototype, 'classList', { 4 | get: function() { 5 | var self = this; 6 | function update(fn) { 7 | return function(value) { 8 | var classes = self.className.split(/\s+/), 9 | index = classes.indexOf(value); 10 | 11 | fn(classes, index, value); 12 | self.className = classes.join(" "); 13 | } 14 | } 15 | 16 | var ret = { 17 | add: update(function(classes, index, value) { 18 | ~index || classes.push(value); 19 | }), 20 | 21 | remove: update(function(classes, index) { 22 | ~index && classes.splice(index, 1); 23 | }) 24 | }; 25 | 26 | return ret; 27 | } 28 | }); 29 | } -------------------------------------------------------------------------------- /lib/CanvasWrapper.js: -------------------------------------------------------------------------------- 1 | window.CanvasWrapper = (function() { 2 | 'use strict'; 3 | var _canvas, _config, _canvasInnerWrapper, _canvasOuterWrapper; 4 | 5 | var CanvasWrapper = { 6 | setup: function(canvas, config) { 7 | _canvas = canvas; 8 | _canvas.id = 'goo'; 9 | _config = config || {}; 10 | }, 11 | 12 | add: function() { 13 | _canvas.tabIndex = 0; 14 | _canvasOuterWrapper = document.getElementById('canvas-outer'); 15 | _canvasInnerWrapper = document.getElementById('canvas-inner'); 16 | _canvasInnerWrapper.appendChild(_canvas); 17 | 18 | // Put the goo logo inside the inner canvas wrapper. 19 | var gooLogo = document.getElementById('goologo'); 20 | if(gooLogo){ 21 | _canvasInnerWrapper.appendChild(gooLogo); 22 | } 23 | 24 | // Make sure the canvas is updated when the window is resized. 25 | window.addEventListener('resize', CanvasWrapper.resize); 26 | window.addEventListener('orientationchange', CanvasWrapper.resize); 27 | 28 | _canvas.addEventListener('mousedown', CanvasWrapper.uninterruptedPan, true); 29 | _canvas.addEventListener('mouseup', CanvasWrapper.allowSelection, true); 30 | 31 | function prevent(e) { 32 | e.preventDefault(); 33 | e.stopPropagation(); 34 | } 35 | 36 | _canvas.addEventListener('mousewheel', prevent, true); 37 | _canvas.addEventListener('DOMMouseScroll', prevent, true); 38 | 39 | CanvasWrapper.resize(); 40 | }, 41 | 42 | hide: function() { 43 | _canvas.style.visibility = 'hidden'; 44 | }, 45 | 46 | show: function() { 47 | _canvas.style.visibility = 'visible'; 48 | }, 49 | 50 | /** 51 | * Resizes the camera according to the configuration included in the 52 | * bundle. 53 | */ 54 | resize: function() { 55 | if (_config.mode === 'Resolution' && _config.resolution) { 56 | setSize(_config.resolution.width, _config.resolution.height); 57 | } else if (_config.mode == 'AspectRatio' && _config.aspect) { 58 | var aspectWidth = _config.aspect.width; 59 | var aspectHeight = _config.aspect.height; 60 | 61 | var ratio = aspectWidth / aspectHeight; 62 | var windowAspectRatio = window.innerWidth / window.innerHeight; 63 | 64 | var width, height; 65 | 66 | // Top/Bottom letterbox 67 | if (ratio > windowAspectRatio) { 68 | width = window.innerWidth; 69 | height = width / ratio; 70 | // Left/Right letterbox 71 | } else { 72 | height = window.innerHeight; 73 | width = height * ratio; 74 | } 75 | 76 | setSize(width, height); 77 | } else { 78 | setSize(); 79 | } 80 | }, 81 | 82 | uninterruptedPan: function() { 83 | var htmlEntities = document.querySelectorAll('.goo-entity'); 84 | for (var i = 0; i < htmlEntities.length; i++) { 85 | htmlEntities[i].classList.add('no-pointer'); 86 | } 87 | }, 88 | 89 | allowSelection: function() { 90 | var htmlEntities = document.querySelectorAll('.goo-entity'); 91 | for (var i = 0; i < htmlEntities.length; i++) { 92 | htmlEntities[i].classList.remove('no-pointer'); 93 | } 94 | } 95 | }; 96 | 97 | 98 | /** 99 | * Sets a custom size on the canvas. 100 | * 101 | * @param {number} width 102 | * The new width of the canvas. 103 | * @param {number} height 104 | * The new height of the canvas. 105 | */ 106 | function setSize(width, height) { 107 | var classList = _canvasOuterWrapper.classList; 108 | 109 | if (width && height) { 110 | classList.add('custom'); 111 | _canvasInnerWrapper.style.width = width + 'px'; 112 | _canvasInnerWrapper.style.height = height + 'px'; 113 | 114 | if (window.innerWidth > width) { 115 | classList.add('center-h'); 116 | } else { 117 | classList.remove('center-h'); 118 | } 119 | 120 | if (window.innerHeight > height) { 121 | classList.add('center-v'); 122 | } else { 123 | classList.remove('center-v'); 124 | } 125 | } else { 126 | classList.remove('custom'); 127 | 128 | _canvasInnerWrapper.style.width = ''; 129 | _canvasInnerWrapper.style.height = ''; 130 | } 131 | }; 132 | 133 | 134 | return CanvasWrapper; 135 | })(); 136 | -------------------------------------------------------------------------------- /lib/GSRVMock.js: -------------------------------------------------------------------------------- 1 | window.gsrv = { 2 | track: function(){}, 3 | exit: function(){} 4 | } 5 | -------------------------------------------------------------------------------- /lib/WebGLSupport.js: -------------------------------------------------------------------------------- 1 | window.WebGLSupport = (function() { 2 | 3 | 'use strict'; 4 | 5 | var WebGLSupport = { 6 | ERRORS: { 7 | NO_ERROR: 'no error', 8 | NO_RENDERING_CONTEXT: 'noRenderingContext', 9 | WEBGL_DISABLED: 'webglDisabled' 10 | }, 11 | 12 | BROWSERS: { 13 | CHROME: 'chrome', 14 | FIREFOX: 'firefox', 15 | OPERA: 'opera', 16 | IOS: 'ios', 17 | IE: 'ie', 18 | LUDEI: 'ludei', 19 | SAFARI: 'safari' 20 | }, 21 | 22 | /* 23 | * Checks for a present webgl rendering context and if webgl is 24 | * disabled. 25 | * 26 | * The client's browser is checked and returned as well. 27 | */ 28 | check: function() { 29 | 30 | var result = { 31 | error: null, 32 | browser: null 33 | }; 34 | 35 | result.browser = this.getBrowser(); 36 | 37 | if (!window.WebGLRenderingContext) { 38 | result.error = this.ERRORS.NO_RENDERING_CONTEXT; 39 | } else if (isWebGLDisabled() === true) { 40 | result.error = this.ERRORS.WEBGL_DISABLED; 41 | } else { 42 | result.error = this.ERRORS.NO_ERROR; 43 | } 44 | 45 | return result; 46 | }, 47 | 48 | getBrowser: function() { 49 | 50 | var iOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); 51 | var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; 52 | var isChrome = !!window.chrome; 53 | var isFirefox = typeof InstallTrigger !== 'undefined'; 54 | var isSafari = navigator.userAgent.indexOf('Safari') >= 0; 55 | var isIE = document.documentMode || false; 56 | var isCocoonJS = navigator.appName === "Ludei CocoonJS"; 57 | 58 | if (!(isFirefox || isChrome)) { 59 | console.warn('Chrome or Firefox will generally work better with Goo.'); 60 | } 61 | 62 | var browser = null; 63 | 64 | if (iOS === true) { 65 | browser = this.BROWSERS.IOS; 66 | } else if (isOpera === true) { 67 | browser = this.BROWSERS.OPERA; 68 | } else if (isChrome === true) { 69 | browser = this.BROWSERS.CHROME; 70 | } else if (isFirefox === true) { 71 | browser = this.BROWSERS.FIREFOX; 72 | } else if (isSafari === true) { 73 | browser = this.BROWSERS.SAFARI; 74 | } else if (isIE === true) { 75 | browser = this.BROWSERS.IE; 76 | } else if (isCocoonJS === true) { 77 | browser = this.BROWSERS.LUDEI; 78 | } else { 79 | console.warn('Browser was not determined!'); 80 | } 81 | 82 | return browser; 83 | } 84 | 85 | }; 86 | 87 | function isWebGLDisabled() { 88 | var gl = null; 89 | var canvas = document.createElement('canvas'); 90 | 91 | try { 92 | gl = canvas.getContext('webgl'); 93 | } 94 | catch (_error) { 95 | console.error(_error); 96 | gl = null; 97 | } 98 | 99 | if (gl === null) { 100 | try { 101 | gl = canvas.getContext('experimental-webgl'); 102 | } 103 | catch (_error) { 104 | console.error(_error); 105 | gl = null; 106 | } 107 | } 108 | 109 | if (gl === null && window.WebGLRenderingContext) { 110 | return true; 111 | } else { 112 | return false; 113 | } 114 | }; 115 | 116 | return WebGLSupport; 117 | })(); -------------------------------------------------------------------------------- /lib/analytics.js: -------------------------------------------------------------------------------- 1 | (function(){var n=Math,f=window,aa=encodeURIComponent;function Pc(a,b){return a.href=b} 2 | var m="match",Ab="href",Ga="sendBeacon",A="split",H="join",ha="slice",jd="target",v="name",C="call",na="clientHeight",z="prototype",ja="port",t="indexOf",kd="action",Qc="replace",ia="defaultValue",ma="hostname",F="substring",q="data",p="push",B="location",ga="search",E="protocol",ra="hasOwnProperty",G="apply",oa="navigator",la="clientWidth",r="cookie",y="length",pa="test",I="toLowerCase",h="hash",id="setAttribute",da="getTime",u="createElement";var $c=function(a){this.w=a||[]};$c[z].set=function(a){this.w[a]=!0};$c[z].encode=function(){for(var a=[],b=0;b=b[y])wc(a,b,c);else if(8192>=b[y])x(a,b,c)||wd(a,b,c)||wc(a,b,c);else throw ge("len",b[y]),new Da(b[y]);},wc=function(a,b,c){var d=ta(a+"?"+b);d.onload=d.onerror=function(){d.onload=null;d.onerror=null;c()}},wd=function(a,b,c){var d=O.XMLHttpRequest;if(!d)return!1;var e=new d;if(!("withCredentials"in e))return!1;e.open("POST", 6 | a,!0);e.withCredentials=!0;e.setRequestHeader("Content-Type","text/plain");e.onreadystatechange=function(){4==e.readyState&&(c(),e=null)};e.send(b);return!0},x=function(a,b,c){return O[oa][Ga]?O[oa][Ga](a,b)?(c(),!0):!1:!1},ge=function(a,b,c){1<=100*n.random()||Aa("?")||(a=["t=error","_e="+a,"_v=j38","sr=1"],b&&a[p]("_f="+b),c&&a[p]("_m="+K(c[F](0,100))),a[p]("aip=1"),a[p]("z="+fe()),wc(oc()+"/collect",a[H]("&"),ua))};var Ha=function(){this.M=[]};Ha[z].add=function(a){this.M[p](a)};Ha[z].D=function(a){try{for(var b=0;b=100*R(a,Ka))throw"abort";}function Ma(a){if(Aa(P(a,Na)))throw"abort";}function Oa(){var a=M[B][E];if("http:"!=a&&"https:"!=a)throw"abort";} 7 | function Pa(a){try{O[oa][Ga]?J(42):O.XMLHttpRequest&&"withCredentials"in new O.XMLHttpRequest&&J(40)}catch(b){}a.set(ld,Td(a),!0);a.set(Ac,R(a,Ac)+1);var c=[];Qa.map(function(b,e){if(e.F){var g=a.get(b);void 0!=g&&g!=e[ia]&&("boolean"==typeof g&&(g*=1),c[p](e.F+"="+K(""+g)))}});c[p]("z="+Bd());a.set(Ra,c[H]("&"),!0)} 8 | function Sa(a){var b=P(a,gd)||oc()+"/collect",c=P(a,fa);!c&&a.get(Vd)&&(c="beacon");if(c){var d=P(a,Ra),e=a.get(Ia),e=e||ua;"image"==c?wc(b,d,e):"xhr"==c&&wd(b,d,e)||"beacon"==c&&x(b,d,e)||ba(b,d,e)}else ba(b,P(a,Ra),a.get(Ia));a.set(Ia,ua,!0)}function Hc(a){var b=O.gaData;b&&(b.expId&&a.set(Nc,b.expId),b.expVar&&a.set(Oc,b.expVar))}function cd(){if(O[oa]&&"preview"==O[oa].loadPurpose)throw"abort";}function yd(a){var b=O.gaDevIds;ka(b)&&0!=b[y]&&a.set("&did",b[H](","),!0)} 9 | function vb(a){if(!a.get(Na))throw"abort";};var hd=function(){return n.round(2147483647*n.random())},Bd=function(){try{var a=new Uint32Array(1);O.crypto.getRandomValues(a);return a[0]&2147483647}catch(b){return hd()}},fe=hd;function Ta(a){var b=R(a,Ua);500<=b&&J(15);var c=P(a,Va);if("transaction"!=c&&"item"!=c){var c=R(a,Wa),d=(new Date)[da](),e=R(a,Xa);0==e&&a.set(Xa,d);e=n.round(2*(d-e)/1E3);0=c)throw"abort";a.set(Wa,--c)}a.set(Ua,++b)};var Ya=function(){this.data=new ee},Qa=new ee,Za=[];Ya[z].get=function(a){var b=$a(a),c=this[q].get(a);b&&void 0==c&&(c=ea(b[ia])?b[ia]():b[ia]);return b&&b.Z?b.Z(this,a,c):c};var P=function(a,b){var c=a.get(b);return void 0==c?"":""+c},R=function(a,b){var c=a.get(b);return void 0==c||""===c?0:1*c};Ya[z].set=function(a,b,c){if(a)if("object"==typeof a)for(var d in a)a[ra](d)&&ab(this,d,a[d],c);else ab(this,a,b,c)}; 10 | var ab=function(a,b,c,d){if(void 0!=c)switch(b){case Na:wb[pa](c)}var e=$a(b);e&&e.o?e.o(a,b,c,d):a[q].set(b,c,d)},bb=function(a,b,c,d,e){this.name=a;this.F=b;this.Z=d;this.o=e;this.defaultValue=c},$a=function(a){var b=Qa.get(a);if(!b)for(var c=0;c=b)){var c=(new Date).getHours(),d=[Bd(),Bd(),Bd()][H](".");a=(3==b||5==b?"https:":"http:")+"//www.google-analytics.com/collect?z=br.";a+=[b,"A",c,d][H](".");var e=1!=b%3?"https:":"http:",e=e+"//www.google-analytics.com/collect?z=br.",e=e+[b,"B",c,d][H](".");7==b&&(e=e[Qc]("//www.","//ssl."));c=function(){4<=b&&6>=b?O[oa][Ga](e,""):ta(e)};Bd()%2?(ta(a),c()):(c(),ta(a))}}};function fc(){var a,b,c;if((c=(c=O[oa])?c.plugins:null)&&c[y])for(var d=0;d=c)&&(c={},Ec(c)||Fc(c))){var d=c[Eb];void 0==d||Infinity==d||isNaN(d)||(0c)a[b]=void 0},Fd=function(a){return function(b){"pageview"!=b.get(Va)||a.I||(a.I=!0,gc(b,function(b){a.send("timing",b)}))}};var hc=!1,mc=function(a){if("cookie"==P(a,ac)){var b=P(a,U),c=nd(a),d=kc(P(a,Yb)),e=lc(P(a,W)),g=1E3*R(a,Zb),ca=P(a,Na);if("auto"!=e)zc(b,c,d,e,ca,g)&&(hc=!0);else{J(32);var l;a:{c=[];e=xa()[A](".");if(4==e[y]&&(l=e[e[y]-1],parseInt(l,10)==l)){l=["none"];break a}for(l=e[y]-2;0<=l;l--)c[p](e[ha](l)[H]("."));c[p]("none");l=c}for(var k=0;k=a&&d[p]({hash:ca[0],R:e[g],O:ca})}return 0==d[y]?void 0:1==d[y]?d[0]:Zc(b,d)||Zc(c,d)||Zc(null,d)||d[0]}function Zc(a,b){var c,d;null==a?c=d=1:(c=La(a),d=La(D(a,".")?a[F](1):"."+a));for(var e=0;ed[y])){c=[];for(var e=0;e=ca[0]||0>=ca[1]?"":ca[H]("x");a.set(rb,c);a.set(tb,fc());a.set(ob,M.characterSet||M.charset);a.set(sb,b&&"function"===typeof b.javaEnabled&&b.javaEnabled()||!1);a.set(nb,(b&&(b.language||b.browserLanguage)||"")[I]());if(d&&a.get(cc)&&(b=M[B][h])){b=b[A](/[?&#]+/);d=[];for(c=0;carguments[y])){var b,c;"string"===typeof arguments[0]?(b=arguments[0],c=[][ha][C](arguments,1)):(b=arguments[0]&&arguments[0][Va],c=arguments);b&&(c=za(qc[b]||[],c),c[Va]=b,this.b.set(c,void 0,!0),this.filters.D(this.b),this.b[q].m={},je(this.b))}};var rc=function(a){if("prerender"==M.visibilityState)return!1;a();return!0};var td=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/,sc=function(a){if(ea(a[0]))this.u=a[0];else{var b=td.exec(a[0]);null!=b&&4==b[y]&&(this.c=b[1]||"t0",this.K=b[2]||"",this.C=b[3],this.a=[][ha][C](a,1),this.K||(this.A="create"==this.C,this.i="require"==this.C,this.g="provide"==this.C,this.ba="remove"==this.C),this.i&&(3<=this.a[y]?(this.X=this.a[1],this.W=this.a[2]):this.a[1]&&(qa(this.a[1])?this.X=this.a[1]:this.W=this.a[1])));b=a[1];a=a[2];if(!this.C)throw"abort";if(this.i&&(!qa(b)||""==b))throw"abort";if(this.g&& 34 | (!qa(b)||""==b||!ea(a)))throw"abort";if(ud(this.c)||ud(this.K))throw"abort";if(this.g&&"t0"!=this.c)throw"abort";}};function ud(a){return 0<=a[t](".")||0<=a[t](":")};var Yd,Zd,$d;Yd=new ee;$d=new ee;Zd={ec:45,ecommerce:46,linkid:47}; 35 | var ae=function(a){function b(a){var b=(a[ma]||"")[A](":")[0][I](),c=(a[E]||"")[I](),c=1*a[ja]||("http:"==c?80:"https:"==c?443:"");a=a.pathname||"";D(a,"/")||(a="/"+a);return[b,""+c,a]}var c=M[u]("a");Pc(c,M[B][Ab]);var d=(c[E]||"")[I](),e=b(c),g=c[ga]||"",ca=d+"//"+e[0]+(e[1]?":"+e[1]:"");D(a,"//")?a=d+a:D(a,"/")?a=ca+a:!a||D(a,"?")?a=ca+e[2]+(a||g):0>a[A]("/")[0][t](":")&&(a=ca+e[2][F](0,e[2].lastIndexOf("/"))+"/"+a);Pc(c,a);d=b(c);return{protocol:(c[E]||"")[I](),host:d[0],port:d[1],path:d[2],G:c[ga]|| 36 | "",url:a||""}};var Z={ga:function(){Z.f=[]}};Z.ga();Z.D=function(a){var b=Z.J[G](Z,arguments),b=Z.f.concat(b);for(Z.f=[];0c;c++){var d=b[c].src;if(d&&0==d[t]("https://www.google-analytics.com/analytics")){J(33);b=!0;break a}}b=!1}b&&(Ba=!0)}Ud()|| 41 | Ba||!Ed(new Od)||(J(36),Ba=!0);(O.gaplugins=O.gaplugins||{}).Linker=Dc;b=Dc[z];Yd.set("linker",Dc);X("decorate",b,b.ca,20);X("autoLink",b,b.S,25);Yd.set("displayfeatures",fd);Yd.set("adfeatures",fd);a=a&&a.q;ka(a)?Z.D[G](N,a):J(50)}};N.da=function(){for(var a=N.getAll(),b=0;b>21:b;return b};})(window); 43 | -------------------------------------------------------------------------------- /lib/animationpack.js: -------------------------------------------------------------------------------- 1 | goo.Joint=function(t){"use strict";function e(n){this._name=n,this._index=0,this._parentIndex=e.NO_PARENT,this._inverseBindPose=new t}return e.NO_PARENT=-32768,e}(goo.Transform),goo.Skeleton=function(t){"use strict";function e(t,e){this._name=t,this._joints=e}return e.prototype.clone=function(){for(var n=this._name,o=this._joints,i=[],a=0,r=o.length;r>a;a++){var s=o[a],c=s._name,l=new t(c);l._index=s._index,l._parentIndex=s._parentIndex,l._inverseBindPose.copy(s._inverseBindPose),l._inverseBindPose.update(),i[a]=l}return new e(n,i)},e}(goo.Joint),goo.SkeletonPose=function(t,e,n){"use strict";function o(e){this._skeleton=e,this._localTransforms=[],this._globalTransforms=[],this._matrixPalette=[],this._poseListeners=[];for(var o=this._skeleton._joints.length,i=0;o>i;i++)this._localTransforms[i]=new t;for(var i=0;o>i;i++)this._globalTransforms[i]=new t;for(var i=0;o>i;i++)this._matrixPalette[i]=new n;this.setToBindPose()}return o.prototype.setToBindPose=function(){for(var t=0;to;o++){var a=t[o]._parentIndex;a!==e.NO_PARENT?n.combine(this._globalTransforms[a].matrix,this._localTransforms[o].matrix,this._globalTransforms[o].matrix):this._globalTransforms[o].matrix.copy(this._localTransforms[o].matrix),n.combine(this._globalTransforms[o].matrix,t[o]._inverseBindPose.matrix,this._matrixPalette[o])}this.firePoseUpdated()},o.prototype.firePoseUpdated=function(){for(var t=this._poseListeners.length-1;t>=0;t--)this._poseListeners[t].poseUpdated(this)},o.prototype.clone=function(){return new o(this._skeleton)},o}(goo.Transform,goo.Joint,goo.Matrix4x4),goo.TransformData=function(t,e){"use strict";function n(n){this._rotation=(new t).copy(n?n._rotation:t.IDENTITY),this._scale=(new e).copy(n?n._scale:e.ONE),this._translation=(new e).copy(n?n._translation:e.ZERO)}return n.prototype.applyTo=function(t){t.rotation.copyQuaternion(this._rotation),t.scale.setVector(this._scale),t.translation.setVector(this._translation),t.update()},n.prototype.set=function(t){this._rotation.copy(t._rotation),this._scale.copy(t._scale),this._translation.copy(t._translation)},n.prototype.blend=function(e,o,i){var a=i?i:new n;return a._translation.setVector(this._translation).lerp(e._translation,o),a._scale.setVector(this._scale).lerp(e._scale,o),t.slerp(this._rotation,e._rotation,o,a._rotation),a},n}(goo.Quaternion,goo.Vector3),goo.BinaryLerpSource=function(t,e){"use strict";function n(t,e,n){this._sourceA=t?t:null,this._sourceB=e?e:null,this.blendWeight=n?n:null}return n.prototype.getSourceData=function(){var t=this._sourceA?this._sourceA.getSourceData():null,e=this._sourceB?this._sourceB.getSourceData():null;return n.combineSourceData(t,e,this.blendWeight)},n.prototype.setTime=function(t){var e=!1,n=!1;return this._sourceA&&(e=this._sourceA.setTime(t)),this._sourceB&&(n=this._sourceB.setTime(t)),e||n},n.prototype.resetClips=function(t){this._sourceA&&this._sourceA.resetClips(t),this._sourceB&&this._sourceB.resetClips(t)},n.prototype.shiftClipTime=function(t){this._sourceA&&this._sourceA.shiftClipTime(t),this._sourceB&&this._sourceB.shiftClipTime(t)},n.prototype.setTimeScale=function(t){this._sourceA.setTimeScale(t),this._sourceB.setTimeScale(t)},n.prototype.isActive=function(){var t=!1;return this._sourceA&&(t=t||this._sourceA.isActive()),this._sourceB&&(t=t||this._sourceB.isActive()),t},n.combineSourceData=function(t,o,i,a){if(!o)return t;if(!t)return o;var r=a?a:{};for(var s in t){var c=t[s],l=o[s];isNaN(c)?c instanceof e?l?r[s]=c.blend(l,i,r[s]):r[s]?r[s].set(c):r[s]=new c.constructor(c):r[s]=c:n.blendFloatValues(r,s,i,c,l)}for(var s in o)r[s]||(r[s]=o[s]);return r},n.blendFloatValues=function(e,n,o,i,a){isNaN(a)?e[n]=i:e[n]=t.lerp(o,i[0],a[0])},n.prototype.clone=function(){return new n(this._sourceA,this._sourceB,this._blendWeight)},n}(goo.MathUtils,goo.TransformData),goo.AnimationClipInstance=function(t){"use strict";function e(){this._active=!0,this._loopCount=0,this._timeScale=1,this._startTime=0,this._prevClockTime=0,this._prevUnscaledClockTime=0,this._clipStateObjects={}}return e.prototype.setTimeScale=function(e,n){if(n="undefined"!=typeof n?n:t.time,this._active&&this._timeScale!==e)if(0!==this._timeScale&&0!==e){var o=n,i=o-this._startTime;i*=this._timeScale,i/=e,this._startTime=o-i}else if(0===this._timeScale){var o=n;this._startTime=o-this._prevUnscaledClockTime}this._timeScale=e},e.prototype.getApplyTo=function(t){var e=t._channelName,n=this._clipStateObjects[e];return n||(n=t.createStateDataObject(),this._clipStateObjects[e]=n),n},e.prototype.clone=function(){var t=new e;return t._active=this._active,t._loopCount=this._loopCount,t._timeScale=this._timeScale,t},e}(goo.World),goo.ClipSource=function(t,e){"use strict";function n(t,n,o){this._clip=t,this._clipInstance=new e,this._filterChannels={},this._filter=null,this.setFilter(n,o),this._startTime=-(1/0),this._endTime=1/0}return n.prototype.setFilter=function(t,e){if(t&&e){this._filter=["Exclude","Include"].indexOf(t)>-1?t:null;for(var n=0;no?(o*=-1,o%=i,o=i-o,o+=r):(o%=i,o+=r):n._loopCount>0&&i*n._loopCount>=Math.abs(o)&&(0>o?(o*=-1,o%=i,o=i-o,o+=r):(o%=i,o+=r)),(o>a||r>o)&&(o=t.clamp(o,r,a),n._active=!1)),this._clip.update(o,n)}return n._active},n.prototype.resetClips=function(t){this._clipInstance._startTime="undefined"!=typeof t?t:0,this._clipInstance._active=!0},n.prototype.shiftClipTime=function(t){this._clipInstance._startTime+=t,this._clipInstance._active=!0},n.prototype.setTimeScale=function(t){this._clipInstance.setTimeScale(t)},n.prototype.isActive=function(){return this._clipInstance._active&&-1!==this._clip._maxTime},n.prototype.getSourceData=function(){if(!this._filter||!this._filterChannels)return this._clipInstance._clipStateObjects;var t=this._clipInstance._clipStateObjects,e={},n="Include"===this._filter;for(var o in t)void 0!==this._filterChannels[o]===n&&(e[o]=t[o]);return e},n.prototype.clone=function(){var t=new n(this._clip);t._clipInstance=this._clipInstance.clone(),t._filter=this._filter;for(var e in this._filterChannels)t._filterChannels[e]=this._filterChannels[e];return t._startTime=this._startTime,t._endTime=this._endTime,t},n}(goo.MathUtils,goo.AnimationClipInstance),goo.FrozenClipSource=function(){"use strict";function t(t,e){this._source=t,this._time=e}return t.prototype.getSourceData=function(){return this._source.getSourceData()},t.prototype.resetClips=function(){this._source.resetClips(0)},t.prototype.setTime=function(){return this._source.setTime(this._time),!0},t.prototype.isActive=function(){return!0},t.prototype.setTimeScale=function(){},t.prototype.clone=function(){var e=new t(this._source.clone(),this._time);return e},t}(),goo.AbstractAnimationChannel=function(t){"use strict";function e(t,n,o){this._blendType=o||e.BLENDTYPES.LINEAR,this._channelName=t,(n instanceof Array||n instanceof Float32Array)&&n.length?this._times=new Float32Array(n):this._times=[],this._lastStartFrame=0}return e.BLENDTYPES={},e.BLENDTYPES.LINEAR="Linear",e.BLENDTYPES.CUBIC="SCurve3",e.BLENDTYPES.QUINTIC="SCurve5",e.prototype.getSampleCount=function(){return this._times.length},e.prototype.getMaxTime=function(){return this._times.length?this._times[this._times.length-1]:0},e.prototype.updateSample=function(n,o){var i=this._times.length;if(i){var a=i-1;if(0>n||1===i)this.setCurrentSample(0,0,o);else if(n>=this._times[a])this.setCurrentSample(a,0,o);else{var r=0;if(n>=this._times[this._lastStartFrame]){r=this._lastStartFrame;for(var s=this._lastStartFrame;i-1>s&&!(this._times[s]>=n);s++)r=s}else for(var s=0;s=n);s++)r=s;var c=(n-this._times[r])/(this._times[r+1]-this._times[r]);switch(this._blendType){case e.BLENDTYPES.CUBIC:c=t.scurve3(c);break;case e.BLENDTYPES.QUINTIC:c=t.scurve5(c)}this.setCurrentSample(r,c,o),this._lastStartFrame=r}}},e}(goo.MathUtils),goo.TransformChannel=function(t,e,n){"use strict";function o(e,n,o,i,a,r){if(t.call(this,e,n,r),o.length/4!==n.length||i.length/3!==n.length||a.length/3!==n.length)throw new Error("All provided arrays must be the same length (accounting for type)! Channel: "+e);this._rotations=new Float32Array(o),this._translations=new Float32Array(i),this._scales=new Float32Array(a)}var i=new n,a=new n;return o.prototype=Object.create(t.prototype),o.prototype.createStateDataObject=function(){return new e},o.prototype.setCurrentSample=function(t,e,o){var r=o,s=4*t,c=3*t,l=4*(t+1),p=3*(t+1);return 0===e?(r._rotation.data[0]=this._rotations[s+0],r._rotation.data[1]=this._rotations[s+1],r._rotation.data[2]=this._rotations[s+2],r._rotation.data[3]=this._rotations[s+3],r._translation.data[0]=this._translations[c+0],r._translation.data[1]=this._translations[c+1],r._translation.data[2]=this._translations[c+2],r._scale.data[0]=this._scales[c+0],r._scale.data[1]=this._scales[c+1],void(r._scale.data[2]=this._scales[c+2])):1===e?(r._rotation.data[0]=this._rotations[l+0],r._rotation.data[1]=this._rotations[l+1],r._rotation.data[2]=this._rotations[l+2],r._rotation.data[3]=this._rotations[l+3],r._translation.data[0]=this._translations[p+0],r._translation.data[1]=this._translations[p+1],r._translation.data[2]=this._translations[p+2],r._scale.data[0]=this._scales[p+0],r._scale.data[1]=this._scales[p+1],void(r._scale.data[2]=this._scales[p+2])):(r._rotation.data[0]=this._rotations[s+0],r._rotation.data[1]=this._rotations[s+1],r._rotation.data[2]=this._rotations[s+2],r._rotation.data[3]=this._rotations[s+3],i.data[0]=this._rotations[l+0],i.data[1]=this._rotations[l+1],i.data[2]=this._rotations[l+2],i.data[3]=this._rotations[l+3],r._rotation.equals(i)||(n.slerp(r._rotation,i,e,a),r._rotation.setVector(a)),r._translation.data[0]=(1-e)*this._translations[c+0]+e*this._translations[p+0],r._translation.data[1]=(1-e)*this._translations[c+1]+e*this._translations[p+1],r._translation.data[2]=(1-e)*this._translations[c+2]+e*this._translations[p+2],r._scale.data[0]=(1-e)*this._scales[c+0]+e*this._scales[p+0],r._scale.data[1]=(1-e)*this._scales[c+1]+e*this._scales[p+1],void(r._scale.data[2]=(1-e)*this._scales[c+2]+e*this._scales[p+2]))},o.prototype.getData=function(t,n){var o=n?n:new e;return this.setCurrentSample(t,0,o),o},o}(goo.AbstractAnimationChannel,goo.TransformData,goo.Quaternion),goo.JointData=function(t){"use strict";function e(e){t.call(this,e),this._jointIndex=e?e._jointIndex:0}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.set=function(e){t.prototype.set.call(this,e),this._jointIndex=e._jointIndex},e.prototype.blend=function(n,o,i){var a=i;return a?a instanceof e&&(a._jointIndex=this._jointIndex):(a=new e,a._jointIndex=this._jointIndex),t.prototype.blend.call(this,n,o,a)},e.prototype.clone=function(){return new e(this)},e}(goo.TransformData),goo.JointChannel=function(t,e){"use strict";function n(e,n,o,i,a,r,s){t.call(this,n,o,i,a,r,s),this._jointName=n,this._jointIndex=e}return n.prototype=Object.create(t.prototype),n.JOINT_CHANNEL_NAME="_jnt",n.prototype.createStateDataObject=function(){return new e},n.prototype.setCurrentSample=function(e,n,o){t.prototype.setCurrentSample.call(this,e,n,o),o._jointIndex=this._jointIndex},n.prototype.getData=function(n,o){var i=o?o:new e;return t.prototype.getData.call(this,n,i),i._jointIndex=this._jointIndex,i},n}(goo.TransformChannel,goo.JointData),goo.ManagedTransformSource=function(t,e,n,o,i,a){"use strict";function r(t){this._sourceName=t?t:null,this._data={}}return r.prototype.setTranslation=function(t,e){var n=this._data[t];n instanceof o&&n._translation.setVector(e)},r.prototype.getTranslation=function(t,e){var n=this._data[t];return n instanceof o&&(e=e||new i,e.setVector(n._translation)),e},r.prototype.setScale=function(t,e){var n=this._data[t];n instanceof o&&n._scale.setVector(e)},r.prototype.getScale=function(t,e){var n=this._data[t];return n instanceof o&&(e=e||new i,e.setVector(n._scale)),e},r.prototype.setRotation=function(t,e){var n=this._data[t];n instanceof o&&n._rotation.set(e)},r.prototype.getRotation=function(t,e){var n=this._data[t];return n instanceof o&&(e=e||new a,e.setVector(n._rotation)),e},r.prototype.initFromClip=function(t,e,n){if("Include"===e&&n&&n.length)for(var o=0,i=n.length;i>o;o++){var a=n[o],r=t.findChannelByName(a);if(r){var s=r.getData(0);this._data[a]=s}else console.error("Channel not in clip: "+a)}else for(var o=0,i=t._channels.length;i>o;o++){var r=t._channels[o],a=r._channelName;if("Exclude"===e&&n&&n.length&&n.indexOf(a)>-1){var s=r.getData(0);this._data[a]=s}}},r.prototype.resetClips=function(){},r.prototype.setTimeScale=function(){},r.prototype.setTime=function(){return!0},r.prototype.isActive=function(){return!0},r.prototype.getChannelData=function(t){return this._data[t]},r.prototype.getSourceData=function(){return this._data},r.prototype.clone=function(){var t={};for(var e in this._data)t[e]=this._data[e].clone();return new r(this._sourceName,t)},r}(goo.JointChannel,goo.JointData,goo.JointChannel,goo.JointData,goo.Vector3,goo.Quaternion),goo.AbstractState=function(){"use strict";function t(){this._globalStartTime=0,this.onFinished=null}return t.prototype.update=function(){},t.prototype.postUpdate=function(){},t.prototype.getCurrentSourceData=function(){},t.prototype.resetClips=function(t){this._globalStartTime=t},t.prototype.shiftClipTime=function(t){this._globalStartTime+=t},t}(),goo.AbstractTransitionState=function(t,e,n){"use strict";function o(){t.call(this),this._sourceState=null,this._targetState=null,this._percent=0,this._sourceData=null,this._fadeTime=0,this._blendType=o.BLENDTYPES.LINEAR}return o.prototype=Object.create(t.prototype),o.prototype.constructor=o,o.BLENDTYPES={},o.BLENDTYPES.LINEAR="Linear",o.BLENDTYPES.CUBIC="SCurve3",o.BLENDTYPES.QUINTIC="SCurve5",o.prototype.update=function(t){var e=t-this._globalStartTime;if(e>this._fadeTime&&this.onFinished)return void this.onFinished();var i=e/this._fadeTime;switch(this._blendType){case o.BLENDTYPES.CUBIC:this._percent=n.scurve3(i);break;case o.BLENDTYPES.QUINTIC:this._percent=n.scurve5(i);break;default:this._percent=i}},o.prototype.readFromConfig=function(t){t&&(void 0!==t.fadeTime&&(this._fadeTime=t.fadeTime),void 0!==t.blendType&&(this._blendType=t.blendType))},o.prototype.getCurrentSourceData=function(){var t=this._sourceState?this._sourceState.getCurrentSourceData():null,n=this._targetState?this._targetState.getCurrentSourceData():null;return this._sourceData||(this._sourceData={}),e.combineSourceData(t,n,this._percent,this._sourceData)},o.prototype.isValid=function(t,e){var n=e-this._sourceState._globalStartTime,o=t[0],i=t[1];return 0>=o?0>=i?!0:i>=n:0>=i?n>=o:i>=o?n>=o&&i>=n:n>=o||i>=n},o.prototype.resetClips=function(e){t.prototype.resetClips.call(this,e),this._percent=0},o.prototype.shiftClipTime=function(e){t.prototype.shiftClipTime.call(this,e)},o.prototype.setTimeScale=function(t){this._sourceState&&this._sourceState.setTimeScale(t),this._targetState&&this._targetState.setTimeScale(t)},o}(goo.AbstractState,goo.BinaryLerpSource,goo.MathUtils),goo.FadeTransitionState=function(t){"use strict";function e(){t.call(this)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.update=function(e){t.prototype.update.call(this,e),this._sourceState&&this._sourceState.update(e),this._targetState&&this._targetState.update(e)},e.prototype.postUpdate=function(){this._sourceState&&this._sourceState.postUpdate(),this._targetState&&this._targetState.postUpdate()},e.prototype.resetClips=function(e){t.prototype.resetClips.call(this,e),this._targetState&&this._targetState.resetClips(e)},e.prototype.shiftClipTime=function(e){t.prototype.shiftClipTime.call(this,e),this._targetState&&this._targetState.shiftClipTime(e),this._sourceState&&this._sourceState.shiftClipTime(e)},e}(goo.AbstractTransitionState),goo.SyncFadeTransitionState=function(t){"use strict";function e(){t.call(this)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.resetClips=function(e){t.prototype.resetClips.call(this,e),this._targetState.resetClips(this._sourceState._globalStartTime)},e.prototype.shiftClipTime=function(e){t.prototype.shiftClipTime.call(this,e),this._targetState.shiftClipTime(this._sourceState._globalStartTime+e),this._sourceState.shiftClipTime(e)},e}(goo.FadeTransitionState),goo.FrozenTransitionState=function(t){"use strict";function e(){t.call(this)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.update=function(e){t.prototype.update.call(this,e),this._targetState&&this._targetState.update(e)},e.prototype.postUpdate=function(){this._targetState&&this._targetState.postUpdate()},e.prototype.resetClips=function(e){t.prototype.resetClips.call(this,e),this._targetState.resetClips(e)},e.prototype.shiftClipTime=function(e){t.prototype.shiftClipTime.call(this,e),this._targetState.shiftClipTime(e)},e}(goo.AbstractTransitionState),goo.SteadyState=function(t){"use strict";function e(e){t.call(this),this.id=null,this._name=e,this._transitions={},this._sourceTree=null}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.setClipSource=function(t){this._sourceTree=t},e.prototype.update=function(t){this._sourceTree.setTime(t)||this.onFinished&&this.onFinished()},e.prototype.getCurrentSourceData=function(){return this._sourceTree.getSourceData()},e.prototype.resetClips=function(e){t.prototype.resetClips.call(this,e),this._sourceTree.resetClips(e)},e.prototype.shiftClipTime=function(e){t.prototype.shiftClipTime.call(this,e),this._sourceTree.shiftClipTime(e)},e.prototype.setTimeScale=function(t){this._sourceTree.setTimeScale(t)},e.prototype.clone=function(){var t=new e(this._name);for(var n in this._transitions)t._transitions[n]=this._transitions[n];return t._sourceTree=this._sourceTree.clone(),t},e}(goo.AbstractState),goo.LayerLerpBlender=function(t){"use strict";function e(){this._blendWeight=null,this._layerA=null,this._layerB=null}return e.prototype.getBlendedSourceData=function(){var e=this._layerA.getCurrentSourceData(),n=this._layerB._currentState?this._layerB._currentState.getCurrentSourceData():null;return t.combineSourceData(e,n,this._blendWeight)},e}(goo.BinaryLerpSource),goo.AnimationLayer=function(t,e,n,o,i,a,r){"use strict";function s(t,e){this.id=e,this._name=t,this._steadyStates={},this._currentState=null,this._layerBlender=new i,this._transitions={},this._transitionStates={}}return s.BASE_LAYER_NAME="-BASE_LAYER-",s.prototype.getStates=function(){return Object.keys(this._steadyStates)},s.prototype.setState=function(t,e){this._steadyStates[t]=e},s.prototype.setBlendWeight=function(t){this._layerBlender&&(this._layerBlender._blendWeight=r.clamp(t,0,1))},s.prototype.getTransitions=function(){var t;if(t=this._currentState?Object.keys(this._currentState._transitions):[],this._transitions)for(var e in this._transitions)-1===t.indexOf(e)&&t.push(e);return t.sort(),t},s.prototype.update=function(t){this._currentState&&this._currentState.update("undefined"!=typeof t?t:a.time)},s.prototype.postUpdate=function(){this._currentState&&this._currentState.postUpdate()},s.prototype.transitionTo=function(t,e,n){e="undefined"!=typeof e?e:a.time;var i,r=this._currentState;if(this._steadyStates[t]===r)return!1;if(!this._steadyStates[t])return!1;if(r&&r._transitions&&(i=r._transitions[t]||r._transitions["*"]),!i&&this._transitions&&(i=this._transitions[t]||this._transitions["*"]),r instanceof o&&i){var s=this._getTransitionByType(i.type);return this._doTransition(s,r,this._steadyStates[t],i,e,n),!0}if(!r&&(i=this._transitions[t])){var s=this._getTransitionByType(i.type);if(s)return this._doTransition(s,null,this._steadyStates[t],i,e,n),!0}return!1},s.prototype._doTransition=function(t,e,n,o,i,a){if(e){t._sourceState=e;var r=o.timeWindow||[-1,-1];if(!t.isValid(r,i))return void console.warn("State not in allowed time window");e.onFinished=null}t._targetState=n,t.readFromConfig(o),this.setCurrentState(t,!0,i,a)},s.prototype.setCurrentState=function(t,e,n,i){n="undefined"!=typeof n?n:a.time,this._currentState=t,t&&(e&&t.resetClips(n),t.onFinished=function(){this.setCurrentState(t._targetState||null,!1,void 0,i),t instanceof o&&i instanceof Function&&i(),this.update()}.bind(this))},s.prototype.getCurrentState=function(){return this._currentState},s.prototype.setCurrentStateById=function(t,e,n,o){var i=this.getStateById(t);this.setCurrentState(i,e,n,o)},s.prototype.getStateById=function(t){return this._steadyStates[t]},s.prototype.getStateByName=function(t){for(var e in this._steadyStates){var n=this._steadyStates[e];if(n._name===t)return this._steadyStates[e]}},s.prototype.setCurrentStateByName=function(t,e,n){if(t){var o=this.getStateByName(t);if(o)return this.setCurrentState(o,e,n),!0;console.warn("unable to find SteadyState named: "+t)}return!1},s.prototype.getCurrentSourceData=function(){return this._layerBlender?this._layerBlender.getBlendedSourceData():this._currentState?this._currentState.getCurrentSourceData():null},s.prototype.updateLayerBlending=function(t){this._layerBlender&&(this._layerBlender._layerA=t,this._layerBlender._layerB=this)},s.prototype.clearCurrentState=function(){this.setCurrentState(null)},s.prototype.resetClips=function(t){this._currentState&&this._currentState.resetClips("undefined"!=typeof t?t:a.time)},s.prototype.shiftClipTime=function(t){this._currentState&&this._currentState.shiftClipTime("undefined"!=typeof t?t:0)},s.prototype.setTimeScale=function(t){this._currentState&&this._currentState.setTimeScale(t)},s.prototype._getTransitionByType=function(o){if(this._transitionStates[o])return this._transitionStates[o];var i;switch(o){case"Fade":i=new t;break;case"SyncFade":i=new e;break;case"Frozen":i=new n;break;default:console.log("Defaulting to frozen transition type"),i=new n}return this._transitionStates[o]=i},s.prototype.clone=function(){var t=new s(this._name);for(var e in this._steadyStates)t._steadyStates[e]=this._steadyStates[e].clone(),this._steadyStates[e]===this._currentState&&(t._currentState=t._steadyStates[e]);for(var e in this._transitions)t._transitions[e]=this._transitions[e];for(var e in this._transitionStates)t._transitionStates[e]=new this._transitionStates[e].constructor;return t},s}(goo.FadeTransitionState,goo.SyncFadeTransitionState,goo.FrozenTransitionState,goo.SteadyState,goo.LayerLerpBlender,goo.World,goo.MathUtils),goo.TriggerData=function(){"use strict";function t(){this._currentTriggers=[],this._currentIndex=-1,this.armed=!1}return t.prototype.arm=function(t,e){if(null===e||0===e.length)this._currentTriggers.length=0,this.armed=!1;else if(t!==this._currentIndex){this._currentTriggers.length=0;for(var n=0,o=e.length;o>n;n++)e[n]&&""!==e[n]&&this._currentTriggers.push(e[n]);this.armed=!0}this._currentIndex=t},t}(),goo.AnimationComponent=function(t,e,n,o,i,a){"use strict";function r(e){t.apply(this,arguments),this.type="AnimationComponent",this.layers=[],this.floats={},this._updateRate=1/60,this._lastUpdate=0,this._triggerCallbacks={};var o=new n(n.BASE_LAYER_NAME);this.layers.push(o),this._skeletonPose=e,this.paused=!1,this.lastTimeOfPause=-1}return r.type="AnimationComponent",r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.transitionTo=function(t,e,n){return this.layers[0].transitionTo(t,void 0,n)?!0:e?this.layers[0].setCurrentStateById(t,!0,void 0,n):!1},r.prototype.getStates=function(){return this.layers[0].getStates()},r.prototype.getCurrentState=function(){return this.layers[0].getCurrentState()},r.prototype.getTransitions=function(){return this.layers[0].getTransitions()},r.prototype.update=function(t){if(!this.paused){if(t="undefined"!=typeof t?t:e.time,0!==this._updateRate){if(t>this._lastUpdate&&t-this._lastUpdaten;n++)this.layers[n].update(t)}},r.prototype.apply=function(t){var e=this.getCurrentSourceData(),n=this._skeletonPose;if(e){for(var r=Object.keys(e),s=0,c=r.length;c>s;s++){var l=r[s],p=e[l];if(p instanceof o)n&&p._jointIndex>=0&&p.applyTo(n._localTransforms[p._jointIndex]);else if(p instanceof i)t&&(p.applyTo(t.transform),t.updateTransform(),this._updateWorldTransform(t));else if(p instanceof a){if(p.armed){for(var s=0,u=p._currentTriggers.length;u>s;s++){var h=this._triggerCallbacks[p._currentTriggers[s]];if(h&&h.length)for(var _=0,f=h.length;f>_;_++)h[_]()}p.armed=!1}}else p instanceof Array&&(this.floats[l]=p[0])}n&&n.updateTransforms()}},r.prototype._updateWorldTransform=function(t){t.updateWorldTransform();for(var e=0;et;t++)this.layers[t].postUpdate()},r.prototype.getCurrentSourceData=function(){if(0===this.layers.length)return[];var t=this.layers.length-1;this.layers[0]._layerBlender=null;for(var e=0;t>e;e++)this.layers[e+1].updateLayerBlending(this.layers[e]);return this.layers[t].getCurrentSourceData()},r.prototype.addLayer=function(t,e){isNaN(e)?this.layers.push(t):this.layers.splice(e,0,t)},r.prototype.resetClips=function(t){for(var e=0;en;++n){var i=this._channels[n],a=e.getApplyTo(i);i.updateSample(t,a)}},t.prototype.addChannel=function(t){this._channels.push(t),this.updateMaxTimeIndex()},t.prototype.removeChannel=function(t){var e=this._channels.indexOf(t);return e>=0?(this._channels.splice(e,1),this.updateMaxTimeIndex(),!0):!1},t.prototype.findChannelByName=function(t){for(var e=0,n=this._channels.length;n>e;++e){var o=this._channels[e];if(t===o._channelName)return o}return null},t.prototype.updateMaxTimeIndex=function(){this._maxTime=-1;for(var t,e=0;ethis._maxTime&&(this._maxTime=t)}},t.prototype.toString=function(){return this._name+": "+this._channels.map(function(t){return t._channelName})},t}(),goo.InterpolatedFloatChannel=function(t,e){"use strict";function n(e,n,o,i){t.call(this,e,n,i),this._values=o?o.slice(0):null}return n.prototype=Object.create(t.prototype),n.prototype.createStateDataObject=function(){return[0]},n.prototype.setCurrentSample=function(t,n,o){o[0]=e.lerp(n,this._values[t],this._values[t+1])},n.prototype.getData=function(t,e){var n=e||[];return n[0]=this._values[t],n},n}(goo.AbstractAnimationChannel,goo.MathUtils),goo.TriggerChannel=function(t,e){"use strict";function n(e,n,o,i){t.call(this,e,n,i),this._keys=o?o.slice(0):null,this.guarantee=!1}return n.prototype=Object.create(t.prototype),n.prototype.createStateDataObject=function(){return new e},n.prototype.setCurrentSample=function(t,e,n){var o=n._currentIndex,i=1!==e?t:t+1;if(o!==i&&this.guarantee){var a=[];if(o>i){for(var r=o+1;r=r;r++)a.push(this._keys[r]);n.arm(i,a)}else n.arm(i,[this._keys[i]])},n}(goo.AbstractAnimationChannel,goo.TriggerData),goo.AnimationRegister=function(t){"use strict";for(var e=["goo/scripts/Scripts","goo/animationpack/Joint","goo/animationpack/Skeleton","goo/animationpack/SkeletonPose","goo/animationpack/blendtree/BinaryLerpSource","goo/animationpack/blendtree/ClipSource","goo/animationpack/blendtree/FrozenClipSource","goo/animationpack/blendtree/ManagedTransformSource","goo/animationpack/components/AnimationComponent","goo/animationpack/clip/AbstractAnimationChannel","goo/animationpack/clip/AnimationClip","goo/animationpack/clip/AnimationClipInstance","goo/animationpack/clip/InterpolatedFloatChannel","goo/animationpack/clip/JointChannel","goo/animationpack/clip/JointData","goo/animationpack/clip/TransformChannel","goo/animationpack/clip/TransformData","goo/animationpack/clip/TriggerChannel","goo/animationpack/clip/TriggerData","goo/animationpack/layer/AnimationLayer","goo/animationpack/layer/LayerLerpBlender","goo/animationpack/state/AbstractState","goo/animationpack/state/AbstractTransitionState","goo/animationpack/state/FadeTransitionState","goo/animationpack/state/FrozenTransitionState","goo/animationpack/state/SteadyState","goo/animationpack/state/SyncFadeTransitionState"],n=1;nc&&(i=c)}return e._startTime=Math.max(e._startTime,i),e});case"Managed":return e&&e instanceof o||(e=new o),t.clipRef?this.loadObject(t.clipRef,c).then(function(n){return e.initFromClip(n,t.filter,t.channels),e}):s.resolve(e);case"Lerp":var l=[this._parseClipSource(t.clipSourceA,null,c),this._parseClipSource(t.clipSourceB,null,c)];return r.all(l).then(function(n){return e=new i(n[0],n[1]),t.blendWeight&&(e.blendWeight=t.blendWeight),e});case"Frozen":return this._parseClipSource(t.clipSource).then(function(n){return e&&e instanceof a?(e._source=n,e._time=t.frozenTime||0):e=new a(n,t.frozenTime||0),e});default:return console.error("Unable to parse clip source"),s.resolve()}},l}(goo.ConfigHandler,goo.SteadyState,goo.ClipSource,goo.ManagedTransformSource,goo.BinaryLerpSource,goo.FrozenClipSource,goo.rsvp,goo.PromiseUtils,goo.ObjectUtils),goo.SkeletonHandler=function(t,e,n,o,i,a){"use strict";function r(){t.apply(this,arguments)}return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,t._registerClass("skeleton",r),r.prototype._update=function(t,r){if(!this._objects.has(t)){if(!r)return i.resolve();var s=[];a.forEach(r.joints,function(t){var n=new e(t.name);n._index=t.index,n._parentIndex=t.parentIndex,n._inverseBindPose.matrix.data.set(t.inverseBindPose),s.push(n)},null,"index");var c=new n(r.name,s),l=new o(c);l.setToBindPose(),this._objects.set(t,l)}return i.resolve(this._objects.get(t))},r}(goo.ConfigHandler,goo.Joint,goo.Skeleton,goo.SkeletonPose,goo.PromiseUtils,goo.ObjectUtils),goo.AnimationHandlers=function(){}(goo.AnimationClipHandler,goo.AnimationComponentHandler,goo.AnimationLayersHandler,goo.AnimationStateHandler,goo.SkeletonHandler),goo.AnimationSystem=function(t,e){"use strict";function n(){t.call(this,"AnimationSystem",["AnimationComponent"])}return n.prototype=Object.create(t.prototype),n.prototype.process=function(){for(var t=0;t0) func == list[i].f && list.splice(i,1) 21 | } 22 | /** 23 | * Emit: send event, callbacks will be triggered 24 | */ 25 | target.emit = function(){ 26 | var args = A.apply([], arguments), 27 | list = events[args.shift()] || [], 28 | i = list.length, j 29 | for(j=0;ji;i++)o.push(Math.cos(2*Math.PI*i/n),Math.sin(2*Math.PI*i/n),.5),e.push(i,(i+1)%n);for(var i=0;n>i;i++)o.push(Math.cos(2*Math.PI*i/n),Math.sin(2*Math.PI*i/n),-.5),e.push(n+i,n+(i+1)%n);return o.push(Math.cos(1*Math.PI/2),Math.sin(1*Math.PI/2),-.5,Math.cos(1*Math.PI/2),Math.sin(1*Math.PI/2),.5,Math.cos(2*Math.PI/2),Math.sin(2*Math.PI/2),-.5,Math.cos(2*Math.PI/2),Math.sin(2*Math.PI/2),.5,Math.cos(3*Math.PI/2),Math.sin(3*Math.PI/2),-.5,Math.cos(3*Math.PI/2),Math.sin(3*Math.PI/2),.5,Math.cos(4*Math.PI/2),Math.sin(4*Math.PI/2),-.5,Math.cos(4*Math.PI/2),Math.sin(4*Math.PI/2),.5),e.push(2*n+0,2*n+1,2*n+2,2*n+3,2*n+4,2*n+5,2*n+6,2*n+7),this.getAttributeBuffer(t.POSITION).set(o),this.getIndexBuffer().set(e),this},o}(goo.MeshData),goo.PhysicsSphereDebugShape=function(t){"use strict";function o(o){o=o||32;var e=t.defaultMap([t.POSITION]);this.numSegments=o,t.call(this,e,9*o,6*o),this.indexModes[0]="Lines",this.rebuild()}return o.prototype=Object.create(t.prototype),o.prototype.constructor=o,o.prototype.buildWireframeData=function(){return new o},o.prototype.rebuild=function(){for(var o=[],e=[],n=this.numSegments,i=0;n>i;i++)o.push(0,Math.cos(2*Math.PI*i/n),Math.sin(2*Math.PI*i/n)),e.push(i,(i+1)%n);for(var i=0;n>i;i++)o.push(Math.cos(2*Math.PI*i/n),0,Math.sin(2*Math.PI*i/n)),e.push(n+i,n+(i+1)%n);for(var i=0;n>i;i++)o.push(Math.cos(2*Math.PI*i/n),Math.sin(2*Math.PI*i/n),0),e.push(2*n+i,2*n+(i+1)%n);return this.getAttributeBuffer(t.POSITION).set(o),this.getIndexBuffer().set(e),this},o}(goo.MeshData),goo.PhysicsBoxDebugShape=function(t){"use strict";function o(){var o=t.defaultMap([t.POSITION]);t.call(this,o,24,24),this.indexModes[0]="Lines",this.rebuild()}return o.prototype=Object.create(t.prototype),o.prototype.constructor=o,o.prototype.buildWireframeData=function(){return new o},o.prototype.rebuild=function(){var o=[],e=[];return o.push(-.5,-.5,-.5,-.5,-.5,.5,-.5,.5,.5,-.5,.5,-.5,.5,-.5,-.5,.5,-.5,.5,.5,.5,.5,.5,.5,-.5),e.push(0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7),this.getAttributeBuffer(t.POSITION).set(o),this.getIndexBuffer().set(e),this},o}(goo.MeshData),goo.Pool=function(){"use strict";function t(t){t=t||{},this._objects=[],this._init=t.init||function(){},this._create=t.create||function(){},this._destroy=t.destroy||function(){}}return t.prototype.resize=function(t){for(var o=this._objects;o.length>t;)this._destroy(o.pop());for(;o.lengthn){var i=e;e=n,n=i}var s=e<<16|n;return s},a._getShapeIdA=function(t){return(4294901760&t)>>16},a._getShapeIdB=function(t){return 65535&t},a.prototype._fillContactsMap=function(t,o){for(var e=0;e!==t.length;e++){var n=t[e],i=a._getShapePairHash(n.si,n.sj);o.add(i)}},a.prototype.emitContactEvents=function(){var t=this.cannonWorld.contacts.sort(this._sortContacts),o=this._currentContacts,e=this._lastContacts;this._fillContactsMap(t,o);for(var n,i=0;i h1{ 175 | font-size: 2em; 176 | font-weight: 200; 177 | margin-bottom: .3em; 178 | } 179 | 180 | #goo-loading-message > h2{ 181 | font-size: 1.5em; 182 | font-weight: 200; 183 | margin-bottom: .3em; 184 | margin-top: 1.5em; 185 | } 186 | 187 | #progress-bar { 188 | width: 100%; 189 | height: 2px; 190 | margin: 0 auto; 191 | background: #555; 192 | } 193 | 194 | #progress { 195 | background: #D8DCDF; /* Electric blue */ 196 | height: 100%; 197 | width: 0; 198 | } 199 | 200 | #goologo { 201 | display: none; 202 | -webkit-filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); 203 | filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); 204 | } 205 | 206 | .share-buttons { 207 | position: absolute; 208 | display: none; 209 | right: 15px; 210 | bottom: 10px; 211 | z-index: 1; 212 | -webkit-touch-callout: none; 213 | -webkit-user-select: none; 214 | -khtml-user-select: none; 215 | -moz-user-select: none; 216 | -ms-user-select: none; 217 | -o-user-select: none; 218 | user-select: none; 219 | -webkit-filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); 220 | filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); 221 | } 222 | 223 | #fallback { 224 | display: none; 225 | position: absolute; 226 | top: 0; 227 | right: 0; 228 | bottom: 0; 229 | left: 0; 230 | width: 100%; 231 | height: 100%; 232 | font-size: 20px; 233 | background-repeat: no-repeat; 234 | background-position: center; 235 | background-attachment: fixed; 236 | background-size: cover; 237 | color: #fff; 238 | overflow-y: auto; 239 | } 240 | 241 | #fallback.show { 242 | display: block; 243 | } 244 | 245 | .fallback-overlay { 246 | position: absolute; 247 | right: 0; 248 | width: 50%; 249 | height: auto; 250 | min-height: 100%; 251 | background-color: rgba(0,0,0,0.8); 252 | 253 | display: -webkit-box; 254 | display: -moz-box; 255 | display: -ms-flexbox; 256 | display: -webkit-flex; 257 | display: flex; 258 | -webkit-justify-content: center; 259 | -ms-flex-pack: center; 260 | justify-content: center; 261 | -webkit-align-content: center; 262 | -ms-flex-line-pack: center; 263 | align-content: center; 264 | -webkit-box-align: center; 265 | -moz-box-align: center; 266 | -webkit-align-items: center; 267 | -ms-flex-align: center; 268 | align-items: center; 269 | } 270 | 271 | .fallback-content { 272 | display: block; 273 | max-width: 960px; 274 | margin: 120px; 275 | } 276 | 277 | .fallback-content h1 { 278 | font-size: 40px; 279 | padding-bottom: 36px; 280 | } 281 | 282 | #fallback .error-case { display: none; } 283 | #fallback .error-case.show { display: block; } 284 | 285 | #fallback .error-msg { 286 | padding-bottom: 36px; 287 | } 288 | 289 | .error-msg a { 290 | text-decoration: underline; 291 | } 292 | 293 | .help-links { 294 | padding: 0; 295 | } 296 | 297 | #fallback ul { 298 | padding-bottom: 30px; 299 | margin: 0; 300 | } 301 | 302 | #fallback ul li { 303 | padding-bottom: 15px; 304 | } 305 | 306 | #fallback .help-links li { 307 | display: inline-block; 308 | } 309 | 310 | #fallback .help-links li a { 311 | padding-right: 30px; 312 | } 313 | 314 | #fallback .help-links li:last-child a { 315 | padding-right: 0; 316 | } 317 | 318 | #fallback .help-links li.no-margin { 319 | margin: 0; 320 | } 321 | 322 | .help-steps { 323 | padding-left: 22px; 324 | list-style-type: decimal; 325 | } 326 | 327 | #fallback a { 328 | margin: 0 auto; 329 | font-size: 20px; 330 | color: #38b3f6; 331 | text-decoration: none; 332 | } 333 | 334 | #fallback a:hover, #goo-loading-overlay a:hover { 335 | color: #fff; 336 | } 337 | 338 | .browser-link { 339 | border-radius: 10px; 340 | border: 1px solid #525252; 341 | height: 83px; 342 | background-color: white; 343 | vertical-align: middle; 344 | opacity: 0.75; 345 | width: auto; 346 | height: 100%; 347 | } 348 | 349 | .browser-link:hover { 350 | opacity: 1.0; 351 | } 352 | 353 | .browser-img { 354 | padding: 12px; 355 | } 356 | 357 | .logo { 358 | display: block; 359 | text-align: center; 360 | } 361 | 362 | .logo p { 363 | padding-bottom: 10px; 364 | } 365 | 366 | .logo a { 367 | color: #fff; 368 | } 369 | 370 | /* MEDIA QUERIES */ 371 | 372 | @media (max-width: 800px) { 373 | body { 374 | overflow: auto; 375 | } 376 | 377 | #fallback { 378 | position: relative; 379 | height: auto; 380 | min-height: 0; 381 | overflow: hidden; 382 | } 383 | 384 | .fallback-overlay { 385 | position: relative; 386 | width: 100%; 387 | height: auto; 388 | min-height: 100%; 389 | } 390 | 391 | .fallback-content { 392 | margin: 60px; 393 | max-width: auto; 394 | } 395 | } 396 | 397 | @media (max-width: 460px) { 398 | .fallback-content { 399 | margin: 40px; 400 | } 401 | 402 | .fallback-content h1 { 403 | font-size: 30px; 404 | padding-bottom: 20px; 405 | } 406 | 407 | #fallback .error-msg { 408 | font-size: 20px; 409 | padding-bottom: 30px; 410 | } 411 | 412 | .error-msg a { 413 | font-size: 15px; 414 | } 415 | 416 | #fallback .help-links li { 417 | display: block; 418 | text-align: center; 419 | } 420 | 421 | #fallback .help-links li a { 422 | padding-right: 0; 423 | } 424 | } -------------------------------------------------------------------------------- /lib/timelinepack.js: -------------------------------------------------------------------------------- 1 | goo.AbstractTimelineChannel=function(){"use strict";function e(e){this.id=e,this.enabled=!0,this.keyframes=[],this.lastTime=0}return e.prototype._find=function(e,t){var n=0,i=e.length-1,r=e[e.length-1].time;if(t>r)return i;for(;i-n>1;){var o=Math.floor((i+n)/2),a=e[o].time;t>a?n=o:i=o}return n},e.prototype.sort=function(){return this.keyframes.sort(function(e,t){return e.time-t.time}),this.lastTime=this.keyframes[this.keyframes.length-1].time,this},e}(),goo.EventChannel=function(e){"use strict";function t(t){e.call(this,t),this.oldTime=0,this.callbackIndex=0}return t.prototype=Object.create(e.prototype),t.prototype.constructor=e,t.prototype.addCallback=function(e,t,n){var i={id:e,time:t,callback:n};if(t>this.lastTime)this.keyframes.push(i),this.lastTime=t;else if(!this.keyframes.length||tthis.keyframes[this.callbackIndex].time;)this.keyframes[this.callbackIndex].callback(),this.callbackIndex++;return this.oldTime=e,this},t.prototype.setTime=function(e){return this.enabled&&this.keyframes.length?(e<=this.keyframes[0].time?this.callbackIndex=0:this.callbackIndex=this._find(this.keyframes,e)+1,this.oldTime=e,this):this},t}(goo.AbstractTimelineChannel),goo.TimelineComponent=function(e){"use strict";function t(){e.apply(this,arguments),this.type="TimelineComponent",this.channels=[],this.time=0,this.duration=0,this.loop=!1}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.addChannel=function(e){return this.channels.push(e),this},t.prototype.update=function(e){var t=this.time+e;if(t>this.duration&&(this.loop?t%=this.duration:t=this.duration),t===this.time)return this;this.time=t;for(var n=0;nthis.lastTime)this.keyframes.push(r),this.lastTime=t;else if(!this.keyframes.length||t=this.keyframes[this.keyframes.length-1].time)n=this.keyframes[this.keyframes.length-1].value;else{i=this._find(this.keyframes,e);var r=this.keyframes[i],o=this.keyframes[i+1],a=(e-r.time)/(o.time-r.time),s=r.easingFunction(a);n=t.lerp(s,r.value,o.value)}return this.value=n,this.callbackUpdate(e,this.value,i),this},n.prototype.setTime=n.prototype.update,n.getSimpleTransformTweener=function(e,t,n,i){var r;return function(o,a){r||(r=i(n)),r&&(r.transformComponent.transform[e].data[t]=a,r.transformComponent.setUpdated())}},n.getRotationTweener=function(e,n,i,r){var o,a=function(r,s){if(o||(o=i(n)),o){var l=a.rotation;l[e]=s*t.DEG_TO_RAD,o.transformComponent.transform.rotation.fromAngles(l[0],l[1],l[2]),o.transformComponent.setUpdated()}};return a.rotation=r,a},n}(goo.AbstractTimelineChannel,goo.MathUtils),goo.TimelineComponentHandler=function(e,t,n,i,r,o,a,s){"use strict";function l(){e.apply(this,arguments),this._type="TimelineComponent"}function h(e){if(!e)return s.Easing.Linear.None;var t=e.indexOf("."),n=e.substr(0,t),i=e.substr(t+1);return s.Easing[n][i]}function u(e,t,n){var i=!1,o=r.find(n.keyframes,function(e){return e.id===t}),a=h(e.easing);return o?(o.time!==+e.time&&(i=!0),o.time=+e.time,o.value=+e.value,o.easingFunction=a):n.addKeyframe(t,e.time,e.value,a),{needsResorting:i}}function c(e,t,n,i){var a=!1,s=r.find(n.keyframes,function(e){return e.id===t}),l=function(){o.emit(i.eventName,e.value)};return s?(s.time!==+e.time&&(a=!0),s.time=+e.time,s.callback=l):n.addCallback(t,e.time,l),{needsResorting:a}}function m(e,t,o,a,s){var h=r.find(o.channels,function(e){return e.id===t});if(h){if(e.entityId&&h.callbackUpdate&&h.callbackUpdate.rotation){var m=s[e.entityId]=h.callbackUpdate.rotation;m[0]=0,m[1]=0,m[2]=0}}else{var f=e.propertyKey;if(f){var p=e.entityId;p&&!s[p]&&(s[p]=[0,0,0]);var d=l.tweenMap[f](p,a,s[p]);h=new n(t,{callbackUpdate:d})}else h=new i(t);o.channels.push(h)}h.enabled=e.enabled!==!1,h.keyframes=h.keyframes.filter(function(t){return!!e.keyframes[t.id]});var y=!1;if(e.propertyKey)for(var g in e.keyframes){var k=e.keyframes[g],v=u(k,g,h,e);y=y||v.needsResorting}else for(var g in e.keyframes){var k=e.keyframes[g],v=c(k,g,h,e);y=y||v.needsResorting}y&&h.sort()}return l.prototype=Object.create(e.prototype),l.prototype.constructor=l,e._registerClass("timeline",l),l.prototype._prepare=function(){},l.prototype._create=function(){return new t},l.tweenMap={translationX:n.getSimpleTransformTweener.bind(null,"translation",0),translationY:n.getSimpleTransformTweener.bind(null,"translation",1),translationZ:n.getSimpleTransformTweener.bind(null,"translation",2),scaleX:n.getSimpleTransformTweener.bind(null,"scale",0),scaleY:n.getSimpleTransformTweener.bind(null,"scale",1),scaleZ:n.getSimpleTransformTweener.bind(null,"scale",2),rotationX:n.getRotationTweener.bind(null,0),rotationY:n.getRotationTweener.bind(null,1),rotationZ:n.getRotationTweener.bind(null,2)},l.prototype.update=function(t,n,i){var r=this;return e.prototype.update.call(this,t,n,i).then(function(e){if(e){isNaN(n.duration)||(e.duration=+n.duration),e.loop=n.loop.enabled===!0,e.channels=e.channels.filter(function(e){return!!n.channels[e.id]});var t=function(e){return r.world.entityManager.getEntityById(e)},i={};return a.forEach(n.channels,function(n){m(n,n.id,e,t,i)},null,"sortValue"),e}})},l}(goo.ComponentHandler,goo.TimelineComponent,goo.ValueChannel,goo.EventChannel,goo.ArrayUtils,goo.SystemBus,goo.ObjectUtils,goo.Tween),goo.TimelineSystem=function(e,t){"use strict";function n(){e.call(this,"TimelineSystem",["TimelineComponent"])}return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.process=function(e,n){if(this.resetRequest){var i;this.resetRequest=!1;for(var r=0;r h1{ 175 | font-size: 2em; 176 | font-weight: 200; 177 | margin-bottom: .3em; 178 | } 179 | 180 | #goo-loading-message > h2{ 181 | font-size: 1.5em; 182 | font-weight: 200; 183 | margin-bottom: .3em; 184 | margin-top: 1.5em; 185 | } 186 | 187 | #progress-bar { 188 | width: 100%; 189 | height: 2px; 190 | margin: 0 auto; 191 | background: #555; 192 | } 193 | 194 | #progress { 195 | background: #D8DCDF; /* Electric blue */ 196 | height: 100%; 197 | width: 0; 198 | } 199 | 200 | #goologo { 201 | display: none; 202 | -webkit-filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); 203 | filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); 204 | } 205 | 206 | .share-buttons { 207 | position: absolute; 208 | display: none; 209 | right: 15px; 210 | bottom: 10px; 211 | z-index: 1; 212 | -webkit-touch-callout: none; 213 | -webkit-user-select: none; 214 | -khtml-user-select: none; 215 | -moz-user-select: none; 216 | -ms-user-select: none; 217 | -o-user-select: none; 218 | user-select: none; 219 | -webkit-filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); 220 | filter: drop-shadow(0 0 2px rgba(0,0,0,0.3)); 221 | } 222 | 223 | #fallback { 224 | display: none; 225 | position: absolute; 226 | top: 0; 227 | right: 0; 228 | bottom: 0; 229 | left: 0; 230 | width: 100%; 231 | height: 100%; 232 | font-size: 20px; 233 | background-repeat: no-repeat; 234 | background-position: center; 235 | background-attachment: fixed; 236 | background-size: cover; 237 | color: #fff; 238 | overflow-y: auto; 239 | } 240 | 241 | #fallback.show { 242 | display: block; 243 | } 244 | 245 | .fallback-overlay { 246 | position: absolute; 247 | right: 0; 248 | width: 50%; 249 | height: auto; 250 | min-height: 100%; 251 | background-color: rgba(0,0,0,0.8); 252 | 253 | display: -webkit-box; 254 | display: -moz-box; 255 | display: -ms-flexbox; 256 | display: -webkit-flex; 257 | display: flex; 258 | -webkit-justify-content: center; 259 | -ms-flex-pack: center; 260 | justify-content: center; 261 | -webkit-align-content: center; 262 | -ms-flex-line-pack: center; 263 | align-content: center; 264 | -webkit-box-align: center; 265 | -moz-box-align: center; 266 | -webkit-align-items: center; 267 | -ms-flex-align: center; 268 | align-items: center; 269 | } 270 | 271 | .fallback-content { 272 | display: block; 273 | max-width: 960px; 274 | margin: 120px; 275 | } 276 | 277 | .fallback-content h1 { 278 | font-size: 40px; 279 | padding-bottom: 36px; 280 | } 281 | 282 | #fallback .error-case { display: none; } 283 | #fallback .error-case.show { display: block; } 284 | 285 | #fallback .error-msg { 286 | padding-bottom: 36px; 287 | } 288 | 289 | .error-msg a { 290 | text-decoration: underline; 291 | } 292 | 293 | .help-links { 294 | padding: 0; 295 | } 296 | 297 | #fallback ul { 298 | padding-bottom: 30px; 299 | margin: 0; 300 | } 301 | 302 | #fallback ul li { 303 | padding-bottom: 15px; 304 | } 305 | 306 | #fallback .help-links li { 307 | display: inline-block; 308 | } 309 | 310 | #fallback .help-links li a { 311 | padding-right: 30px; 312 | } 313 | 314 | #fallback .help-links li:last-child a { 315 | padding-right: 0; 316 | } 317 | 318 | #fallback .help-links li.no-margin { 319 | margin: 0; 320 | } 321 | 322 | .help-steps { 323 | padding-left: 22px; 324 | list-style-type: decimal; 325 | } 326 | 327 | #fallback a { 328 | margin: 0 auto; 329 | font-size: 20px; 330 | color: #38b3f6; 331 | text-decoration: none; 332 | } 333 | 334 | #fallback a:hover, #goo-loading-overlay a:hover { 335 | color: #fff; 336 | } 337 | 338 | .browser-link { 339 | border-radius: 10px; 340 | border: 1px solid #525252; 341 | height: 83px; 342 | background-color: white; 343 | vertical-align: middle; 344 | opacity: 0.75; 345 | width: auto; 346 | height: 100%; 347 | } 348 | 349 | .browser-link:hover { 350 | opacity: 1.0; 351 | } 352 | 353 | .browser-img { 354 | padding: 12px; 355 | } 356 | 357 | .logo { 358 | display: block; 359 | text-align: center; 360 | } 361 | 362 | .logo p { 363 | padding-bottom: 10px; 364 | } 365 | 366 | .logo a { 367 | color: #fff; 368 | } 369 | 370 | /* MEDIA QUERIES */ 371 | 372 | @media (max-width: 800px) { 373 | body { 374 | overflow: auto; 375 | } 376 | 377 | #fallback { 378 | position: relative; 379 | height: auto; 380 | min-height: 0; 381 | overflow: hidden; 382 | } 383 | 384 | .fallback-overlay { 385 | position: relative; 386 | width: 100%; 387 | height: auto; 388 | min-height: 100%; 389 | } 390 | 391 | .fallback-content { 392 | margin: 60px; 393 | max-width: auto; 394 | } 395 | } 396 | 397 | @media (max-width: 460px) { 398 | .fallback-content { 399 | margin: 40px; 400 | } 401 | 402 | .fallback-content h1 { 403 | font-size: 30px; 404 | padding-bottom: 20px; 405 | } 406 | 407 | #fallback .error-msg { 408 | font-size: 20px; 409 | padding-bottom: 30px; 410 | } 411 | 412 | .error-msg a { 413 | font-size: 15px; 414 | } 415 | 416 | #fallback .help-links li { 417 | display: block; 418 | text-align: center; 419 | } 420 | 421 | #fallback .help-links li a { 422 | padding-right: 0; 423 | } 424 | } --------------------------------------------------------------------------------