mirror of
https://github.com/RetroDECK/RetroDECK-Website.git
synced 2024-11-25 08:05:38 +00:00
Add accesibility toggle for pixel fonts
This commit is contained in:
parent
321493a392
commit
4d03b47d97
|
@ -1,4 +1,5 @@
|
||||||
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");
|
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");
|
||||||
|
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap');
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Upheaval TT";
|
font-family: "Upheaval TT";
|
||||||
src: url("../assets/fonts/upheavtt.ttf");
|
src: url("../assets/fonts/upheavtt.ttf");
|
||||||
|
|
|
@ -248,7 +248,8 @@
|
||||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
||||||
crossorigin="anonymous"></script>
|
crossorigin="anonymous"></script>
|
||||||
<!-- <script src="scripts/gradient.js"></script> -->
|
<!-- <script src="scripts/gradient.js"></script> -->
|
||||||
<script src="scripts/features.js"></script>
|
<!-- <script src="scripts/features.js"></script> -->
|
||||||
|
<script src="scripts/accessibility.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
10
scripts/accessibility.js
Normal file
10
scripts/accessibility.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
function pixelFontToggle() {
|
||||||
|
const pixelFontDefault = "\"Upheaval TT\", monospace;"
|
||||||
|
|
||||||
|
const pixelFontSwitchElem = document.getElementById("pixel-font-switch");
|
||||||
|
if (pixelFontSwitchElem.checked) {
|
||||||
|
document.documentElement.style.cssText = "--pixel-font: \"Upheaval TT\", monospace";
|
||||||
|
} else {
|
||||||
|
document.documentElement.style.cssText = "--pixel-font: \"Source Sans 3\", sans-serif";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue