Merge branch 'dev' into feature/add_logo_dark_light_mode_switching

This commit is contained in:
Daniel Odrinski
2023-05-09 14:12:59 +01:00
committed by GitHub
17 changed files with 88 additions and 74 deletions
+8 -4
View File
@@ -748,7 +748,7 @@ select {
}
.prose :where(a):not(:where([class~="not-prose"] *)):hover {
color: rgba(var(--color-neutral), 1);
color: rgba(var(--color-primary-600), 1);
text-decoration: none;
border-radius: 0.09rem;
}
@@ -1066,7 +1066,7 @@ select {
--tw-prose-body: rgba(var(--color-neutral-700), 1);
--tw-prose-headings: rgba(var(--color-neutral-800), 1);
--tw-prose-lead: rgba(var(--color-neutral-500), 1);
--tw-prose-links: rgba(var(--color-primary-700), 1);
--tw-prose-links: rgba(var(--color-primary-600), 1);
--tw-prose-bold: rgba(var(--color-neutral-900), 1);
--tw-prose-counters: rgba(var(--color-neutral-800), 1);
--tw-prose-bullets: rgba(var(--color-neutral-500), 1);
@@ -1403,8 +1403,8 @@ select {
top: 5rem;
}
.top-\[100vh\] {
top: 100vh;
.top-\[110vh\] {
top: 110vh;
}
.top-\[11px\] {
@@ -5384,6 +5384,10 @@ body:has(#menu-controller:checked) {
text-decoration-color: rgba(var(--color-neutral-600), 1);
}
:is(.dark .dark\:prose-invert) :where(a):not(:where([class~="not-prose"] *)):hover {
color: rgba(var(--color-primary-400), 1);
}
:is(.dark .dark\:prose-invert) :where(kbd):not(:where([class~="not-prose"] *)) {
color: rgba(var(--color-neutral-200), 1);
background-color: rgba(var(--color-neutral-700), 1);
+8
View File
@@ -91,3 +91,11 @@ var updateLogo = (targetAppearance) => {
var getTargetAppearance = () => {
return document.documentElement.classList.contains("dark") ? "dark" : "light"
}
window.addEventListener("DOMContentLoaded", (event) => {
const scroller = document.getElementById("top-scroller");
const footer = document.getElementById("site-footer");
if(scroller.getBoundingClientRect().top > footer.getBoundingClientRect().top) {
scroller.hidden = true;
}
});
+10 -13
View File
@@ -3,26 +3,23 @@ if (typeof auth !== 'undefined') {
var likesCollection = db.collection('likes');
function numberWithCommas(x) {
//return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
var update_views = function (oid, id) {
var update_views = function (node, id) {
viewsCollection.doc(id).onSnapshot(doc => {
var data = doc.data();
if (data) {
var label = document.querySelectorAll("span[id='" + oid + "']")[0].innerText.split(' ')[1]
document.querySelectorAll("span[id='" + oid + "']")[0].innerText = numberWithCommas(data.views)
node.innerText = numberWithCommas(data.views)
}
})
}
var update_likes = function (oid, id) {
var update_likes = function (node, id) {
likesCollection.doc(id).onSnapshot(doc => {
var data = doc.data();
if (data) {
var label = document.querySelectorAll("span[id='" + oid + "']")[0].innerText.split(' ')[1]
document.querySelectorAll("span[id='" + oid + "']")[0].innerText = numberWithCommas(data.likes)
node.innerText = numberWithCommas(data.likes)
}
})
}
@@ -33,20 +30,20 @@ if (typeof auth !== 'undefined') {
var views_nodes = document.querySelectorAll("span[id^='views_']")
for (var i in views_nodes) {
var oid = views_nodes[i].id
var id = oid ? oid.replaceAll("/", "-") : oid
var node = views_nodes[i]
var id = node.id ? node.id.replaceAll("/", "-") : node.id
if (id) {
update_views(oid, id)
update_views(node, id)
}
}
var likes_nodes = document.querySelectorAll("span[id^='likes_']")
for (var i in likes_nodes) {
var oid = likes_nodes[i].id
var id = oid ? oid.replaceAll("/", "-") : oid
var node = likes_nodes[i]
var id = node.id ? node.id.replaceAll("/", "-") : node.id
if (id) {
update_likes(oid, id)
update_likes(node, id)
}
}
})
+5 -5
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long