From f21d5224353b3c4a25dfc5f0c282045375fd40d1 Mon Sep 17 00:00:00 2001 From: jude Date: Sun, 27 Mar 2022 19:17:30 +0100 Subject: [PATCH] mobile appearence --- Rocket.toml | 2 +- web/static/css/style.css | 22 +++++++++++++--- web/static/js/interval.js | 26 +++++++++---------- web/templates/base.html.tera | 7 ++--- web/templates/dashboard.html.tera | 4 +-- .../reminder_dashboard.html.tera | 6 ++--- 6 files changed, 39 insertions(+), 28 deletions(-) diff --git a/Rocket.toml b/Rocket.toml index eef8409..e2933e7 100644 --- a/Rocket.toml +++ b/Rocket.toml @@ -1,5 +1,5 @@ [default] -address = "127.0.0.1" +address = "0.0.0.0" port = 5000 template_dir = "web/templates" diff --git a/web/static/css/style.css b/web/static/css/style.css index 6f67961..1ece04c 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -40,6 +40,9 @@ div.reminderContent.is-collapsed .columns { div.reminderContent.is-collapsed input[name="name"] { display: inline-flex; flex-grow: 1; + border: none; + font-weight: 700; + background: none; } div.reminderContent.is-collapsed button.hide-box { @@ -84,6 +87,7 @@ div.interval-group > button { margin-left: auto; } +/* Interval inputs */ div.interval-group > .interval-group-left > input { -webkit-appearance: none; border-style: none; @@ -104,6 +108,7 @@ div.interval-group { display: flex; flex-direction: row; } +/* !Interval inputs */ .left-pad { padding-left: 1rem; @@ -167,7 +172,7 @@ img.rounded-corners { div.brand { text-align: center; - height: 48px; + height: 52px; background-color: #8fb677; } @@ -185,7 +190,7 @@ div.dashboard-sidebar { div.mobile-sidebar { z-index: 100; - height: 100vh; + min-height: 100vh; position: absolute; top: 0; display: none; @@ -350,7 +355,6 @@ textarea, input { border-radius: 4px; border-left: 4px solid #fff; background-color: #2f3136; - width: 500px; } .embed-author-box { @@ -447,3 +451,15 @@ textarea, input { border-radius: 2px; border-bottom: 1px solid #fff; } + +@media only screen and (max-width: 768px) { + .customizable.thumbnail img { + width: 60px; + height: 60px; + } + + .customizable.is-24x24 img { + width: 16px; + height: 16px; + } +} diff --git a/web/static/js/interval.js b/web/static/js/interval.js index 24eb2d0..e56c8fc 100644 --- a/web/static/js/interval.js +++ b/web/static/js/interval.js @@ -45,25 +45,23 @@ document.querySelector(".interval-group").addEventListener( ); $intervalGroup.querySelector("button.clear").addEventListener("click", () => { - document - .querySelector(".interval-group") - .querySelectorAll("input") - .forEach((el) => { - el.value = ""; - }); + $intervalGroup.querySelectorAll("input").forEach((el) => { + el.value = ""; + }); }); document.addEventListener("remindersLoaded", (event) => { for (reminder of event.detail) { - update_input(reminder.node.querySelector(".interval-group input")); + let $intervalGroup = reminder.node.querySelector(".interval-group"); - reminder.node.querySelector("button.clear").addEventListener("click", () => { - reminder.node - .querySelector(".interval-group") - .querySelectorAll("input") - .forEach((el) => { - el.value = ""; - }); + $intervalGroup.addEventListener("blur", (ev) => { + if (ev.target.nodeName !== "BUTTON") update_input($intervalGroup); + }); + + $intervalGroup.querySelector("button.clear").addEventListener("click", () => { + $intervalGroup.querySelectorAll("input").forEach((el) => { + el.value = ""; + }); }); } }); diff --git a/web/templates/base.html.tera b/web/templates/base.html.tera index d188b1b..a033a67 100644 --- a/web/templates/base.html.tera +++ b/web/templates/base.html.tera @@ -84,7 +84,7 @@ - + diff --git a/web/templates/dashboard.html.tera b/web/templates/dashboard.html.tera index 031b966..2b12a4e 100644 --- a/web/templates/dashboard.html.tera +++ b/web/templates/dashboard.html.tera @@ -244,7 +244,7 @@ @@ -279,7 +279,7 @@

- Add to Server + Add to Server

diff --git a/web/templates/reminder_dashboard/reminder_dashboard.html.tera b/web/templates/reminder_dashboard/reminder_dashboard.html.tera index d23edde..c3c7c56 100644 --- a/web/templates/reminder_dashboard/reminder_dashboard.html.tera +++ b/web/templates/reminder_dashboard/reminder_dashboard.html.tera @@ -9,7 +9,7 @@
-
+
Reminders
@@ -30,8 +30,8 @@
- +