Skip to content

Commit

Permalink
Progress on work indicator
Browse files Browse the repository at this point in the history
This should be the right Javascript/CSS but it doesn't look right for Chrome or FF users yet because of the glitch rendering these four pixels from the BMP file in those browsers. The feature now works in Safari.
  • Loading branch information
captbaritone committed Nov 9, 2014
1 parent e9f7b6a commit 21f4712
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class='status'>
<div id='clutter-bar' class='disabled'></div>
<div id='play-pause' class='stop'>
<div id='work-indicator' class='selected'></div>
<div id='work-indicator'></div>
</div>
<div id='time'>
<div id='minus-sign'></div>
Expand Down
4 changes: 2 additions & 2 deletions winamp.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ a:focus { outline: none; }
height: 9px;
width: 3px;
background-image: url('skins/default/PLAYPAUS.BMP');
background-position: -39px 0;
background-position: -36px 0;
}
.status #play-pause.play #work-indicator.selected {
background-position: -36px 0;
background-position: -39px 0;
}

.status #play-pause.play { }
Expand Down
9 changes: 9 additions & 0 deletions winamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function Winamp () {
'volume': document.getElementById('volume'),
'balance': document.getElementById('balance'),
'playPause': document.getElementById('play-pause'),
'workIndicator': document.getElementById('work-indicator'),
'winamp': document.getElementById('winamp'),
'titleBar': document.getElementById('title-bar'),
};
Expand Down Expand Up @@ -178,6 +179,14 @@ function Winamp () {
self.setStatus('stop');
});

this.media.addEventListener('waiting', function() {
self.nodes.workIndicator.classList.add('selected');
});

this.media.addEventListener('playing', function() {
self.nodes.workIndicator.classList.remove('selected');
});

this.nodes.shade.onclick = function() {
self.nodes.winamp.classList.toggle('shade');
}
Expand Down

0 comments on commit 21f4712

Please sign in to comment.