adjust aspect ratio of reflection if logo ratio is not 2
This commit is contained in:
parent
229b2c4cc8
commit
7c320c7614
1 changed files with 24 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue