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 alternative logo (pride) #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions site/css/hl.css
Original file line number Diff line number Diff line change
Expand Up @@ -294,18 +294,19 @@ img {
max-width: 100%;
height: auto; }

.alternative-logo {
.alternative-logo-pride,
.alternative-logo-uwu {
filter: drop-shadow(0px 0px 1px black); }

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

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

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

.img-rounded {
Expand Down
1 change: 1 addition & 0 deletions site/img/haskell-pride.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="branding">
<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">
<img src="" alt="Haskell" id="alternative-logo">
<h4 class="summary">An advanced, purely functional programming language</h4>
</div>
</div>
Expand Down
32 changes: 22 additions & 10 deletions site/templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,28 @@
<script>
(function () {
try {
const isUwuValue = window.location
&& window.location.search
&& window.location.search.match(/uwu=(true|false)/);

if (isUwuValue) {
const isUwu = isUwuValue[1] === 'true';
if (isUwu) {
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');
const altLogos = {
pride: {
src: 'haskell-pride.svg',
credit: 'logo credit to @rhendric and the official Haskell logo designers',
},
uwu: {
src: 'haskell-uwu.png',
credit: 'logo credit to @sawaratsuki1004. Slightly tweaked by @Tritlo',
},
};
const params = new URLSearchParams(window.location.search);
for (const name in altLogos) {
const isEnabled = params.get(name);
if (isEnabled === 'true') {
document.documentElement.classList.add('with-alternative-logo');
document.addEventListener('DOMContentLoaded', function () {
const img = document.getElementById('alternative-logo');
img.setAttribute('src', '/img/' + altLogos[name].src);
img.classList.add('alternative-logo-' + name);
});
console.log('alternative logo enabled. turn off with ?' + name + '=false')
console.log(altLogos[name].credit);
}
}
} catch (err) { }
Expand Down
Loading