some more minor improvements
All checks were successful
Web/pipeline/head This commit looks good

This commit is contained in:
Ell 2021-03-19 11:42:35 +01:00
parent b239ec5b02
commit 40246ef683
8 changed files with 32 additions and 24 deletions

View file

@ -34,14 +34,16 @@
<!-- Sponsor buttons -->
<div class="sellout">
<iframe src="https://github.com/sponsors/Ellpeck/button" title="Sponsor Ellpeck" height="32" width="116" style="border: 0;"></iframe>
<a href="https://www.patreon.com/bePatron?u=2494595" data-patreon-widget-type="become-patron-button"></a>
<script async src="https://c6.patreon.com/becomePatronButton.bundle.js"></script>
<a href="https://www.patreon.com/bePatron?u=2494595" class="patreon-button" style="padding: 5px;">
<img src="../res/becomePatron.png" alt="Become a patron" style="width: auto; height: auto; max-height: 34px;">
</a>
</div>
<hr>
</div>
<div id="content">
<div id="entries">
<!-- Cookie notification -->
<div id="cookieinfo"></div>
<script src="../scripts/cookieinfo.js"></script>
</div>
<script src="index.js"></script>

View file

@ -16,7 +16,7 @@ replacements.set(/<tifisgrin>([^<]*)<r>/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
});

View file

@ -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) {

View file

@ -80,6 +80,7 @@
<!-- Content -->
<div class="container main">
<!-- Cookie notification -->
<div id="cookieinfo"></div>
<script src="./scripts/cookieinfo.js"></script>
<div id="main">
@ -99,8 +100,8 @@
<!-- Sponsor buttons -->
<div class="sellout">
<iframe src="https://github.com/sponsors/Ellpeck/button" title="Sponsor Ellpeck" height="32" width="116" style="border: 0; margin-right: 10px;"></iframe>
<a href="https://www.patreon.com/bePatron?u=2494595" class="patreon-button">
<img src="./res/becomePatron.png" height="34" alt="Become a patron">
<a href="https://www.patreon.com/bePatron?u=2494595" class="patreon-button" style="padding: 5px;">
<img src="../res/becomePatron.png" alt="Become a patron" style="width: auto; height: auto; max-height: 34px;">
</a>
</div>
</div>

View file

@ -1,5 +1,5 @@
if (getCookie("notification") !== "true") {
document.write( /*html*/ `
$('#cookieinfo').html( /*html*/ `
<div class="alert alert-danger alert-dismissible fade show" role="alert">
This site uses cookies to store information about your browsing activity.
<br>For more information, check out the <a href=\"/#privacy\">privacy policy</a>.
@ -9,7 +9,6 @@ if (getCookie("notification") !== "true") {
</button>
</div>
`);
$("#notif-close").on("click", function () {
setCookie("notification", "true", 365);
});

View file

@ -3,20 +3,13 @@ const pride = new Date().getMonth() === 5;
const loc = $("script").last().attr("src").split("/")[0];
if (dark) {
document.write( /*html*/ `<link rel="stylesheet" href="${loc}/style/dark.css">`);
document.write( /*html*/ `<link rel="stylesheet" href="${loc}/style/prettify-dark.css">`);
addStyle(`${loc}/style/dark.css`);
addStyle(`${loc}/style/prettify-dark.css`);
}
if (pride)
document.write( /*html*/ `<link rel="stylesheet" href="${loc}/style/pride.css">`);
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();
});
});
function openModals(hash) {
if (hash && hash.startsWith("#")) {
let modal = $(`${hash}-modal`);
if (modal.length)
modal.modal('show');
}
}

View file

@ -23,4 +23,11 @@ function forceToAnchor() {
}, 0);
}
}
}
function addStyle(path) {
$('head').append($("<link/>", {
rel: "stylesheet",
href: path
}));
}

View file

@ -243,11 +243,11 @@ blockquote {
.sellout {
flex-direction: column;
max-height: none;
}
.sellout iframe {
margin-bottom: 10px;
margin-right: 0 !important;
}
}