sakrecoer-mother-web/_layouts/music.html

87 lines
2.7 KiB
HTML
Raw Normal View History

2019-04-28 18:56:03 +02:00
---
layout: default
---
<div id="player">
2019-07-09 19:04:46 +02:00
<div id="info" style="background-image:url('{{ site.audio_url }}{{ page.image }}');">
<div id="controls">
<div class="container">
2019-07-09 22:17:29 +02:00
<button id="mu_pause">Play</button><br />
{% if page.previous != nil %}
<a href="{{ site.baseurl }}{{ page.previous.url }}" title="Previous Track"><img
src="{{ site.baseurl }}/assets/img/icons/skiprwd.png" title="Previous Track" /></a>
{% endif %}
<a id="download" title="Download This Track!" href="{{ site.audio_url }}{{ page.mp3 }}"><img
src="{{ site.baseurl }}/assets/img/icons/dl.png" title="Download Track" /></a>
{% if page.next != nil %}
<a href="{{ site.baseurl }}{{ page.next.url }}" title="Next Track"><img
src="{{ site.baseurl }}/assets/img/icons/skipfwd.png" title="Next Track" /></a>{% endif %}
2019-07-09 19:49:14 +02:00
</div>
2019-05-03 16:49:20 +02:00
</div>
2019-07-09 19:04:46 +02:00
</div>
2019-07-09 22:17:29 +02:00
<div class="trackcontainer">
2019-07-09 22:17:29 +02:00
<h1>{{ page.title }}</h1>
<h2 id="tracktime">&nbsp;</h2>
</div>
2019-07-09 19:04:46 +02:00
<div id="timer">
{{ page.content }}
2019-07-09 19:49:14 +02:00
<img src="{{ site.audio_url }}{{ page.image }}" style="width:100%;" />
2019-07-09 19:04:46 +02:00
</div>
<!-- stylemachine by Sakrecoer -snipthis if ya feel it - its the pary that runs the player ;) -->
</div>
2019-04-28 19:26:34 +02:00
<audio preload="true"
ontimeupdate="document.getElementById('tracktime').innerHTML = Math.floor(this.currentTime) + ' / ' + Math.floor(this.duration);">
<source src="{{ site.audio_url }}{{ page.mp3 }}" type="audio/mpeg" />
<source src="{{ site.audio_url }}{{ page.ogg }}" type="audio/ogg" />
<h1>Your browser isn't ready for so much hotness. Use the download-link instead.</h1>.
</audio>
<script type="text/javascript">
2019-04-28 18:56:03 +02:00
function loadUrl(newLocation) {
window.location = newLocation;
return false;
}
var mu = document.getElementsByTagName("audio")[0];
var pauseButton = document.getElementById("mu_pause");
function muFade() {
mu.classList.add("stopfade");
}
mu.addEventListener('ended', function () {
// only functional if "loop" is removed
mu.pause();
mu.currentTime = 0;
{% if page.next_in_category != nil %}
2019-04-28 19:33:43 +02:00
loadUrl('{{ site.baseurl }}{{ page.next_in_category.url }}'); return false;
{% endif %}
2019-04-28 18:56:03 +02:00
// qq IE10
muFade();
});
pauseButton.addEventListener("click", function () {
mu.classList.toggle("stopfade");
if (mu.paused) {
mu.play();
2019-04-28 19:33:43 +02:00
pauseButton.innerHTML = "Pause";
2019-04-28 18:56:03 +02:00
} else {
mu.pause();
2019-04-28 19:33:43 +02:00
pauseButton.innerHTML = "Resume";
2019-04-28 18:56:03 +02:00
}
});
</script>
<style type="text/css">
2019-05-03 17:06:32 +02:00
body {
2019-05-03 16:49:20 +02:00
background-image:url('{{ site.audio_url }}{{ page.image }}') ;
2019-05-03 17:06:32 +02:00
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
background-color: #0ff;
2019-04-28 18:56:03 +02:00
}
2019-07-09 19:49:14 +02:00
</style>