playlist = $(as[i].element).parent().next('.audio-playlist');
+ as[i].title = $('<div class="title"></div>');
+ $(as[i].wrapper).append(as[i].title);
+
//
// Future refs
//
//
var first = playlist.find('li a').attr('data-src');
playlist.find('li').first().addClass('playing');
+ that.setTitle(as[i], playlist.find('li a').text());
as[i].load(first);
playlist.find('li').bind('click', function(e) {
$(this).addClass('playing').siblings().removeClass('playing');
that.audios[idx].load($('a', this).attr('data-src'));
that.audios[idx].play();
+ that.setTitle(that.audios[idx], $('a', this).text());
});
};
+Audio.prototype.setTitle = function(audio, title) {
+
+ var split = title.split(",");
+ var html = '';
+
+ if(split[0]) {
+ html += split[0];
+ }
+ if(split[1]) {
+ html += '<br/><span>'+split[1]+'</span>'
+ }
+
+ audio.title.html(html);
+
+};
+
module.exports = Audio;
}
}
- @include margin(1);
+ @include margin(0 .5 0 0);
}
}
}
- @include margin(1);
+ @include margin(0 .5 0 0);
}
}
}
- @include margin(1);
+ @include margin(0 .5 0 0);
}
}
}
- @include margin(1);
+ @include margin(0 .5 0 0);
}
}
}
- @include margin(1);
+ @include margin(0 .5 0 0);
}
}
}
- @include margin(1);
+ @include margin(0 .5 0 0);
}
}
}
- @include margin(1);
+ @include margin(0 .5 0 0);
}
}
}
- @include margin(1);
+ @include margin(0 .5 0 0);
}
}
}
- @include margin(1);
+ @include margin(0 .5 0 0);
}
.audiojs {
- background: $color-black;
+ background: white;
+ position: relative;
box-shadow: none;
width: 100%;
+ height: 123px;
+ border: 1px solid #E6E6E6;
.play-pause {
- width: 37px;
+ position: absolute;
+ width: 56px;
+ height: 56px;
+ border-right: 0;
+ top: 30px;
+ left: 30px;
+ border-radius: 56px;
+ background: $color-black;
+ padding: 0;
}
.scrubber {
- width: calc(80% - 37px);
+ width: 100%;
+ height: 7px;
+ margin: 0;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ background: #EBEBEB;
+ border: 0;
+ }
+
+ .title {
+
+ position: absolute;
+ height: 56px;
+ left: 116px;
+ top: 30px;
+
+ @include font-size(m);
+ @include typeface(serif);
+ font-weight: weight(bold);
+
+ span {
+ @include font-size(m);
+ @include typeface(serif);
+ font-weight: weight(regular);
+ font-style: italic;
+ }
+
}
.time {
- width: calc(20% - 37px);
+ position: absolute;
+ bottom: 10px;
+ right: 10px;
+
@include font-size(xs);
- @include typeface(sans-serif);
+ @include typeface(serif);
+ font-weight: weight(light);
+
+ text-shadow: none;
+ color: $color-black;
+
+ border: 0;
+
+ .played {
+ color: $color-black;
+ }
}
.progress {
- background: $color-main;
+ background: $color-black;
}
.loaded {
- background: $color-gray;
+ background: #EBEBEB;
}
- @include mq($until: xs) {
- width: 100%;
- .scrubber {
- width: calc(60% - 37px);
+
+ .play {
+
+ width: 56px;
+ height: 56px;
+ position: relative;
+ background: 0;
+
+ &:after {
+ position: absolute;
+ top: 0;
+ left: 3px;
+ width: 100%;
+ height: 100%;
+ content: "\f04b";
+ font-family: FontAwesome;
+ color: white;
+ font-size: 30px;
+ display: block;
+ text-align: center;
+ line-height: 56px;
}
- .time {
- width: calc(40% - 37px);
+
+ }
+
+ .pause {
+
+ width: 56px;
+ height: 56px;
+ position: relative;
+ background: 0;
+
+ &:after {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ content: "\f04c";
+ font-family: FontAwesome;
+ color: white;
+ font-size: 30px;
+ display: block;
+ text-align: center;
+ line-height: 56px;
}
+
}
+
+ .loading {
+
+ width: 56px;
+ height: 56px;
+ position: relative;
+ background: 0;
+
+ &:after {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ content: "\f110";
+ font-family: FontAwesome;
+ color: white;
+ font-size: 30px;
+ display: block;
+ text-align: center;
+ line-height: 56px;
+ }
+
+ }
+
}
{% for audio in audios %}
<li class="audio-playlist__item">
- <a href="#" data-src="{{ audio.open_source_url }}">{{ audio.title }}</a>
+ <a href="#" data-src="{{ audio.open_source_url }}">{{ audio.title }} 1</a>
+ </li>
+ <li class="audio-playlist__item">
+ <a href="#" data-src="{{ audio.open_source_url }}">{{ audio.title }} 2</a>
+ </li>
+ <li class="audio-playlist__item">
+ <a href="#" data-src="{{ audio.open_source_url }}">{{ audio.title }} 3</a>
</li>
{% comment %}