From 48d6feba39d459aca0af12fb0cadcc64ba9d3a9f Mon Sep 17 00:00:00 2001 From: ArthurBeaulieu Date: Thu, 3 Mar 2022 14:48:07 +0100 Subject: [PATCH] url fix for gh page --- assets/dist/BW.bundle.js | 2 +- assets/html/seemoremodal.html | 10 +++---- index.html | 44 ++++++++++++++--------------- listen.html | 52 +++++++++++++++++------------------ src/bw.js | 22 +++++++-------- tree.html | 40 +++++++++++++-------------- 6 files changed, 85 insertions(+), 85 deletions(-) diff --git a/assets/dist/BW.bundle.js b/assets/dist/BW.bundle.js index ad8dbda..84c3332 100644 --- a/assets/dist/BW.bundle.js +++ b/assets/dist/BW.bundle.js @@ -1 +1 @@ -!function(){"use strict";var e={};function t(e,t){for(var n=0;n type. Should be either index, listen or tree")),t()}))}},{key:"_buildIndexPage",value:function(){document.querySelector("#band-name").innerHTML=this._nls.band.name,document.querySelector("#band-desc").innerHTML=this._nls.band.desc,document.querySelector("#listen-link").innerHTML=this._nls.listenLink,document.querySelector("#tree-link").innerHTML=this._nls.treeLink}},{key:"_buildListenPage",value:function(){var e=this;document.querySelector("#release-from").innerHTML=this._nls.from,document.querySelector("#listen-online").innerHTML=this._nls.listenOnline,document.querySelector("#see-more-links").innerHTML=this._nls.seeMore,document.querySelector("#published-on").innerHTML=this._nls.publishedOn;var t=document.getElementById("current-progress"),n=document.getElementById("modal-overlay"),r=new Audio,s=0,l=function(){r.pause(),r.currentTime=0,t.style.width="0";var n=e._nls.band.releases[s];document.getElementById("release-background").style.backgroundImage="url('/assets/img/releases/".concat(n.cover,"')"),document.getElementById("release-background-bottom").style.backgroundImage="url('/assets/img/releases/".concat(n.cover,"')"),document.getElementById("release-cover").src="/assets/img/releases/".concat(n.cover),document.getElementById("release-duration").innerHTML=n.duration,document.getElementById("release-title").innerHTML=n.title,document.getElementById("release-artist").innerHTML=n.artist,document.getElementById("release-date").innerHTML=n.date,document.getElementById("label-link").innerHTML=n.label,document.getElementById("label-link").href=n.labelLink;for(var l=0;ldocument.getElementById("release-tracklist").clientHeight&&(document.getElementById("release-tracklist").style.display="inherit",new window.ScrollBar({target:document.getElementById("release-tracklist")})),r=new Audio("/assets/audio/".concat(n.audio)),i(r)},i=function(){var e=document.getElementById("play-pause");e.src="/assets/img/controls/play.svg";var t=document.getElementById("progress-bar"),n=document.getElementById("current-progress"),s=!1;e.addEventListener("click",(function(){!0===s?(s=!1,e.src="/assets/img/controls/play.svg",r.pause()):(s=!0,e.src="/assets/img/controls/pause.svg",r.play())})),r.addEventListener("timeupdate",(function(){n.style.width="".concat(r.currentTime/r.duration*100,"%")})),r.addEventListener("ended",(function(){r.currentTime=0,n.style.width="0",e.src="/assets/img/controls/play.svg",s=!1})),t.addEventListener("click",(function(e){if(!0===s){var l=t.getBoundingClientRect();r.currentTime=(e.clientX-l.left)/l.width*r.duration,n.style.width="".concat(r.currentTime/r.duration*100,"%")}}))};1===this._nls.band.releases.length?(document.getElementById("release-previous").style.display="none",document.getElementById("release-next").style.display="none"):(document.getElementById("release-previous").addEventListener("click",(function(t){t.target.blur(),s=(e._nls.band.releases.length+s-1)%e._nls.band.releases.length,l()})),document.getElementById("release-next").addEventListener("click",(function(t){t.target.blur(),s=(s+1)%e._nls.band.releases.length,l()}))),document.getElementById("modal-overlay").addEventListener("click",(function(){n.style.opacity=0,setTimeout((function(){n.innerHTML="",n.style.display="none"}),400)})),document.getElementById("see-more-links").addEventListener("click",(function(){fetch("/assets/html/seemoremodal.html").then((function(t){n.style.display="flex",t.text().then((function(t){n.appendChild(document.createRange().createContextualFragment(t));for(var r=e._nls.band.releases[s],l=0;l\n \n

').concat(this._nls.band.links[e].name,"

\n \n ");new window.ScrollBar({target:document.getElementById("link-wrapper")})}},{key:"_buildTrackCredits",value:function(e){for(var t="",n=0;n".concat(n+1,". ").concat(e[n].title," – ").concat(e[n].duration,"

"),""!==e[n].composer&&(t+="".concat(this._nls.composer," : ").concat(e[n].composer,"
")),""!==e[n].author&&(t+="".concat(this._nls.author," : ").concat(e[n].author)),t+="

";return t}}])&&t(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();e.default=n,window.BW=e.default}(); \ No newline at end of file +!function(){"use strict";var e={};function t(e,t){for(var n=0;n type. Should be either index, listen or tree")),t()}))}},{key:"_buildIndexPage",value:function(){document.querySelector("#band-name").innerHTML=this._nls.band.name,document.querySelector("#band-desc").innerHTML=this._nls.band.desc,document.querySelector("#listen-link").innerHTML=this._nls.listenLink,document.querySelector("#tree-link").innerHTML=this._nls.treeLink}},{key:"_buildListenPage",value:function(){var e=this;document.querySelector("#release-from").innerHTML=this._nls.from,document.querySelector("#listen-online").innerHTML=this._nls.listenOnline,document.querySelector("#see-more-links").innerHTML=this._nls.seeMore,document.querySelector("#published-on").innerHTML=this._nls.publishedOn;var t=document.getElementById("current-progress"),n=document.getElementById("modal-overlay"),r=new Audio,s=0,l=function(){r.pause(),r.currentTime=0,t.style.width="0";var n=e._nls.band.releases[s];document.getElementById("release-background").style.backgroundImage="url('assets/img/releases/".concat(n.cover,"')"),document.getElementById("release-background-bottom").style.backgroundImage="url('assets/img/releases/".concat(n.cover,"')"),document.getElementById("release-cover").src="assets/img/releases/".concat(n.cover),document.getElementById("release-duration").innerHTML=n.duration,document.getElementById("release-title").innerHTML=n.title,document.getElementById("release-artist").innerHTML=n.artist,document.getElementById("release-date").innerHTML=n.date,document.getElementById("label-link").innerHTML=n.label,document.getElementById("label-link").href=n.labelLink;for(var l=0;ldocument.getElementById("release-tracklist").clientHeight&&(document.getElementById("release-tracklist").style.display="inherit",new window.ScrollBar({target:document.getElementById("release-tracklist")})),r=new Audio("assets/audio/".concat(n.audio)),i(r)},i=function(){var e=document.getElementById("play-pause");e.src="assets/img/controls/play.svg";var t=document.getElementById("progress-bar"),n=document.getElementById("current-progress"),s=!1;e.addEventListener("click",(function(){!0===s?(s=!1,e.src="assets/img/controls/play.svg",r.pause()):(s=!0,e.src="assets/img/controls/pause.svg",r.play())})),r.addEventListener("timeupdate",(function(){n.style.width="".concat(r.currentTime/r.duration*100,"%")})),r.addEventListener("ended",(function(){r.currentTime=0,n.style.width="0",e.src="assets/img/controls/play.svg",s=!1})),t.addEventListener("click",(function(e){if(!0===s){var l=t.getBoundingClientRect();r.currentTime=(e.clientX-l.left)/l.width*r.duration,n.style.width="".concat(r.currentTime/r.duration*100,"%")}}))};1===this._nls.band.releases.length?(document.getElementById("release-previous").style.display="none",document.getElementById("release-next").style.display="none"):(document.getElementById("release-previous").addEventListener("click",(function(t){t.target.blur(),s=(e._nls.band.releases.length+s-1)%e._nls.band.releases.length,l()})),document.getElementById("release-next").addEventListener("click",(function(t){t.target.blur(),s=(s+1)%e._nls.band.releases.length,l()}))),document.getElementById("modal-overlay").addEventListener("click",(function(){n.style.opacity=0,setTimeout((function(){n.innerHTML="",n.style.display="none"}),400)})),document.getElementById("see-more-links").addEventListener("click",(function(){fetch("assets/html/seemoremodal.html").then((function(t){n.style.display="flex",t.text().then((function(t){n.appendChild(document.createRange().createContextualFragment(t));for(var r=e._nls.band.releases[s],l=0;l\n \n

').concat(this._nls.band.links[e].name,"

\n \n ");new window.ScrollBar({target:document.getElementById("link-wrapper")})}},{key:"_buildTrackCredits",value:function(e){for(var t="",n=0;n".concat(n+1,". ").concat(e[n].title," – ").concat(e[n].duration,"

"),""!==e[n].composer&&(t+="".concat(this._nls.composer," : ").concat(e[n].composer,"
")),""!==e[n].author&&(t+="".concat(this._nls.author," : ").concat(e[n].author)),t+="

";return t}}])&&t(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();e.default=n,window.BW=e.default}(); \ No newline at end of file diff --git a/assets/html/seemoremodal.html b/assets/html/seemoremodal.html index 9080dcb..ed9e86a 100644 --- a/assets/html/seemoremodal.html +++ b/assets/html/seemoremodal.html @@ -1,22 +1,22 @@ diff --git a/index.html b/index.html index c6d2829..5ec2cd2 100644 --- a/index.html +++ b/index.html @@ -8,29 +8,29 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + @@ -39,20 +39,20 @@ - +
- band-logo + band-logo

- - + +
- + diff --git a/listen.html b/listen.html index ec3fbad..7733358 100644 --- a/listen.html +++ b/listen.html @@ -9,29 +9,29 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + @@ -40,7 +40,7 @@ - +
@@ -50,7 +50,7 @@
- + diff --git a/src/bw.js b/src/bw.js index 49cb8f5..91a709c 100644 --- a/src/bw.js +++ b/src/bw.js @@ -28,7 +28,7 @@ class BW { _fetchLang() { if (DEBUG === true) { console.log(`1. Fetch language keys with ${this._lang} locale`); } return new Promise((resolve, reject) => { - fetch(`/assets/json/${this._lang}.json`).then(data => { + fetch(`assets/json/${this._lang}.json`).then(data => { data.json().then(nlsKeys => { if (DEBUG === true) { console.log(`2. Language keys successfully retrieven`); } this._nls = nlsKeys; @@ -93,10 +93,10 @@ class BW { // Update active release const release = this._nls.band.releases[activeRelease]; // Update blurred backgrounds - document.getElementById('release-background').style.backgroundImage = `url('/assets/img/releases/${release.cover}')`; - document.getElementById('release-background-bottom').style.backgroundImage = `url('/assets/img/releases/${release.cover}')`; + document.getElementById('release-background').style.backgroundImage = `url('assets/img/releases/${release.cover}')`; + document.getElementById('release-background-bottom').style.backgroundImage = `url('assets/img/releases/${release.cover}')`; // Update release primitive information - document.getElementById('release-cover').src = `/assets/img/releases/${release.cover}`; + document.getElementById('release-cover').src = `assets/img/releases/${release.cover}`; document.getElementById('release-duration').innerHTML = release.duration; document.getElementById('release-title').innerHTML = release.title; document.getElementById('release-artist').innerHTML = release.artist; @@ -121,13 +121,13 @@ class BW { target: document.getElementById('release-tracklist') }); } - audio = new Audio(`/assets/audio/${release.audio}`); + audio = new Audio(`assets/audio/${release.audio}`); handlePlayback(audio); }; // Handle the audio playback and events const handlePlayback = () => { const button = document.getElementById('play-pause'); - button.src = '/assets/img/controls/play.svg'; + button.src = 'assets/img/controls/play.svg'; const progressTrack = document.getElementById('progress-bar'); const progress = document.getElementById('current-progress'); let playing = false; @@ -135,11 +135,11 @@ class BW { button.addEventListener('click', () => { if (playing === true) { playing = false; - button.src = '/assets/img/controls/play.svg'; + button.src = 'assets/img/controls/play.svg'; audio.pause(); } else { playing = true; - button.src = '/assets/img/controls/pause.svg'; + button.src = 'assets/img/controls/pause.svg'; audio.play(); } }); @@ -151,7 +151,7 @@ class BW { audio.addEventListener('ended', () => { audio.currentTime = 0; progress.style.width = '0'; - button.src = '/assets/img/controls/play.svg'; + button.src = 'assets/img/controls/play.svg'; playing = false; }); // User manually seek a part of audio @@ -189,7 +189,7 @@ class BW { }); // Open modal event document.getElementById('see-more-links').addEventListener('click', () => { - fetch('/assets/html/seemoremodal.html').then(data => { + fetch('assets/html/seemoremodal.html').then(data => { overlay.style.display = 'flex'; data.text().then(htmlString => { overlay.appendChild(document.createRange().createContextualFragment(htmlString)); @@ -217,7 +217,7 @@ class BW { for (let i = 0; i < this._nls.band.links.length; ++i) { document.querySelector('#link-wrapper').innerHTML += ` - +

${this._nls.band.links[i].name}

`; diff --git a/tree.html b/tree.html index a3e3111..5005787 100644 --- a/tree.html +++ b/tree.html @@ -9,29 +9,29 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + @@ -40,17 +40,17 @@ - +
- +
- +