From 69483af3df8172594dd51d61a362e9b583b6ae1f Mon Sep 17 00:00:00 2001 From: whes1015 Date: Thu, 20 Apr 2023 09:10:46 +0800 Subject: [PATCH] fix: style --- core/api.js | 10 +++++++--- core/init.js | 4 +++- core/loop.js | 3 ++- core/server.js | 4 ++-- css/main.css | 3 +++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/core/api.js b/core/api.js index 656591eb..5297cf78 100644 --- a/core/api.js +++ b/core/api.js @@ -43,9 +43,11 @@ function check_update() { .then((ans) => ans.json()) .then((ans) => { if (ver_string_to_int(ans[0].tag_name) > ver_string_to_int(app.getVersion())) { + ver_text.innerHTML = `➜ ${app.getVersion()}`; + ver_text.style.cursor = "pointer"; update = true; const notification = new Notification("πŸ†™ ζ–°η‰ˆζœ¬", { - body : `η™ΌηΎζ–°η‰ˆζœ¬! γ€Ž${ans[0].tag_name}』\nι»žζ“Šζ­€θ¨Šζ―ε‰εΎ€ζŸ₯ηœ‹`, + body : `η™ΌηΎζ–°η‰ˆζœ¬! γ€Ž${ans[0].tag_name}』`, icon : "../TREM.ico", }); notification.onclick = () => { @@ -450,12 +452,14 @@ function replay_stop() { i--; } eew_cache = []; - $(".time").css("color", "white"); + time.style.cursor = ""; + time.style.color = "white"; } function replay_run(id_list) { eew_cache = []; - $(".time").css("color", "yellow"); + time.style.cursor = "pointer"; + time.style.color = "yellow"; on_rts_data({}); report_off(); for (let i = 0; i < id_list.length; i++) { diff --git a/core/init.js b/core/init.js index b03aee96..77ccff03 100644 --- a/core/init.js +++ b/core/init.js @@ -2,4 +2,6 @@ document.getElementById("eew_max_intensity").innerHTML = get_lang_string("eew.max.intensity"); document.getElementById("max_intensity_text").innerHTML = get_lang_string("rts.max.intensity"); document.getElementById("max_pga_text").innerHTML = get_lang_string("rts.max.pga"); -document.getElementById("version").innerHTML = app.getVersion(); \ No newline at end of file +const ver_text = document.getElementById("version"); +ver_text.innerHTML = app.getVersion(); +ver_text.addEventListener("click", () => shell.openExternal("https://github.com/ExpTechTW/TREM-Lite/releases/latest")); \ No newline at end of file diff --git a/core/loop.js b/core/loop.js index cb8aa909..f63dacb8 100644 --- a/core/loop.js +++ b/core/loop.js @@ -43,6 +43,7 @@ time.addEventListener("click", () => { if (rts_replay_timestamp) replay_stop(); if (TREM.report_epicenterIcon) report_off(); refresh_report_list(); + time.style.cursor = ""; }); setInterval(() => { @@ -90,7 +91,7 @@ setInterval(() => { if (!service_status.websocket.status) error += "1"; if (!FCM) error += "3"; if (!service_status.p2p.status) error += "4"; - _status.innerHTML = _status_text + ((error == "") ? "" : ` | πŸ“› ${error}`); + _status.innerHTML = _status_text + ((error == "") ? "" : ` | πŸ“› ${error}`) + ((update) ? " πŸ†™" : ""); _get_data.innerHTML = ""; if (type_list.length) { if (type_list.includes("http")) { diff --git a/core/server.js b/core/server.js index e5901574..dadd842e 100644 --- a/core/server.js +++ b/core/server.js @@ -79,7 +79,7 @@ function initEventHandle() { sleep_state = config.addition["trem-rts-v2"].sleep; }; ws.onmessage = function(evt) { - if (!WS) $(".time").css("color", "white"); + if (!WS) time.style.color = "white"; WS = true; ServerT = Date.now(); const json = JSON.parse(evt.data); @@ -90,7 +90,7 @@ function initEventHandle() { setInterval(() => { if (Date.now() - ServerT > 15_000 && ServerT) { WS = false; - $(".time").css("color", "red"); + time.style.color = "red"; reconnect(); if (Date.now() - disconnect_info > 60_000) { disconnect_info = Date.now(); diff --git a/css/main.css b/css/main.css index 97781fde..ee24264d 100644 --- a/css/main.css +++ b/css/main.css @@ -212,6 +212,7 @@ } .report_click_text { + cursor: pointer; border-radius: 5px; padding: 3px; margin: 3px; @@ -332,6 +333,7 @@ } .location_button { + cursor: pointer; z-index: 9999; bottom: 1%; right: 28%; @@ -343,6 +345,7 @@ } .setting_button { + cursor: pointer; z-index: 9999; bottom: 1%; right: 25%;