Skip to content

Commit

Permalink
Animate artwork only if song is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
esseki committed Oct 17, 2014
1 parent 8422a13 commit 4730b22
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions js/volumio.api.js
Expand Up @@ -432,14 +432,16 @@ function updateGUI(json){
$('#currentartist').html(json['currentartist']);
$('#currentsong').html(json['currentsong']);
$('#currentalbum').html(json['currentalbum']);
// render album artwork with a nice animation
if ($('#currentartwork').hasClass('flip')) {
$("#currentartwork .front").css('background-image', 'url('+json['currentartwork']+')');
$('#currentartwork').removeClass('flip');
}
else {
$("#currentartwork .back").css('background-image', 'url('+json['currentartwork']+')');
$('#currentartwork').addClass('flip');
// render album artwork with a nice animation (only if song is changed)
if (GUI.currentsong != json['currentsong']) {
if ($('#currentartwork').hasClass('flip')) {
$("#currentartwork .front").css('background-image', 'url('+json['currentartwork']+')');
$('#currentartwork').removeClass('flip');
}
else {
$("#currentartwork .back").css('background-image', 'url('+json['currentartwork']+')');
$('#currentartwork').addClass('flip');
}
}
if (json['repeat'] == 1) {
$('#repeat').addClass('btn-primary');
Expand Down

0 comments on commit 4730b22

Please sign in to comment.