Skip to content

Commit

Permalink
Merge pull request #295 from haskell-infra/no-logo-persistence
Browse files Browse the repository at this point in the history
Enable alternative logo only when the parameter is present
  • Loading branch information
Tritlo authored May 5, 2024
2 parents ee8d2c3 + c39ef4c commit 067226e
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions site/templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,17 @@
<script>
(function () {
try {
var preferredUwu = false;
// localStorage might be inaccessible due to device permissions,
// hence the try-catch.
try {
preferredUwu = localStorage.getItem('uwu');
} catch (err) {} ;

const isUwuValue = window.location
&& window.location.search
&& window.location.search.match(/uwu=(true|false)/);

if (isUwuValue) {
const isUwu = isUwuValue[1] === 'true';
if (isUwu) {
try {
localStorage.setItem('uwu', true);
} catch (err) {} ;

document.documentElement.classList.add('alternative-logo');
console.log('alternative logo enabled. turn off with ?uwu=false')
console.log('logo credit to @sawaratsuki1004. Slightly tweaked by @Tritlo');
} else {
try {
localStorage.removeItem('uwu', false);
} catch (err) {} ;
}
} else if (preferredUwu) {
document.documentElement.classList.add('alternative-logo');
}
} catch (err) { }
})();
Expand Down

0 comments on commit 067226e

Please sign in to comment.