Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Meekdai/Gmemp
Browse files Browse the repository at this point in the history
  • Loading branch information
Meekdai committed May 24, 2024
2 parents 42243de + 9b13aee commit 04928d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="description" content="Meekdai music player page with journal">
<link rel="icon" href="https://meekdai.com/favicon.svg">
<meta property="og:title" content="Gmemp">
<meta property="og:description" content="Meekdai music player page with journal">
<meta property="og:type" content="article">
<meta property="og:url" content="https://music.meekdai.com/">
<meta property="og:image" content="" />

<link rel="icon" href="https://static.meekdai.com/favicon.svg">
<title>Gmemp</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Meekdai/Gmemp@v3.1/docs/player.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Meekdai/Gmemp@v3.2/docs/player.css">
<!-- <link rel="stylesheet" href="./player.css"> -->
</head>
<body>
Expand Down Expand Up @@ -47,7 +53,7 @@
</div>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/howler.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/Meekdai/Gmemp@v3.1/docs/player.js"></script>
<script src="https://cdn.jsdelivr.net/gh/Meekdai/Gmemp@v3.2/docs/player.js"></script>
<!-- <script src="./player.js"></script> -->
</body>
</html>
6 changes: 6 additions & 0 deletions docs/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<p><b>'+playlist[this.index].date+'</b></p>' + 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) {
Expand Down Expand Up @@ -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'

Expand Down

0 comments on commit 04928d8

Please sign in to comment.