From 44da4e1b8bbd91ed59eeabaa1fdd0bf52adf30b5 Mon Sep 17 00:00:00 2001 From: Roderick Qiu Date: Sun, 3 Mar 2019 13:55:25 +0800 Subject: [PATCH] localized & updated --- README.md | 8 +- about.html | 38 ++++--- index.html | 46 +++++--- locales/en.json | 78 +++++++++++++ locales/zh.json | 78 +++++++++++++ main.js | 66 +++++++---- package-lock.json | 273 +++++++++++++++++++++++++++++++++++++++++++--- package.json | 1 + renderer.js | 9 ++ settings.html | 131 +++++++++++++++------- style.css | 17 +++ timer.html | 27 ++--- updater.js | 11 +- 13 files changed, 656 insertions(+), 127 deletions(-) create mode 100644 locales/en.json create mode 100644 locales/zh.json diff --git a/README.md b/README.md index 0fe2f53..dba42c1 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # wnr -##### Download: [GitHub release](https://github.com/RoderickQiu/wnr/releases) | [Softpedia](https://www.softpedia.com/get/Desktop-Enhancements/Clocks-Time-Management/wnr.shtml) +**Download: [GitHub release](https://github.com/RoderickQiu/wnr/releases) | [Softpedia](https://www.softpedia.com/get/Desktop-Enhancements/Clocks-Time-Management/wnr.shtml)** ## Introduction +**[中文版](https://scris.top/wnr/)** + **The name is an abbr of "Work & Rest". It's a timer app with strong expansibility for computers.** ![Preview](https://raw.githubusercontent.com/RoderickQiu/wnr/master/res/preview/preview-1.png) @@ -34,12 +36,14 @@ As a timer app, wnr is simple but useful. ## To-do List -Please go and see [Githhub Project](https://github.com/RoderickQiu/wnr/projects/1). +Please go and see [GitHub Project](https://github.com/RoderickQiu/wnr/projects/1). ## Contact - Homepage: [wnr.scris.top](https://wnr.scris.top/) + - Downloads: [Releases](https://github.com/RoderickQiu/wnr/releases/) + - Need Help: [Go to Help Page](https://wnr.scris.top/help.html) or [Contact Me](https://roderickqiu.scris.top/) --- diff --git a/about.html b/about.html index 42853b4..fdb76b8 100644 --- a/about.html +++ b/about.html @@ -17,37 +17,49 @@ +
- + +

wnr

- +

   + class="fa fa-home" id="homepage">      + class="fa fa-github" id="ongithub">   + class="fa fa-exclamation-circle" id="issues"> +


-

If you have problems or you want to

-

some suggestion, just tell me!

+

+ +

+

+ + + + + + +

- - \ No newline at end of file diff --git a/index.html b/index.html index d71b23b..5792400 100644 --- a/index.html +++ b/index.html @@ -18,6 +18,8 @@ + + + +
+
-

-

+

-

-
+
- -
- + +
-

Settings

+

+ +


-

Time Settings

+

+ +


- - - -1 + + + 0
- Set the default work time for every loop. Set it to "-1" to delete the former setting. + +
- - - -1 + + + 0
- Set the default rest time for every loop. Set it to "-1" to delete the former setting. + +
- - - -1 + + + 0
- Set the default number of loops. Set it to "-1" to delete the former setting. + +

-

Global Settings

+

+ +


- + + +
+ +
+ + +
+
+
+
- If it is enabled, every time your time is ended, a notice sound is played. +
- +
- If it is enabled, every time you start wnr, it will stay on the top of the screen. Restart is - required. + +
+ +
- +
- If it is enabled, every time your system starts, wnr starts. +
- +
- If it is enabled, when it's rest time, wnr will enter full-screen mode to prevent you from using - computer. +
- +
- If it is enabled, wnr will automatically check for update (every day). +

-

Other Things

+

+ +


  • - Manually check for - update (Now - ) + +   + + +
  • - Open/Hide hotkey: + Ctrl+Shift+Alt+W. - (Hide to the system tray) + + +
  • +
  • + + + + Ctrl+Shift+Alt+S. +
  • @@ -123,7 +168,7 @@ } function worktimeset() { $("#work-time-show").html($("#work-time-set").val()); - if ($("#work-time-set").val() != -1) store.set("worktime", $("#work-time-set").val()); + if ($("#work-time-set").val() != 0) store.set("worktime", $("#work-time-set").val()); else store.delete("worktime"); } if (store.get("resttime") != undefined) { @@ -132,7 +177,7 @@ } function resttimeset() { $("#rest-time-show").html($("#rest-time-set").val()); - if ($("#rest-time-set").val() != -1) store.set("resttime", $("#rest-time-set").val()); + if ($("#rest-time-set").val() != 0) store.set("resttime", $("#rest-time-set").val()); else store.delete("resttime"); } if (store.get("looptime") != undefined) { @@ -141,9 +186,18 @@ } function looptimeset() { $("#loop-time-show").html($("#loop-time-set").val()); - if ($("#loop-time-set").val() != -1) store.set("looptime", $("#loop-time-set").val()); + if ($("#loop-time-set").val() != 0) store.set("looptime", $("#loop-time-set").val()); else store.delete("looptime"); } + if (store.get("i18n") != undefined) { + if (store.get("i18n") == 'en') document.getElementById("lang-set").checked = true; + else document.getElementById("lang-set").checked = false; + } + function langset() { + if (document.getElementById("lang-set").checked == true) store.set("i18n", 'en'); + else store.set("i18n", 'zh'); + $("#restarttip1").html("(" + i18n.__('restartnow') + ")"); + } if (store.get("sound") != undefined) { if (store.get("sound")) document.getElementById("sound-set").checked = true; else document.getElementById("sound-set").checked = false; @@ -159,7 +213,7 @@ function topset() { if (document.getElementById("top-set").checked == true) store.set("top", true); else store.set("top", false); - $("#restarttip").html("(Restart Now)"); + $("#restarttip").html("(" + i18n.__('restartnow') + ")"); } if (store.get("autostart") == true) document.getElementById("autostart-set").checked = true; else document.getElementById("autostart-set").checked = false; @@ -203,7 +257,6 @@ ipc.send("relauncher"); } - \ No newline at end of file diff --git a/style.css b/style.css index b2dc6f3..a44ec74 100644 --- a/style.css +++ b/style.css @@ -9,16 +9,23 @@ html, body{ align-items: center;/* center in v/h */ -webkit-app-region: drag;/* let the app draggable */ } +@keyframes showTip{ + from {opacity: 0;} + to {opacity: 1;} +} kbd{ background-color: #5490ea; + font-weight: lighter; } label{ display: inline-block; + vertical-align: middle; margin-bottom: .5rem; } input{ display: inline-block; + vertical-align: middle; line-height: inherit; margin: 0rem; padding: 1px 0px; @@ -64,6 +71,9 @@ input:focus::-webkit-input-placeholder, input:hover::-webkit-input-placeholder { color: #999999c2; transition: color.5s; } +li{ + line-height: 200%; +} .work, .work::-webkit-input-placeholder{ color: #ea5454; @@ -118,4 +128,11 @@ input:focus::-webkit-input-placeholder, input:hover::-webkit-input-placeholder { font-size: 18px; -webkit-app-region: no-drag;/* let it clickable */ -webkit-user-select: none; +} +#tip{ + position: absolute; + bottom: 5px; + opacity: 0; + -webkit-app-region: no-drag;/* let it clickable */ + -webkit-user-select: none; } \ No newline at end of file diff --git a/timer.html b/timer.html index 025f3be..23c774a 100644 --- a/timer.html +++ b/timer.html @@ -17,15 +17,22 @@ +
       + id="backindex">      + id="winhider">      - + id="minimizer">   + +
    @@ -36,13 +43,7 @@
    - -