Skip to content

Commit

Permalink
Merge pull request #292 from HEIGE-PCloud/uwu
Browse files Browse the repository at this point in the history
Add an alternative-logo when the uwu=true parameter is passed
  • Loading branch information
Tritlo authored May 5, 2024
2 parents 9213023 + 3f0989e commit de64b89
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 2 deletions.
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

0 comments on commit de64b89

Please sign in to comment.