styling changes

This commit is contained in:
lone-cloud 2015-10-14 16:50:40 -07:00
parent 71dc34f63e
commit c2ddab00c1
4 changed files with 92 additions and 61 deletions

View file

@ -40,19 +40,24 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
this.send('goToSong', 0, true);
}
} else {
this.get('notify').alert({html: this.get('notStreamableHtml')(result.title)});
failedSongs.push(result.title);
}
} else if(result.kind === 'playlist'){
if(result.streamable === true){
result.tracks.forEach(processResult);
} else {
this.get('notify').alert({html: this.get('notStreamableHtml')(result.title)});
failedSongs.push(result.title)
}
}
};
},
failedSongs = [];
if(resultObj instanceof Array){
resultObj.forEach(processResult);
if(failedSongs.length > 0) {
this.get('notify').alert({html: this.get('notStreamableHtml')(failedSongs)});
}
} else {
processResult(resultObj);
}
@ -101,51 +106,52 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
this.changePlayerControl('playerBottomDisplayed', !this.get('playerBottomDisplayed'));
},
goToSong(index, playSong){
var dancer = this.get('dancer'), audio = new Audio();
audio.src = this.get('playQueue')[index].url;
audio.crossOrigin = "anonymous";
audio.oncanplay = ()=>{
this.set('timeTotal', Math.floor(audio.duration));
};
audio.onerror = ()=>{
var playQueuePointer =this.get('playQueuePointer'),
song = this.get('playQueue')[playQueuePointer];
this.send('next');
this.send('removeAudio', playQueuePointer);
this.get('notify').alert({html: this.get('failedToPlayFileHtml')(song.fileName)});
};
audio.ontimeupdate = ()=>{
this.set('timeElapsed', Math.floor(audio.currentTime));
};
audio.onended = ()=> {
this.send('next');
};
var dancer = this.get('dancer'), playQueue = this.get('playQueue');
if(dancer.audio) {
this.clearCurrentAudio(true);
}
dancer.load(audio);
this.setProperties({
playQueuePointer: index,
timeElapsed: 0
});
if(!Em.isNone(playQueue[index])) {
var audio = new Audio();
audio.src = this.get('playQueue')[index].url;
this.loadSongBeatPreferences();
audio.crossOrigin = "anonymous";
audio.oncanplay = ()=>{
this.set('timeTotal', Math.floor(audio.duration));
};
audio.onerror = ()=>{
var playQueuePointer =this.get('playQueuePointer'),
song = this.get('playQueue')[playQueuePointer];
if(playSong){
this.send('play');
this.send('removeAudio', playQueuePointer);
this.get('notify').alert({html: this.get('failedToPlayFileHtml')(song.fileName)});
};
audio.ontimeupdate = ()=>{
this.set('timeElapsed', Math.floor(audio.currentTime));
};
audio.onended = ()=> {
this.send('next');
};
dancer.load(audio);
this.set('playQueuePointer', index);
this.loadSongBeatPreferences();
if(playSong){
this.send('play');
}
}
},
removeAudio(index){
if(index === this.get('playQueuePointer')) {
this.clearCurrentAudio();
}
this.get('playQueue').removeAt(index);
if(index === this.get('playQueuePointer')) {
this.send('goToSong', index, true);
}
},
defaultControls(){
var beatOptions = this.get('beatOptions');
@ -209,8 +215,10 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
}
},
next(userTriggered) {
var playQueuePointer = this.get('playQueuePointer'), playQueueLength = this.get('playQueue.length');
var nextSong = (playQueuePointer + 1), repeat = this.get('repeat');
var playQueuePointer = this.get('playQueuePointer'),
playQueueLength = this.get('playQueue.length'),
nextSong = (playQueuePointer + 1),
repeat = this.get('repeat');
this.get('beatHistory').clear();
@ -251,7 +259,6 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
if(dancer.audio){
var audioPosition = Math.floor(this.get('timeTotal') * position / 100);
dancer.audio.currentTime = audioPosition;
this.set('timeElapsed', audioPosition);
}
},
volumeMutedChanged(value) {

View file

@ -96,8 +96,10 @@ export default Em.Mixin.create({
SC_CLIENT_ID: 'aeec0034f58ecd85c2bd1deaecc41594',
notFoundHtml: '<div class="alert alert-danger" role="alert">A microphone was not found.</div>',
scUserNotSupportedHtml: '<div class="alert alert-danger" role="alert">SoundCloud user URLs are not supported.</div>',
notStreamableHtml: function(fileName){
return '<div class="alert alert-danger" role="alert">The owner of the file ( ' + fileName +' ) has not allowed for the the file to be streamed.</div>';
notStreamableHtml: function(fileNames){
var html = '<div class="alert alert-danger" role="alert">The following file(s) could not be added because they are not allowed to be streamed:<br>' + fileNames.toString().replace(/,/g, '<br>') + '</div>';
return html;
},
urlNotFoundHtml: function(url){
return '<div class="alert alert-danger" role="alert">The URL ( ' + url + ' ) could not be resolved.</div>';

View file

@ -76,7 +76,7 @@
<div class="songInfo">
{{#if item.title}}
<p>{{item.title}}</p>
<div class="songTitle">{{item.title}}</div>
<div class="songArtist">
{{#if item.artistUrl}}
<a href="#" {{action "gotoURL" item.artistUrl bubbles=false}}>{{item.artist}}</a>
@ -108,9 +108,9 @@
<div id="playerBottom" class="row antiDimmer {{if dimmerOn "dimmerFriendly"}}">
<div id="beatArea" class="col-sm-7 col-xs-12">
{{#if usingBeatPreferences}}
<div data-toggle="tooltip" data-placement="bottom auto" data-title="Using your saved beat preferences from the last time you listened to this song" container="body" class="bootstrapTooltip">
<span data-toggle="tooltip" data-placement="bottom auto" data-title="Using your saved beat preferences from the last time you listened to this song" class="bootstrapTooltip savedStarTooltip">
{{paper-icon id="saveBeatPreferencesStar" icon="star"}}
</div>
</span>
{{/if}}
<div class="row">

View file

@ -22,6 +22,15 @@ body {
position: static;
}
// temporary HAX...not working in FF
md-progress-circular[md-mode=indeterminate] .md-spinner-wrapper {
transform: none !important;
}
.alert {
margin-bottom: 0;
}
.relative {
position: relative;
}
@ -649,14 +658,20 @@ md-switch.md-default-theme.md-checked .md-thumb {
right: 10px;
font-size: 18px;
}
p {
margin: 0;
}
.albumArt {
height: 60px;
float: left;
margin-right: 5px;
}
.songInfo {
display: inline-block;
.songTitle {
max-height: 40px;
overflow: hidden;
}
.songArtist {
max-height: 20px;
overflow: hidden;
}
}
}
@ -675,21 +690,28 @@ md-switch.md-default-theme.md-checked .md-thumb {
height: $playerBottomHeight;
position: relative;
padding: 20px 0 0 0;
* {
.noUi-target {
margin: 0 auto;
}
.noUi-base, .noUi-background {
background-color: #ADADAD;
border: 1px solid #797979;
}
.noUi-vertical {
height: 170px;
margin-top: 15px;
margin-bottom: 15px;
}
}
}
#beatArea * .noUi-target {
margin: 0 auto;
.star {
cursor: auto !important;
}
#beatArea * .noUi-base, #beatArea * .noUi-background {
background-color: #ADADAD;
border: 1px solid #797979;
}
#beatArea * .noUi-vertical {
height: 170px;
margin-top: 15px;
margin-bottom: 15px;
.savedStarTooltip + .tooltip .tooltip-arrow {
margin-left: 8px;
}
#beatOptionButtonGroup {
@ -980,7 +1002,7 @@ $vibrateblurouter: 2px;
top: 0;
left: 0;
color: #F12B24 !important;
font-size: 35px;
font-size: 25px;
}
button.md-warn {