diff --git a/static/js/home.js b/static/js/home.js index 563462b9..980151f9 100644 --- a/static/js/home.js +++ b/static/js/home.js @@ -247,6 +247,8 @@ pandora.ui.home = function() { }) .appendTo(that); + adjustRatio(); + if (pandora.user.level == 'guest') { $signupButton.appendTo(that); $signinButton.appendTo(that); @@ -254,6 +256,28 @@ pandora.ui.home = function() { $preferencesButton.appendTo(that); } + function adjustRatio() { + var width = $logo.width(); + var height = $logo.height(); + if (width == 0 || height == 0) { + setTimeout(adjustRatio, 50); + } + var aspect = width / height; + if (aspect != 2) { + var top = 320 / aspect; + $reflectionImage.css({ + top: top + 'px', + }) + $reflectionGradient.css({ + top: top + 'px', + height: (top + 2) + 'px', + }) + $logo.css({ + bottom: top + 'px', + }) + } + } + that.fadeInScreen = function() { that.appendTo(Ox.$body).animate({opacity: 1}, 500, function() { that.find(':not(#logo)').animate({opacity: 1}, 250, function() {