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

View file

@ -16,7 +16,7 @@ replacements.set(/<tifisgrin>([^<]*)<r>/g, function (content) {
}); });
$.ajax({ $.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, cache: false,
success: populateManual success: populateManual
}); });

View file

@ -82,11 +82,9 @@ body {
} }
.sellout { .sellout {
display: block; display: flex;
position: relative; align-items: center;
margin-left: auto; flex-direction: column;
margin-right: auto;
text-align: center;
} }
@media (max-width: 768px) { @media (max-width: 768px) {

View file

@ -80,6 +80,7 @@
<!-- Content --> <!-- Content -->
<div class="container main"> <div class="container main">
<!-- Cookie notification --> <!-- Cookie notification -->
<div id="cookieinfo"></div>
<script src="./scripts/cookieinfo.js"></script> <script src="./scripts/cookieinfo.js"></script>
<div id="main"> <div id="main">
@ -99,8 +100,8 @@
<!-- Sponsor buttons --> <!-- Sponsor buttons -->
<div class="sellout"> <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> <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"> <a href="https://www.patreon.com/bePatron?u=2494595" class="patreon-button" style="padding: 5px;">
<img src="./res/becomePatron.png" height="34" alt="Become a patron"> <img src="../res/becomePatron.png" alt="Become a patron" style="width: auto; height: auto; max-height: 34px;">
</a> </a>
</div> </div>
</div> </div>

View file

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

View file

@ -3,20 +3,13 @@ const pride = new Date().getMonth() === 5;
const loc = $("script").last().attr("src").split("/")[0]; const loc = $("script").last().attr("src").split("/")[0];
if (dark) { if (dark) {
document.write( /*html*/ `<link rel="stylesheet" href="${loc}/style/dark.css">`); addStyle(`${loc}/style/dark.css`);
document.write( /*html*/ `<link rel="stylesheet" href="${loc}/style/prettify-dark.css">`); addStyle(`${loc}/style/prettify-dark.css`);
} }
if (pride) if (pride)
document.write( /*html*/ `<link rel="stylesheet" href="${loc}/style/pride.css">`); addStyle(`${loc}/style/pride.css`);
$(function () { $(function () {
let openModals = function (hash) {
if (hash && hash.startsWith("#")) {
let modal = $(`${hash}-modal`);
if (modal.length)
modal.modal('show');
}
}
openModals(window.location.hash); openModals(window.location.hash);
$('a').on('click', function () { $('a').on('click', function () {
openModals($(this).attr('href')); openModals($(this).attr('href'));
@ -40,3 +33,11 @@ $(function () {
PR.prettyPrint(); PR.prettyPrint();
}); });
function openModals(hash) {
if (hash && hash.startsWith("#")) {
let modal = $(`${hash}-modal`);
if (modal.length)
modal.modal('show');
}
}

View file

@ -24,3 +24,10 @@ function forceToAnchor() {
} }
} }
} }
function addStyle(path) {
$('head').append($("<link/>", {
rel: "stylesheet",
href: path
}));
}

View file

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