feat: Add ability to toggle background color

This commit is contained in:
jstoobysmith 2025-02-07 14:20:59 +00:00
parent 928b7e9e43
commit b82791d671

View file

@ -12,6 +12,19 @@ layout: default
<script type="text/javascript" charset="UTF-8" <script type="text/javascript" charset="UTF-8"
src="../assets/css/lean.min.js"></script> src="../assets/css/lean.min.js"></script>
<script>hljs.highlightAll();</script> <script>hljs.highlightAll();</script>
<!--- Toggle background color. -->
<script>
let isDefaultBackground = true;
function toggleDyslexiaMode() {
document.body.style.backgroundColor = isDefaultBackground ? '#f4ecd8' : '#ffffff';
isDefaultBackground = !isDefaultBackground;
}
</script>
<div style="text-align: right;">
<a href="#" onclick="toggleDyslexiaMode(); return false;" style="color: #2c5282; text-decoration: underline; cursor: pointer;">
Toggle background color
</a>
</div>
<!-- Note header (title, curators, notice etc.). --> <!-- Note header (title, curators, notice etc.). -->
<center><h1 style="font-size: 50px;">{{ site.data.perturbationTheory.title }}</h1></center> <center><h1 style="font-size: 50px;">{{ site.data.perturbationTheory.title }}</h1></center>
<center><h2 style="font-size: 20px;">Note Authors: {{ site.data.perturbationTheory.curators }}</h2></center> <center><h2 style="font-size: 20px;">Note Authors: {{ site.data.perturbationTheory.curators }}</h2></center>
@ -68,7 +81,7 @@ layout: default
{% endif %} {% endif %}
{% if entry.type == "name" %} {% if entry.type == "name" %}
<div style="background-color: #ffff; padding: 10px; border-radius: 4px;"> <div style=" padding: 10px; border-radius: 4px;">
<b id="decl-{{ entry.declNo }}"> <b id="decl-{{ entry.declNo }}">
<a href="#decl-{{ entry.declNo }}" style="color: black;"> <a href="#decl-{{ entry.declNo }}" style="color: black;">
{% if entry.isDef %}Definition{% else %}Theorem{% endif %} {{ entry.declNo }}</a></b> {% if entry.isDef %}Definition{% else %}Theorem{% endif %} {{ entry.declNo }}</a></b>