1
Fork 0

Add compact audio preview

This commit is contained in:
Jake Howard 2017-11-10 22:26:53 +00:00
parent e86d39d8d8
commit 136aff6efc
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 19 additions and 6 deletions

View file

@ -13,25 +13,25 @@
<caption><a href="{{ $playlist.url }}">View playlist on Spotify</a></caption> <caption><a href="{{ $playlist.url }}">View playlist on Spotify</a></caption>
<thead> <thead>
<tr> <tr>
<th scope="row"></th>
<th scope="row">Track</th> <th scope="row">Track</th>
<th scope="row">Artist</th> <th scope="row">Artist</th>
<th scope="row">Album</th> <th scope="row">Album</th>
<th scope="row"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{ range sort $playlist.tracks "name" }} {{ range sort $playlist.tracks "name" }}
<tr> <tr>
<td>
<span>
<a class="icon" href="{{ .preview_url }}"><i class="fa fa-play"></i></a>
</span>
</td>
<td><a href="{{ .url }}">{{ .name }}</a></td> <td><a href="{{ .url }}">{{ .name }}</a></td>
<td> <td>
{{ range $i, $e := .artists }}{{ if $i }}, {{ end }}{{ .name }}{{ end }} {{ range $i, $e := .artists }}{{ if $i }}, {{ end }}{{ .name }}{{ end }}
</td> </td>
<td>{{ .album.name }}</td> <td>{{ .album.name }}</td>
<td>
<audio controls class="mejs__player">
<source src="{{ .preview_url }}" type="audio/mpeg">
</audio>
</td>
</tr> </tr>
{{ end }} {{ end }}
</tbody> </tbody>

View file

@ -23,6 +23,7 @@
"jquery": "3.2.1", "jquery": "3.2.1",
"lg-thumbnail": "1.0.3", "lg-thumbnail": "1.0.3",
"lightgallery": "1.4.0", "lightgallery": "1.4.0",
"plyr": "2.0.17",
"tstatic": "1.1.0" "tstatic": "1.1.0"
} }
} }

View file

@ -6,6 +6,13 @@ require('bootstrap');
require('lightgallery/dist/js/lightgallery'); require('lightgallery/dist/js/lightgallery');
require('lg-thumbnail/dist/lg-thumbnail'); require('lg-thumbnail/dist/lg-thumbnail');
require('plyr').setup({
controls: [
'play',
'progress'
]
});
$('.image').each(function () { // setup div-image hybrids $('.image').each(function () { // setup div-image hybrids
var ele = $(this); var ele = $(this);

View file

@ -5,6 +5,7 @@ $fa-font-path: "../fonts";
@import "node_modules/lightgallery/src/sass/lightgallery"; @import "node_modules/lightgallery/src/sass/lightgallery";
@import "node_modules/bootstrap/scss/bootstrap"; @import "node_modules/bootstrap/scss/bootstrap";
@import "node_modules/plyr/src/scss/plyr";
$primary: #E89980; $primary: #E89980;
$orange: #FF7F00; $orange: #FF7F00;
@ -168,3 +169,7 @@ pre.chroma {
margin-top: $spacer; margin-top: $spacer;
} }
} }
.plyr {
min-width: initial;
}