From 7ac496230098a533a31f09c383019f180c2f040a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sun, 16 Oct 2022 15:25:34 +0100 Subject: [PATCH 1/3] improvements to like button UI --- layouts/_default/single.html | 6 +++--- layouts/partials/meta/likes_button.html | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 532aa1e2..151b71d5 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -66,7 +66,7 @@ liked_article = true document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "" document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none" - document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "Remove Like" + document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "" } } @@ -80,7 +80,7 @@ localStorage.setItem(id_likes, true); document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "" document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none" - document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "Remove Like" + document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "" if (doc.exists) { db.collection('likes').doc(id_likes).update({ likes: firebase.firestore.FieldValue.increment(1) @@ -108,7 +108,7 @@ localStorage.removeItem(id_likes); document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "none" document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "" - document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "Like" + document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "\xa0Like" if (doc.exists) { db.collection('likes').doc(id_likes).update({ likes: firebase.firestore.FieldValue.increment(-1) diff --git a/layouts/partials/meta/likes_button.html b/layouts/partials/meta/likes_button.html index 919f3059..4d768c76 100644 --- a/layouts/partials/meta/likes_button.html +++ b/layouts/partials/meta/likes_button.html @@ -5,8 +5,7 @@ onclick="process_article()"> {{ partial "icon.html" "heart-empty" }} -   - Like +  Like {{- /* Trim EOF */ -}} \ No newline at end of file From 144a558235c4c72d74d0654083ee8bdbbbaf363a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sun, 16 Oct 2022 15:32:26 +0100 Subject: [PATCH 2/3] improvements to spacing --- assets/css/compiled/main.css | 20 ++++++++++++++++---- layouts/_default/single.html | 2 +- layouts/partials/meta/likes_button.html | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 44ba42ba..1c72b68c 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1510,8 +1510,16 @@ select { margin-top: 1.25rem; } -.mt-4 { - margin-top: 1rem; +.mt-2\.5 { + margin-top: 0.625rem; +} + +.mb-6 { + margin-bottom: 1.5rem; +} + +.mt-2 { + margin-top: 0.5rem; } .mt-3 { @@ -1534,6 +1542,10 @@ select { margin-top: 0.1rem; } +.mt-4 { + margin-top: 1rem; +} + .\!mt-0 { margin-top: 0px !important; } @@ -3696,7 +3708,7 @@ body:has(#menu-controller:checked) { } @media (min-width: 1280px) { - .xl\:w-1\/5 { - width: 20%; + .xl\:w-1\/4 { + width: 25%; } } \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 151b71d5..a87ae88a 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,7 +8,7 @@

{{ .Title | emojify }}

-
+
{{ partial "article-meta.html" (dict "context" . "scope" "single") }}
diff --git a/layouts/partials/meta/likes_button.html b/layouts/partials/meta/likes_button.html index 4d768c76..43ac61f1 100644 --- a/layouts/partials/meta/likes_button.html +++ b/layouts/partials/meta/likes_button.html @@ -1,6 +1,6 @@