summaryrefslogtreecommitdiffstats
path: root/src/themes/serene/static
diff options
context:
space:
mode:
Diffstat (limited to 'src/themes/serene/static')
-rw-r--r--src/themes/serene/static/icon/email.svg5
-rw-r--r--src/themes/serene/static/js/main.js14
2 files changed, 14 insertions, 5 deletions
diff --git a/src/themes/serene/static/icon/email.svg b/src/themes/serene/static/icon/email.svg
index 0c64d95..1593667 100644
--- a/src/themes/serene/static/icon/email.svg
+++ b/src/themes/serene/static/icon/email.svg
@@ -1,4 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18">
- <path d="M3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM20 7.23792L12.0718 14.338L4 7.21594V19H20V7.23792ZM4.51146 5L12.0619 11.662L19.501 5H4.51146Z" fill="currentColor">
- </path>
-</svg>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18"><path d="M3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM20 7.23792L12.0718 14.338L4 7.21594V19H20V7.23792ZM4.51146 5L12.0619 11.662L19.501 5H4.51146Z" fill="currentColor"></path></svg>
diff --git a/src/themes/serene/static/js/main.js b/src/themes/serene/static/js/main.js
index b0aee0c..df2ef33 100644
--- a/src/themes/serene/static/js/main.js
+++ b/src/themes/serene/static/js/main.js
@@ -5,7 +5,7 @@ function enableThemeToggle() {
const preferDark = window.matchMedia("(prefers-color-scheme: dark)");
function toggleTheme(theme) {
if (theme == "dark") document.body.classList.add('dark'); else document.body.classList.remove('dark');
- if (hlLink) hlLink.href = `/hl-${theme}.css`;
+ if (hlLink) hlLink.href = `/giallo-${theme}.css`;
sessionStorage.setItem("theme", theme);
toggleGiscusTheme(theme);
}
@@ -243,9 +243,21 @@ function enableReaction() {
init();
}
+function enableBackLink() {
+ const backLink = document.querySelector('#back-link');
+ if (!backLink) return;
+ backLink.addEventListener('click', (e) => {
+ if (document.referrer && location.href.startsWith(document.referrer) && !location.hash && history.length > 1) {
+ e.preventDefault();
+ history.back();
+ }
+ });
+}
+
enableThemeToggle();
enablePrerender();
enableRssMask();
+enableBackLink();
if (document.body.classList.contains('post')) {
enableOutdateAlert();
addBackToTopBtn();