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

Add Logo option UwU #292

Merged
merged 10 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions site/css/hl.css
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,21 @@ img {
max-width: 100%;
height: auto; }

.alternative-logo {
filter: drop-shadow(0px 0px 1px black);
padding-right: 40px; }

.alternative-logo-visible {
display: none; }

.alternative-logo .alternative-logo-visible,.alternative-logo-hidden {
display: block;
max-width: 100%;
height: auto; }

.alternative-logo .alternative-logo-hidden {
display: none; }

.img-rounded {
border-radius: 6px; }

Expand Down
Binary file added site/img/haskell-uwu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
<div class="row">
<div class=" span6 col-md-6">
<div class="branding">
<br class="hidden-xs">
<img src="/img/haskell-logo.svg" alt="Haskell" class="img-responsive">
<br class="hidden-xs alternative-logo-hidden">
<img src="/img/haskell-logo.svg" alt="Haskell" class="img-responsive alternative-logo-hidden">
<img src="/img/haskell-uwu.png" alt="Haskell UwU" class="alternative-logo alternative-logo-visible">
<h4 class="summary">An advanced, purely functional programming language</h4>
</div>
</div>
Expand Down
35 changes: 35 additions & 0 deletions site/templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,41 @@
<link rel="stylesheet" href="/css/hl.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/glider-js@1/glider.min.css">
<script src="https://cdn.jsdelivr.net/npm/glider-js@1/glider.min.js"></script>
<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) { }
})();
</script>
</head>
<body class="page-$page$">
<div class="wrap">
Expand Down
Loading