diff --git a/tilde.js b/tilde.js index cae0710..0aded5d 100644 --- a/tilde.js +++ b/tilde.js @@ -1,8 +1,8 @@ (() => { /* DOM */ - const ascii = document.getElementById('pref-ascii'); - const force = document.getElementById('pref-force'); - const themeRadios = document.getElementsByName('pref-theme'); + const ascii = document.getElementById("pref-ascii"); + const force = document.getElementById("pref-force"); + const themeRadios = document.getElementsByName("pref-theme"); const bodyClass = document.body.classList; /* localStorage management */ @@ -10,16 +10,16 @@ const getPref = (pref) => localStorage.getItem(lsn + pref); const setPref = (pref, value) => localStorage.setItem(lsn + pref, value); const getPrefs = () => ({ - prefASCII: getPref('ascii') === 'true', - prefForce: getPref('force') === 'true', - prefTheme: getPref('theme') || 'dark', + prefASCII: getPref("ascii") === "true", + prefForce: getPref("force") === "true", + prefTheme: getPref("theme") || "dark", }); /* Update the state of the document based on client preferences. */ const renderPreferences = () => { const { prefASCII, prefForce, prefTheme } = getPrefs(); if(prefASCII) { - bodyClass.add('ascii'); + bodyClass.add("ascii"); ascii.checked = "checked"; } if(prefForce) { @@ -37,8 +37,8 @@ /* ASCII aesthetic intensifies */ ascii.onchange = (evt) => { const { prefASCII } = getPrefs(); - bodyClass.toggle('ascii'); - setPref('ascii', (!prefASCII).toString()); + bodyClass.toggle("ascii"); + setPref("ascii", (!prefASCII).toString()); }; /* Manage theme forcing behavior */ @@ -50,13 +50,13 @@ if (nextForce) { bodyClass.add(prefTheme); } - setPref('force', nextForce.toString()) + setPref("force", nextForce.toString()) }; /* Manage theme selection */ themeRadios.forEach(radio => radio.onchange = () => { const { prefForce } = getPrefs(); - setPref('theme', radio.value); + setPref("theme", radio.value); if(prefForce) { themes.forEach(theme => bodyClass.remove(theme)); bodyClass.add(radio.value); diff --git a/title.html b/title.html new file mode 100644 index 0000000..2d6d088 --- /dev/null +++ b/title.html @@ -0,0 +1,45 @@ + + +
+ + + + +