From 7a2535731547535a73f13fc6cef4e41de89a2f17 Mon Sep 17 00:00:00 2001 From: xmcp Date: Fri, 26 Apr 2019 21:50:18 +0800 Subject: [PATCH] ui improvements - update dot style - hide dot and tooltip for quote item - hide scrollbar on firefox - add hover effect for control btns - fix url regex --- src/Flows.css | 15 ++++++++++++--- src/Title.css | 5 +++++ src/index.css | 5 ++++- src/text_splitter.js | 2 +- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/Flows.css b/src/Flows.css index 9986afe..2d8b297 100644 --- a/src/Flows.css +++ b/src/Flows.css @@ -34,6 +34,9 @@ .flow-reply-row::-webkit-scrollbar { display: none; } +.flow-reply-row { + scrollbar-width: none; +} .flow-reply-row:empty { margin: 0 !important; @@ -138,13 +141,13 @@ .flow-item-dot { position: relative; - top: calc(-.5em - 5px); - left: calc(-.5em - 5px); + top: calc(-.5em - 4px); + left: calc(-.5em - 4px); width: 10px; height: 10px; margin-bottom: -10px; border-radius: 50%; - background-color: orange; + background-color: #ffbb44; box-shadow: 0 0 5px rgba(0,0,0,.4); } @@ -155,6 +158,7 @@ .box-id { color: #666666; } + .box-id a:hover::before { content: "复制全文"; position: relative; @@ -182,6 +186,11 @@ overflow-y: hidden; } +.flow-item-quote .flow-item-dot, +.flow-item-quote .box-id a:hover::before { + display: none; +} + .quote-tip { margin-top: .5em; margin-bottom: -10em; /* so that it will not block reply bar */ diff --git a/src/Title.css b/src/Title.css index 7d49956..972dd89 100644 --- a/src/Title.css +++ b/src/Title.css @@ -34,6 +34,11 @@ text-align: center; color: black; } +.control-btn:hover { + background-color: #555555; + color: white; + border-radius: 5px; +} .control-btn .icon:before { margin: .5em; diff --git a/src/index.css b/src/index.css index 684c544..dc973b7 100644 --- a/src/index.css +++ b/src/index.css @@ -7,9 +7,12 @@ body { background-color: #124; } -body::-webkit-scrollbar { +html::-webkit-scrollbar { display: none; } +html { + scrollbar-width: none; +} body, textarea, pre { font-family: 'Segoe UI', '微软雅黑', 'Microsoft YaHei', sans-serif; diff --git a/src/text_splitter.js b/src/text_splitter.js index 8bfe786..544074a 100644 --- a/src/text_splitter.js +++ b/src/text_splitter.js @@ -1,6 +1,6 @@ export const PID_RE=/(^|[^\d])([1-9]\d{4,5})(?!\d|\u20e3|\ufe0e|\ufe0f)/g; export const NICKNAME_RE=/(^|[^A-Za-z])((?:(?:Angry|Baby|Crazy|Diligent|Excited|Fat|Greedy|Hungry|Interesting|Japanese|Kind|Little|Magic|Naïve|Old|Powerful|Quiet|Rich|Superman|THU|Undefined|Valuable|Wifeless|Xiangbuchulai|Young|Zombie)\s)?(?:Alice|Bob|Carol|Dave|Eve|Francis|Grace|Hans|Isabella|Jason|Kate|Louis|Margaret|Nathan|Olivia|Paul|Queen|Richard|Susan|Thomas|Uma|Vivian|Winnie|Xander|Yasmine|Zach)|You Win(?: \d+)?|洞主)(?![A-Za-z])/gi; -export const URL_RE=/(?:^|\b)((?:https?:\/\/)?(?:(?:[\w-]+\.)+[a-zA-Z]{2,3}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::\d{1,5})?(?:\/[\w~!@#$%^&*()-_=+[\];,./?]*)?)(?![a-zA-Z0-9])/gi; +export const URL_RE=/(^|[^@a-zA-Z0-9_])((?:https?:\/\/)?(?:(?:[\w-]+\.)+[a-zA-Z]{2,3}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::\d{1,5})?(?:\/[\w~!@#$%^&*()\-_=+[\];,./?]*)?)(?![a-zA-Z0-9])/gi; export function split_text(txt,rules) { // rules: [['name',/regex/],...]