From 40246ef6839758ba4deb60323402bb6556c13577 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 19 Mar 2021 11:42:35 +0100 Subject: [PATCH] some more minor improvements --- actaddmanual/index.html | 6 ++++-- actaddmanual/index.js | 2 +- actaddmanual/style.css | 8 +++----- index.html | 5 +++-- scripts/cookieinfo.js | 3 +-- scripts/main.js | 23 ++++++++++++----------- scripts/util.js | 7 +++++++ style/style.css | 2 +- 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/actaddmanual/index.html b/actaddmanual/index.html index a827e43..3cc8a1c 100644 --- a/actaddmanual/index.html +++ b/actaddmanual/index.html @@ -34,14 +34,16 @@
- - + + Become a patron +

+
diff --git a/actaddmanual/index.js b/actaddmanual/index.js index 641bf7f..b23feca 100644 --- a/actaddmanual/index.js +++ b/actaddmanual/index.js @@ -16,7 +16,7 @@ replacements.set(/([^<]*)/g, function (content) { }); $.ajax({ - url: "https://gitcdn.xyz/repo/Ellpeck/ActuallyAdditions/main/src/main/resources/assets/actuallyadditions/lang/en_US.lang", + url: "https://cdn.jsdelivr.net/gh/Ellpeck/ActuallyAdditions/src/main/resources/assets/actuallyadditions/lang/en_US.lang", cache: false, success: populateManual }); diff --git a/actaddmanual/style.css b/actaddmanual/style.css index c9a8fdd..98c23e9 100644 --- a/actaddmanual/style.css +++ b/actaddmanual/style.css @@ -82,11 +82,9 @@ body { } .sellout { - display: block; - position: relative; - margin-left: auto; - margin-right: auto; - text-align: center; + display: flex; + align-items: center; + flex-direction: column; } @media (max-width: 768px) { diff --git a/index.html b/index.html index 5b05c57..0843c9d 100644 --- a/index.html +++ b/index.html @@ -80,6 +80,7 @@
+
@@ -99,8 +100,8 @@
diff --git a/scripts/cookieinfo.js b/scripts/cookieinfo.js index 6b50f98..52c2f58 100644 --- a/scripts/cookieinfo.js +++ b/scripts/cookieinfo.js @@ -1,5 +1,5 @@ if (getCookie("notification") !== "true") { - document.write( /*html*/ ` + $('#cookieinfo').html( /*html*/ ` `); - $("#notif-close").on("click", function () { setCookie("notification", "true", 365); }); diff --git a/scripts/main.js b/scripts/main.js index 9cb85f5..e402dd0 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -3,20 +3,13 @@ const pride = new Date().getMonth() === 5; const loc = $("script").last().attr("src").split("/")[0]; if (dark) { - document.write( /*html*/ ``); - document.write( /*html*/ ``); + addStyle(`${loc}/style/dark.css`); + addStyle(`${loc}/style/prettify-dark.css`); } if (pride) - document.write( /*html*/ ``); + addStyle(`${loc}/style/pride.css`); $(function () { - let openModals = function (hash) { - if (hash && hash.startsWith("#")) { - let modal = $(`${hash}-modal`); - if (modal.length) - modal.modal('show'); - } - } openModals(window.location.hash); $('a').on('click', function () { openModals($(this).attr('href')); @@ -39,4 +32,12 @@ $(function () { }); PR.prettyPrint(); -}); \ No newline at end of file +}); + +function openModals(hash) { + if (hash && hash.startsWith("#")) { + let modal = $(`${hash}-modal`); + if (modal.length) + modal.modal('show'); + } +} \ No newline at end of file diff --git a/scripts/util.js b/scripts/util.js index 7dc7eee..c876e2a 100644 --- a/scripts/util.js +++ b/scripts/util.js @@ -23,4 +23,11 @@ function forceToAnchor() { }, 0); } } +} + +function addStyle(path) { + $('head').append($("", { + rel: "stylesheet", + href: path + })); } \ No newline at end of file diff --git a/style/style.css b/style/style.css index fa90459..5e7fdd8 100644 --- a/style/style.css +++ b/style/style.css @@ -243,11 +243,11 @@ blockquote { .sellout { flex-direction: column; - max-height: none; } .sellout iframe { margin-bottom: 10px; + margin-right: 0 !important; } }