Skip to content

Commit

Permalink
FOUC fix for Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
TIT8 committed Aug 25, 2024
1 parent c9a8c39 commit 7a0991c
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 49 deletions.
14 changes: 6 additions & 8 deletions public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
<link rel="stylesheet" type="text/css" href="/style.css" crossorigin="anonymous">
<script>

if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
document.querySelector('html').style.display = "block";
}

document.addEventListener("DOMContentLoaded", () => {

let switcher = document.querySelector(".div_switch input");
Expand Down Expand Up @@ -131,7 +135,7 @@

<div class="div_switch" id="div_toggle" style="display: none;">
<label class="sup">
<input type="checkbox" id="toggle">
<input type="checkbox" autocomplete='off' id="toggle">
<div class="slider">
<svg class="svg1" version="2" width="1.5em" height="1.5em" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M440.14,302.07c-20.52,81-93.9,140.93-181.28,140.93c-103.28,0-187-83.72-187-187s83.72-187,187-187 c2.77,0,5.54,0.06,8.28,0.18c-32.11,26.65-52.55,66.85-52.55,111.83c0,80.22,65.03,145.25,145.25,145.25 C389.52,326.27,417.14,317.36,440.14,302.07z"/>
Expand All @@ -149,9 +153,6 @@
let div_button = document.getElementById('div_toggle');
div_button.style.display = 'block';

let toggle = document.querySelector(".sup");
toggle.style.display = "none";


}
</script>
Expand Down Expand Up @@ -192,8 +193,6 @@ <h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2>


if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
let toggle_label = document.querySelector(".sup");
toggle_label.style.display = "inline-block";

let switcher = document.querySelector(".div_switch input");
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
Expand All @@ -202,8 +201,7 @@ <h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2>
switcher.checked = true;
}
}

document.querySelector('html').style.display = "block";

}

</script>
Expand Down
14 changes: 6 additions & 8 deletions public/contact/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
<link rel="stylesheet" type="text/css" href="/style.css" crossorigin="anonymous">
<script>

if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
document.querySelector('html').style.display = "block";
}

document.addEventListener("DOMContentLoaded", () => {

let switcher = document.querySelector(".div_switch input");
Expand Down Expand Up @@ -144,7 +148,7 @@

<div class="div_switch" id="div_toggle" style="display: none;">
<label class="sup">
<input type="checkbox" id="toggle">
<input type="checkbox" autocomplete='off' id="toggle">
<div class="slider">
<svg class="svg1" version="2" width="1.5em" height="1.5em" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M440.14,302.07c-20.52,81-93.9,140.93-181.28,140.93c-103.28,0-187-83.72-187-187s83.72-187,187-187 c2.77,0,5.54,0.06,8.28,0.18c-32.11,26.65-52.55,66.85-52.55,111.83c0,80.22,65.03,145.25,145.25,145.25 C389.52,326.27,417.14,317.36,440.14,302.07z"/>
Expand All @@ -162,9 +166,6 @@
let div_button = document.getElementById('div_toggle');
div_button.style.display = 'block';

let toggle = document.querySelector(".sup");
toggle.style.display = "none";


}
</script>
Expand Down Expand Up @@ -396,8 +397,6 @@ <h3 id="send-us-directly-your-files-open_file_folder">Send us directly your file


if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
let toggle_label = document.querySelector(".sup");
toggle_label.style.display = "inline-block";

let switcher = document.querySelector(".div_switch input");
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
Expand All @@ -406,8 +405,7 @@ <h3 id="send-us-directly-your-files-open_file_folder">Send us directly your file
switcher.checked = true;
}
}

document.querySelector('html').style.display = "block";

}

</script>
Expand Down
14 changes: 6 additions & 8 deletions public/contribute/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
<link rel="stylesheet" type="text/css" href="/style.css" crossorigin="anonymous">
<script>

if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
document.querySelector('html').style.display = "block";
}

document.addEventListener("DOMContentLoaded", () => {

let switcher = document.querySelector(".div_switch input");
Expand Down Expand Up @@ -132,7 +136,7 @@

<div class="div_switch" id="div_toggle" style="display: none;">
<label class="sup">
<input type="checkbox" id="toggle">
<input type="checkbox" autocomplete='off' id="toggle">
<div class="slider">
<svg class="svg1" version="2" width="1.5em" height="1.5em" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M440.14,302.07c-20.52,81-93.9,140.93-181.28,140.93c-103.28,0-187-83.72-187-187s83.72-187,187-187 c2.77,0,5.54,0.06,8.28,0.18c-32.11,26.65-52.55,66.85-52.55,111.83c0,80.22,65.03,145.25,145.25,145.25 C389.52,326.27,417.14,317.36,440.14,302.07z"/>
Expand All @@ -150,9 +154,6 @@
let div_button = document.getElementById('div_toggle');
div_button.style.display = 'block';

let toggle = document.querySelector(".sup");
toggle.style.display = "none";


}
</script>
Expand Down Expand Up @@ -210,8 +211,6 @@ <h4 id="list-of-contributors-in-chronological-order">List of contributors in chr


if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
let toggle_label = document.querySelector(".sup");
toggle_label.style.display = "inline-block";

let switcher = document.querySelector(".div_switch input");
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
Expand All @@ -220,8 +219,7 @@ <h4 id="list-of-contributors-in-chronological-order">List of contributors in chr
switcher.checked = true;
}
}

document.querySelector('html').style.display = "block";

}

</script>
Expand Down
14 changes: 6 additions & 8 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
<link rel="stylesheet" type="text/css" href="/style.css" crossorigin="anonymous">
<script>

if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
document.querySelector('html').style.display = "block";
}

document.addEventListener("DOMContentLoaded", () => {

let switcher = document.querySelector(".div_switch input");
Expand Down Expand Up @@ -143,7 +147,7 @@

<div class="div_switch" id="div_toggle" style="display: none;">
<label class="sup">
<input type="checkbox" id="toggle">
<input type="checkbox" autocomplete='off' id="toggle">
<div class="slider">
<svg class="svg1" version="2" width="1.5em" height="1.5em" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M440.14,302.07c-20.52,81-93.9,140.93-181.28,140.93c-103.28,0-187-83.72-187-187s83.72-187,187-187 c2.77,0,5.54,0.06,8.28,0.18c-32.11,26.65-52.55,66.85-52.55,111.83c0,80.22,65.03,145.25,145.25,145.25 C389.52,326.27,417.14,317.36,440.14,302.07z"/>
Expand All @@ -161,9 +165,6 @@
let div_button = document.getElementById('div_toggle');
div_button.style.display = 'block';

let toggle = document.querySelector(".sup");
toggle.style.display = "none";


}
</script>
Expand Down Expand Up @@ -701,8 +702,6 @@ <h1 id="extra">Extra</h1>


if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
let toggle_label = document.querySelector(".sup");
toggle_label.style.display = "inline-block";

let switcher = document.querySelector(".div_switch input");
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
Expand All @@ -711,8 +710,7 @@ <h1 id="extra">Extra</h1>
switcher.checked = true;
}
}

document.querySelector('html').style.display = "block";

}

</script>
Expand Down
14 changes: 6 additions & 8 deletions public/licenses/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
<link rel="stylesheet" type="text/css" href="/style.css" crossorigin="anonymous">
<script>

if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
document.querySelector('html').style.display = "block";
}

document.addEventListener("DOMContentLoaded", () => {

let switcher = document.querySelector(".div_switch input");
Expand Down Expand Up @@ -136,7 +140,7 @@

<div class="div_switch" id="div_toggle" style="display: none;">
<label class="sup">
<input type="checkbox" id="toggle">
<input type="checkbox" autocomplete='off' id="toggle">
<div class="slider">
<svg class="svg1" version="2" width="1.5em" height="1.5em" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M440.14,302.07c-20.52,81-93.9,140.93-181.28,140.93c-103.28,0-187-83.72-187-187s83.72-187,187-187 c2.77,0,5.54,0.06,8.28,0.18c-32.11,26.65-52.55,66.85-52.55,111.83c0,80.22,65.03,145.25,145.25,145.25 C389.52,326.27,417.14,317.36,440.14,302.07z"/>
Expand All @@ -154,9 +158,6 @@
let div_button = document.getElementById('div_toggle');
div_button.style.display = 'block';

let toggle = document.querySelector(".sup");
toggle.style.display = "none";


}
</script>
Expand Down Expand Up @@ -213,8 +214,6 @@ <h3 id="external-links">External links</h3>


if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
let toggle_label = document.querySelector(".sup");
toggle_label.style.display = "inline-block";

let switcher = document.querySelector(".div_switch input");
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
Expand All @@ -223,8 +222,7 @@ <h3 id="external-links">External links</h3>
switcher.checked = true;
}
}

document.querySelector('html').style.display = "block";

}

</script>
Expand Down
14 changes: 6 additions & 8 deletions public/report-a-copyright-violation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
<link rel="stylesheet" type="text/css" href="/style.css" crossorigin="anonymous">
<script>

if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
document.querySelector('html').style.display = "block";
}

document.addEventListener("DOMContentLoaded", () => {

let switcher = document.querySelector(".div_switch input");
Expand Down Expand Up @@ -136,7 +140,7 @@

<div class="div_switch" id="div_toggle" style="display: none;">
<label class="sup">
<input type="checkbox" id="toggle">
<input type="checkbox" autocomplete='off' id="toggle">
<div class="slider">
<svg class="svg1" version="2" width="1.5em" height="1.5em" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M440.14,302.07c-20.52,81-93.9,140.93-181.28,140.93c-103.28,0-187-83.72-187-187s83.72-187,187-187 c2.77,0,5.54,0.06,8.28,0.18c-32.11,26.65-52.55,66.85-52.55,111.83c0,80.22,65.03,145.25,145.25,145.25 C389.52,326.27,417.14,317.36,440.14,302.07z"/>
Expand All @@ -154,9 +158,6 @@
let div_button = document.getElementById('div_toggle');
div_button.style.display = 'block';

let toggle = document.querySelector(".sup");
toggle.style.display = "none";


}
</script>
Expand Down Expand Up @@ -274,8 +275,6 @@ <h2 id="-nbspreport-a-copyright-violation">🇬🇧  Report a copyright violati


if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
let toggle_label = document.querySelector(".sup");
toggle_label.style.display = "inline-block";

let switcher = document.querySelector(".div_switch input");
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
Expand All @@ -284,8 +283,7 @@ <h2 id="-nbspreport-a-copyright-violation">🇬🇧  Report a copyright violati
switcher.checked = true;
}
}

document.querySelector('html').style.display = "block";

}

</script>
Expand Down

0 comments on commit 7a0991c

Please sign in to comment.