From 978d688f3f84a6f31b54a5cf9e2050c5d5bf4b27 Mon Sep 17 00:00:00 2001 From: xmcp Date: Mon, 20 May 2019 00:03:34 +0800 Subject: [PATCH] ui fix --- src/Common.js | 8 ++++---- src/Sidebar.css | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Common.js b/src/Common.js index 023c208..d50c9de 100644 --- a/src/Common.js +++ b/src/Common.js @@ -158,16 +158,16 @@ export class ClickHandler extends PureComponent { } on_begin(e) { - //console.log('click',e.screenY,e.screenX); + //console.log('click',(e.touches?e.touches[0]:e).screenY,(e.touches?e.touches[0]:e).screenX); this.setState({ moved: false, - init_y: e.screenY, - init_x: e.screenX, + init_y: (e.touches?e.touches[0]:e).screenY, + init_x: (e.touches?e.touches[0]:e).screenX, }); } on_move(e) { if(!this.state.moved) { - let mvmt=Math.abs(e.screenY-this.state.init_y)+Math.abs(e.screenX-this.state.init_x); + let mvmt=Math.abs((e.touches?e.touches[0]:e).screenY-this.state.init_y)+Math.abs((e.touches?e.touches[0]:e).screenX-this.state.init_x); //console.log('move',mvmt); if(mvmt>this.MOVE_THRESHOLD) this.setState({ diff --git a/src/Sidebar.css b/src/Sidebar.css index 517c24d..9841c48 100644 --- a/src/Sidebar.css +++ b/src/Sidebar.css @@ -22,7 +22,7 @@ height: 100%; background-color: rgba(255,255,255,.7); overflow-y: auto; - padding-top: 2em; + padding-top: 3em; padding-bottom: 1em; } @@ -44,9 +44,7 @@ top: 0; line-height: 3em; padding-left: .5em; - padding-bottom: .5em; - margin-bottom: -.5em; - background-image: linear-gradient(top,rgba(255,255,255,.7) 50%,rgba(255,255,255,0) 100%); + background-color: rgba(255,255,255,.6); pointer-events: none; } .sidebar-title a {