From f9eddcec1ce8712a7506dc5874d3829bad7ccb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Sun, 27 Jan 2019 00:32:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A1=8C=E9=9D=A2=E6=AD=8C?= =?UTF-8?q?=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/css/app.scss | 2 +- src/css/desktop-lrc.css | 2 +- src/css/desktop-lrc.scss | 3 ++- src/desktop-lrc.html | 9 +++++---- src/js/app.js | 2 ++ src/js/desktop-lrc.js | 18 +++++++++++++++--- 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/css/app.scss b/src/css/app.scss index e566daa..62d4c92 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -266,7 +266,7 @@ &:nth-child(6) {animation:play 1.5s linear infinite;} &:nth-child(7) {background-image:url(/images/load2.png);animation:load2 2.5s linear infinite;} } - cite {font-size:2.4rem} + cite {font-size:2.4rem;} } } diff --git a/src/css/desktop-lrc.css b/src/css/desktop-lrc.css index 5b4c7c6..543e0d9 100644 --- a/src/css/desktop-lrc.css +++ b/src/css/desktop-lrc.css @@ -1 +1 @@ -body{background:transparent}body .lrc-box{position:absolute;left:0;top:0;display:flex;flex-flow:column wrap;width:100%;height:100%;padding:0 5rem;line-height:5rem;color:#fff;font-size:3rem}body .lrc-box section{flex:1;display:flex}body .lrc-box section.left{justify-content:flex-start}body .lrc-box section.right{justify-content:flex-end}body .lrc-box section span{-webkit-background-clip:text !important;background-clip:text !important;color:transparent}body .lrc-box section span.shadow{text-shadow:0 0 0.5rem rgba(0,0,0,0.5)}body .touch-bar{position:absolute;left:0;top:0;z-index:9;width:100%;height:2rem}body .quit,body .lock{visibility:hidden;position:absolute;right:1rem;top:.5rem;font-size:1.8rem;font-weight:bold}body .quit:hover,body .lock:hover{color:#ff5061}body .lock{right:4rem}body .lock.active{color:#dae1e9}body:hover{background:rgba(29,35,44,0.2)}body:hover .quit,body:hover .lock{visibility:visible} +body{background:transparent}body .lrc-box{position:absolute;left:0;top:0;display:flex;flex-flow:column wrap;width:100%;height:100%;padding:0 5rem;line-height:5rem;color:#fff;font-size:3rem}body .lrc-box section{flex:1;display:flex}body .lrc-box section.left{justify-content:flex-start}body .lrc-box section.right{justify-content:flex-end}body .lrc-box section span{-webkit-background-clip:text !important;background-clip:text !important;color:transparent}body .lrc-box section span.shadow{text-shadow:0 0 0.5rem rgba(0,0,0,0.5)}body .touch-bar{position:absolute;left:0;top:0;z-index:9;width:100%;height:2rem}body .quit,body .lock{visibility:hidden;position:absolute;right:1rem;top:.5rem;font-size:1.8rem;font-weight:bold}body .quit:hover,body .lock:hover{color:#ff5061}body .quit:active,body .lock:active{color:#ffb618}body .lock{right:4rem}body .lock.active{color:#3fc2a7}body:hover{background:rgba(29,35,44,0.2)}body:hover .quit,body:hover .lock{visibility:visible} diff --git a/src/css/desktop-lrc.scss b/src/css/desktop-lrc.scss index dae0e9d..0bbd1d5 100644 --- a/src/css/desktop-lrc.scss +++ b/src/css/desktop-lrc.scss @@ -31,10 +31,11 @@ body {background:transparent; .quit, .lock {visibility:hidden;position:absolute;right:1rem;top:.5rem;font-size:1.8rem;font-weight:bold; &:hover {color:nth($cr, 1)} + &:active {color:nth($co, 1)} } .lock {right:4rem; - &.active {color:nth($cp, 3)} + &.active {color:nth($ct, 1)} } diff --git a/src/desktop-lrc.html b/src/desktop-lrc.html index 902e675..1da6d66 100644 --- a/src/desktop-lrc.html +++ b/src/desktop-lrc.html @@ -9,7 +9,7 @@ - +
@@ -27,9 +27,10 @@
-
- - + +
+ +
\ No newline at end of file diff --git a/src/js/app.js b/src/js/app.js index 51ce6cc..9eb0ab9 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -52,6 +52,8 @@ Anot.ss('app-init', appInit) const LRC_WIN = createDesktopLrcWindow(MAIN_SCREEN) const MINI_WIN = createMiniWindow(MAIN_SCREEN, WIN) +// LRC_WIN.showInactive() + Anot({ $id: 'app', state: { diff --git a/src/js/desktop-lrc.js b/src/js/desktop-lrc.js index 60cf85c..986478d 100644 --- a/src/js/desktop-lrc.js +++ b/src/js/desktop-lrc.js @@ -12,28 +12,40 @@ const { remote } = require('electron') const WIN = remote.getCurrentWindow() +const $doc = Anot(document) +const log = console.log + +window.WIN = WIN + Anot({ $id: 'lrc', state: { + isMac: process.platform === 'darwin', lrc: { l: { bg: '#fff', txt: '暂无歌词...' }, r: { bg: '', txt: '' } }, - isLock: false + isLock: JSON.parse(Anot.ss('lock')) }, mounted() { + WIN.openDevTools() WIN.on('ktv-lrc', lrc => { this.lrc = lrc }) }, + skip: ['isMac'], methods: { quit(force) { - // WIN.close() WIN.hide() }, lock() { - WIN.setMovable(this.isLock) this.isLock = !this.isLock + Anot.ss('lock', this.isLock) + if (this.isMac) { + WIN.setMovable(!this.isLock) + } else { + // location.reload() + } } } })