From 05ad4b3823787ea81535682473d31d644a4c3696 Mon Sep 17 00:00:00 2001 From: SysSn13 Date: Sat, 4 Sep 2021 10:23:46 +0530 Subject: [PATCH 01/24] fix: use layouts globally --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index d1eb2f6..f3b9dbc 100644 --- a/main.js +++ b/main.js @@ -45,6 +45,8 @@ app.use( path: [/\/bull-board*/], }) ); +app.set("layout", "layouts/layout"); +app.set("layout extractScripts", true); // background if (process.env.BACKGROUND == true) { @@ -67,8 +69,6 @@ if (process.env.BACKGROUND == true) { // web if (process.env.WEB == true) { - app.set("layout", "layouts/layout"); - app.set("layout extractScripts", true); const webRouter = require("./web"); app.use("/", webRouter); console.info("WEB is up."); From 05df038791a434ce738e612380079d0f30c14896 Mon Sep 17 00:00:00 2001 From: Sudesh Chaudhary Date: Mon, 6 Sep 2021 01:56:53 +0530 Subject: [PATCH 02/24] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 623447a..2abfa27 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,12 @@ - chrome-webstore + + chrome-webstore + + + users +
From 03aafb67695f37a5ac552de5b0757a5eb33a7025 Mon Sep 17 00:00:00 2001 From: developer-ishan <62565307+developer-ishan@users.noreply.github.com> Date: Sat, 16 Oct 2021 22:26:52 +0530 Subject: [PATCH 03/24] Feat: Dark theme (#18) * Dark mode implemented using css filter property * change the postion of theme-switch btn * minor changes Co-authored-by: SysSn13 --- public/js/darkmode.js | 28 +++++++++++ public/stylesheets/darkmode.css | 83 +++++++++++++++++++++++++++++++++ views/index.ejs | 54 +++++++++++++-------- views/layouts/layout.ejs | 3 +- 4 files changed, 147 insertions(+), 21 deletions(-) create mode 100644 public/js/darkmode.js create mode 100644 public/stylesheets/darkmode.css diff --git a/public/js/darkmode.js b/public/js/darkmode.js new file mode 100644 index 0000000..1e95e86 --- /dev/null +++ b/public/js/darkmode.js @@ -0,0 +1,28 @@ +var preference = JSON.parse(localStorage.getItem("dark")); +if (preference === null) { + localStorage.setItem("dark", false); + preference=false; +} +var checkBox = document.getElementById("checkDark"); +if(checkBox){ + checkBox.checked = preference; +} +const html = document.getElementsByTagName("html")[0]; + +if (preference) { + html.style.filter = "invert(0.9) hue-rotate(150deg)"; +} else { + html.style.filter = ""; +} + +function toggle_darkmode() { + preference = !preference; + checkBox.checked = preference; + localStorage.setItem("dark", preference); + + if (preference) { + html.style.filter = "invert(0.9) hue-rotate(150deg)"; + } else { + html.style.filter = ""; + } +} diff --git a/public/stylesheets/darkmode.css b/public/stylesheets/darkmode.css new file mode 100644 index 0000000..ed6ecc8 --- /dev/null +++ b/public/stylesheets/darkmode.css @@ -0,0 +1,83 @@ +html { + transition: color 300ms, background-color 300ms; +} +.switch { + position: relative; + display: inline-block; + width: 60px; + height: 34px; +} + +@media screen and (max-width: 600px) { + .switch { + width: 80px; + } +} + +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + -webkit-transition: .4s; + transition: .4s; +} + +.slider:before { + position: absolute; + content: ""; + height: 26px; + width: 26px; + left: 4px; + bottom: 4px; + background-color: white; + -webkit-transition: .4s; + transition: .4s; +} + +input:checked + .slider { + background-color: #2196F3; +} + +input:focus + .slider { + box-shadow: 0 0 1px #2196F3; +} + +input:checked + .slider:before { + -webkit-transform: translateX(26px); + -ms-transform: translateX(26px); + transform: translateX(26px); +} + +/* Rounded sliders */ +.slider.round { + border-radius: 34px; +} + +.slider.round:before { + border-radius: 50%; +} + +.toggle-container{ + display: flex; + justify-content: center; +} + +.toggle-container { + display: flex; + align-items: center; + + em { + margin-left: 10px; + font-size: 1rem; + } +} \ No newline at end of file diff --git a/views/index.ejs b/views/index.ejs index 823972e..36c7248 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -16,6 +16,13 @@ +
+ + Dark Mode! +