Browse Source

some more minor improvements

master
Ellpeck 6 months ago
parent
commit
40246ef683
  1. 6
      actaddmanual/index.html
  2. 2
      actaddmanual/index.js
  3. 8
      actaddmanual/style.css
  4. 5
      index.html
  5. 3
      scripts/cookieinfo.js
  6. 23
      scripts/main.js
  7. 7
      scripts/util.js
  8. 2
      style/style.css

6
actaddmanual/index.html

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

2
actaddmanual/index.js

@ -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
});

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

5
index.html

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

3
scripts/cookieinfo.js

@ -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);
});

23
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*/ `<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');
}
}

7
scripts/util.js

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

2
style/style.css

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

Loading…
Cancel
Save