diff options
Diffstat (limited to 'site/public/assets/javascripts/app.js')
| -rw-r--r-- | site/public/assets/javascripts/app.js | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/site/public/assets/javascripts/app.js b/site/public/assets/javascripts/app.js deleted file mode 100644 index 4e00f30..0000000 --- a/site/public/assets/javascripts/app.js +++ /dev/null @@ -1,92 +0,0 @@ - -if (is_mobile) { - $("html").addClass("mobile") -} -else { - $("html").addClass("desktop") -} - - -var scene, cam, map; - -var app = new function(){} - -app.mode = { editor: false, builder: false } - -app.init = function () { - app.launch() -} - -app.launch = function () { - // if ($.browser.msie || ! has3d()) { return app.fallback() } - if ($.browser.msie) { - $("html").addClass("msie") - } - else { - $("html").addClass("notmsie") - } - - scene = new MX.Scene().addTo('#scene') - - $(window).resize(app.resize) - app.resize() - - cam = scene.camera - - var last_t = 0 - function animate (t) { - var dt = t - last_t - last_t = t - requestAnimationFrame(animate) - environment.update(t) - // app.movements.update(dt || 0) - } - - FastClick.attach(document.body) - - window.environment && window.environment.init() - animate() - - window.scrollTo(0,0) -} - -app.resize = function () { - scene.width = window.innerWidth - scene.height = window.innerHeight - scene.perspective = min(window.innerWidth, scene.height) - scene.update() -} - -app.fallback = function(){ - app.unsupported = true - var msg = "Sorry, your browser is not supported.<br><br>" + - "Please use <a href='http://chrome.com/'>Chrome</a> or <a href='https://www.apple.com/safari/'>Safari</a> or <a href='http://getfirefox.com/'>Firefox</a>." - var $fallback = $("<div>") - $fallback.attr('id', 'fallback') - $fallback.html(msg) - $('body').append($fallback) -} - -app.on = function(){ - app.tube.on.apply(app.tube, arguments) -} - -app.off = function(){ - app.tube.off.apply(app.tube, arguments) -} - -app.position = function(obj){ - var pos = { - x: obj.x, - y: obj.y, - z: obj.z, - rotationX: obj.rotationX, - rotationY: obj.rotationY - } - if (obj.scale !== 1) { - pos.scale = obj.scale - } - return pos -} - -document.addEventListener('DOMContentLoaded', app.init) |
