From 882c027ffaaa177a704b08a59e84c297bb265484 Mon Sep 17 00:00:00 2001 From: gnehs Date: Wed, 8 Aug 2018 17:31:02 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=AD=8C=E8=A9=9E=20UI=20=E5=84=AA?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/style.css | 2 +- js/script.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/css/style.css b/css/style.css index c938edd9..f74da03f 100644 --- a/css/style.css +++ b/css/style.css @@ -532,7 +532,7 @@ header.mdui-appbar.mdui-appbar-fixed { } [data-lrc] p.mdui-text-color-theme-accent, -[data-lrc] p.mdui-text-color-theme-accent+p { +[data-lrc] p.mdui-text-color-theme-accent:not(:empty)+p { opacity: 1; } diff --git a/js/script.js b/js/script.js index 384d5f9b..d0a50d5b 100644 --- a/js/script.js +++ b/js/script.js @@ -674,7 +674,7 @@ function show_lrc() { if (before != after && nowLrc > -1) { $('#content>div[data-lrc]>div[data-lrc="inner"] p').removeClass('mdui-text-color-theme-accent') $('#content>div[data-lrc]>div[data-lrc="inner"] p').eq(nowLrc).addClass('mdui-text-color-theme-accent') - let top = $('div[data-lrc="inner"] p.mdui-text-color-theme-accent')[0].offsetTop - $('div[data-lrc]').height() / 2 - $('div[data-lrc="inner"] p.mdui-text-color-theme-accent')[0].clientHeight + let top = $('div[data-lrc="inner"] p.mdui-text-color-theme-accent')[0].offsetTop - $('div[data-lrc]').height() / 2 - $('div[data-lrc="inner"] p.mdui-text-color-theme-accent')[0].clientHeight * 2 $('#content>div[data-lrc]').animate({ scrollTop: top }, 300); } }); From aa01a0c45259b277f233918fda18e2207973ac0a Mon Sep 17 00:00:00 2001 From: gnehs Date: Wed, 8 Aug 2018 17:33:24 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=AE=80=E5=8F=96=E6=A3=92=E6=A3=92?= =?UTF-8?q?=E5=8B=95=E7=95=AB=E5=84=AA=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/style.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index f74da03f..ad68ea61 100644 --- a/css/style.css +++ b/css/style.css @@ -519,10 +519,14 @@ header.mdui-appbar.mdui-appbar-fixed { transform: scaleX(0); opacity: 0; } - 100% { + 90% { transform: scaleX(1); opacity: 1; } + 100% { + transform: scaleX(1); + opacity: 0; + } } [data-lrc] p { From 03c056f1b1e90f671ebe87813744d5c7e5215305 Mon Sep 17 00:00:00 2001 From: gnehs Date: Wed, 8 Aug 2018 17:48:52 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=AD=8C=E8=A9=9E=E5=9C=A8=E5=88=87?= =?UTF-8?q?=E6=8F=9B=E9=A0=81=E9=9D=A2=E6=99=82=E4=B8=8D=E6=9C=83=E8=87=AA?= =?UTF-8?q?=E5=8B=95=E6=8D=B2=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/style.css | 2 +- js/script.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index ad68ea61..336d84f7 100644 --- a/css/style.css +++ b/css/style.css @@ -448,7 +448,7 @@ header.mdui-appbar.mdui-appbar-fixed { font-size: calc(8px + 1vmin); } [data-player]>.info>[data-lrc]>[data-lrc="inner"] { - padding: 80px 0; + padding: 20px 0; } } diff --git a/js/script.js b/js/script.js index d0a50d5b..b0c41388 100644 --- a/js/script.js +++ b/js/script.js @@ -569,6 +569,12 @@ async function show_now() { html += `

${text}

` } $('div[data-lrc="inner"]').html(html) + let nowLrc = lrc.select(ap.audio.currentTime) + if (nowLrc > -1) { + $('[data-player] div[data-lrc="inner"] p').eq(nowLrc).addClass('mdui-text-color-theme-accent') + let sh = $('div[data-lrc="inner"] p.mdui-text-color-theme-accent')[0].offsetTop - $('[data-player] .info>div[data-lrc]').height() / 2 - $('div[data-lrc="inner"] p.mdui-text-color-theme-accent')[0].clientHeight + $('[data-player] .info>div[data-lrc]').scrollTop(sh); + } } ap.on("pause", function() { @@ -665,6 +671,12 @@ function show_lrc() { html += `

${text}

` } $("#content>div[data-lrc]>[data-lrc=\"inner\"]").html(html) + let nowLrc = lrc.select(ap.audio.currentTime) + if (nowLrc > -1) { + $('#content>div[data-lrc]>div[data-lrc="inner"] p').eq(nowLrc).addClass('mdui-text-color-theme-accent') + let top = $('div[data-lrc="inner"] p.mdui-text-color-theme-accent')[0].offsetTop - $('div[data-lrc]').height() / 2 - $('div[data-lrc="inner"] p.mdui-text-color-theme-accent')[0].clientHeight * 2 + $('#content>div[data-lrc]').animate({ scrollTop: top }, 0); + } } ap.on("timeupdate", function() { // 歌詞亮亮 From 71ddfeec6443a50403d1751c494f3c051b910b24 Mon Sep 17 00:00:00 2001 From: gnehs Date: Wed, 8 Aug 2018 18:00:41 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=AD=8C=E8=A9=9E?= =?UTF-8?q?=E4=B8=8D=E6=9C=83=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/script.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/script.js b/js/script.js index b0c41388..a1b8355a 100644 --- a/js/script.js +++ b/js/script.js @@ -10,6 +10,7 @@ ap.on("play", async function() { //沒歌就隨機播放 if (ap.list.audios.length == 0) play_random(); updateMediaSession() + lrc.load(`[00:00.000]歌詞讀取中`) // 歌詞清空 }) ap.on("loadedmetadata", async function() { lrc.load(`[00:00.000]歌詞讀取中`) From 0cdaf36b1000d98f9b3b7bf1692dc5404562e788 Mon Sep 17 00:00:00 2001 From: gnehs Date: Wed, 8 Aug 2018 18:02:21 +0800 Subject: [PATCH 5/5] 0.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cfc07cde..46ec5273 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pokaplayer", - "version": "0.4.0", + "version": "0.4.1", "description": "", "main": "index.js", "scripts": {