Skip to content

Commit

Permalink
fix: style
Browse files Browse the repository at this point in the history
  • Loading branch information
whes1015 committed Apr 20, 2023
1 parent 7daabd6 commit 69483af
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
10 changes: 7 additions & 3 deletions core/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -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++) {
Expand Down
4 changes: 3 additions & 1 deletion core/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
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"));
3 changes: 2 additions & 1 deletion core/loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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")) {
Expand Down
4 changes: 2 additions & 2 deletions core/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
}

.report_click_text {
cursor: pointer;
border-radius: 5px;
padding: 3px;
margin: 3px;
Expand Down Expand Up @@ -332,6 +333,7 @@
}

.location_button {
cursor: pointer;
z-index: 9999;
bottom: 1%;
right: 28%;
Expand All @@ -343,6 +345,7 @@
}

.setting_button {
cursor: pointer;
z-index: 9999;
bottom: 1%;
right: 25%;
Expand Down

0 comments on commit 69483af

Please sign in to comment.