Skip to content

Commit

Permalink
webui: enhanced reboot prompt
Browse files Browse the repository at this point in the history
Based on pr bindhosts#15 and commit 2ea1cf4, edit reboot prompt and use dim instead of cursor pointer.
  • Loading branch information
KOWX712 committed Dec 1, 2024
1 parent 2ea1cf4 commit f3480ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions module/webroot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ async function saveModeSelection(mode) {
} else {
await execCommand(`echo "mode=${mode}" > /data/adb/bindhosts/mode_override.sh`);
}
showPrompt("Reboot to take effect", true);
showPrompt("Reboot to take effect, tap to reboot", true);
await updateModeSelection();
closeOverlay("mode-menu");
} catch (error) {
Expand Down Expand Up @@ -302,8 +302,7 @@ function showPrompt(message, isSuccess = true) {
}

if (message.includes("Reboot to take effect")) {
prompt.style.cursor = "pointer";

prompt.classList.add('pointer');
prompt.onclick = () => {
let countdown = 3;
prompt.textContent = `Rebooting in ${countdown}...`;
Expand All @@ -320,8 +319,8 @@ function showPrompt(message, isSuccess = true) {
}, 1000);
};
} else {
prompt.classList.remove('pointer');
prompt.onclick = null;
prompt.style.cursor = "default";
}

setTimeout(() => {
Expand Down
4 changes: 4 additions & 0 deletions module/webroot/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ label {
z-index: 1300;
}

.prompt.pointer {
background-color: #27822B;
}

.prompt.visible {
animation: YbounceIn 0.4s forwards;
}
Expand Down

0 comments on commit f3480ec

Please sign in to comment.