diff --git a/docs/index.html b/docs/index.html index 6030053..905b1f9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,9 +4,15 @@ - + + + + + + + Gmemp - + @@ -47,7 +53,7 @@ - + diff --git a/docs/player.js b/docs/player.js index 170a149..bd4450f 100644 --- a/docs/player.js +++ b/docs/player.js @@ -46,6 +46,7 @@ let Player = function(playlist) { artist.innerHTML = playlist[this.index].artist; document.querySelector("body").style.backgroundImage = "url('" +media+ encodeURI(playlist[this.index].pic) + "')"; post.innerHTML = '

'+playlist[this.index].date+'

' + playlist[this.index].article; + document.querySelector('meta[property="og:image"]').setAttribute('content', media+ encodeURI(playlist[this.index].pic)); // Setup the playlist display. playlist.forEach(function(song) { @@ -125,6 +126,11 @@ Player.prototype = { document.querySelector("body").style.backgroundImage = "url('" +media+ encodeURI(data.pic) + "')"; window.location.hash="#"+(index); + document.querySelector('meta[property="og:title"]').setAttribute('content', data.title); + document.querySelector('meta[property="og:description"]').setAttribute('content', data.article); + document.querySelector('meta[property="og:url"]').setAttribute('content', window.location.href); + document.querySelector('meta[property="og:image"]').setAttribute('content', media+ encodeURI(data.pic)); + //progressBar 垂直居中 progressBar.style.margin = -(window.innerHeight*0.3/2)+'px auto'