Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable alternative logo only when the parameter is present #295

Merged
merged 1 commit into from
May 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading