Skip to content

Commit fe5a546

Browse files
committed
Add alternative logo (retro)
1 parent b92b5a9 commit fe5a546

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed

Diff for: site/css/hl.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -294,18 +294,18 @@ img {
294294
max-width: 100%;
295295
height: auto; }
296296

297-
.alternative-logo {
297+
.alternative-logo-uwu {
298298
filter: drop-shadow(0px 0px 1px black); }
299299

300-
.alternative-logo-visible {
300+
#alternative-logo {
301301
display: none; }
302302

303-
.alternative-logo .alternative-logo-visible,.alternative-logo-hidden {
303+
.with-alternative-logo #alternative-logo,.alternative-logo-hidden {
304304
display: block;
305305
max-width: 100%;
306306
height: auto; }
307307

308-
.alternative-logo .alternative-logo-hidden {
308+
.with-alternative-logo .alternative-logo-hidden {
309309
display: none; }
310310

311311
.img-rounded {

Diff for: site/img/haskell-retro.gif

322 KB
Loading

Diff for: site/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="branding">
1414
<br class="hidden-xs alternative-logo-hidden">
1515
<img src="/img/haskell-logo.svg" alt="Haskell" class="img-responsive alternative-logo-hidden">
16-
<img src="/img/haskell-uwu.png" alt="Haskell UwU" class="alternative-logo alternative-logo-visible">
16+
<img src="" alt="Haskell" id="alternative-logo">
1717
<h4 class="summary">An advanced, purely functional programming language</h4>
1818
</div>
1919
</div>

Diff for: site/templates/default.html

+22-10
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,28 @@
1515
<script>
1616
(function () {
1717
try {
18-
const isUwuValue = window.location
19-
&& window.location.search
20-
&& window.location.search.match(/uwu=(true|false)/);
21-
22-
if (isUwuValue) {
23-
const isUwu = isUwuValue[1] === 'true';
24-
if (isUwu) {
25-
document.documentElement.classList.add('alternative-logo');
26-
console.log('alternative logo enabled. turn off with ?uwu=false')
27-
console.log('logo credit to @sawaratsuki1004. Slightly tweaked by @Tritlo');
18+
const altLogos = {
19+
retro: {
20+
src: 'haskell-retro.gif',
21+
credit: 'logo credit to @rhendric and the official Haskell logo designers',
22+
},
23+
uwu: {
24+
src: 'haskell-uwu.png',
25+
credit: 'logo credit to @sawaratsuki1004. Slightly tweaked by @Tritlo',
26+
},
27+
};
28+
const params = new URLSearchParams(window.location.search);
29+
for (const name in altLogos) {
30+
const isEnabled = params.get(name);
31+
if (isEnabled === 'true') {
32+
document.documentElement.classList.add('with-alternative-logo');
33+
document.addEventListener('DOMContentLoaded', function () {
34+
const img = document.getElementById('alternative-logo');
35+
img.setAttribute('src', '/img/' + altLogos[name].src);
36+
img.classList.add('alternative-logo-' + name);
37+
});
38+
console.log('alternative logo enabled. turn off with ?' + name + '=false')
39+
console.log(altLogos[name].credit);
2840
}
2941
}
3042
} catch (err) { }

0 commit comments

Comments
 (0)