diff --git a/webroot/js/main.js b/webroot/js/main.js index ec749c4..4454e8c 100644 --- a/webroot/js/main.js +++ b/webroot/js/main.js @@ -1,19 +1,19 @@ -$(function(){ - +$(function(){ + require('dotenv').config() var $main = $("#main"), $window = $( window ), mainHeight = $main.outerHeight(), mainWidth = $main.outerWidth(), mainAspect = 4/3, - resizeTimer; - + resizeTimer; + $(window).resize( function(e) { clearTimeout(resizeTimer); - resizeTimer = setTimeout(scaleWindow, 100); + resizeTimer = setTimeout(scaleWindow, 100); }); - + function scaleWindow() { var scale, windowAspect; @@ -27,8 +27,8 @@ $(function(){ $main.css({ transform: "translate(-50%, -50%) " + "scale(" + scale + ")" - }); - } + }); + } scaleWindow(); // init - -}); \ No newline at end of file + +});