Merge pull request 'Add nyan-cat easter egg' (#36) from nyan-cat into master

Reviewed-on: #36
This commit is contained in:
Aaron van Geffen 2023-11-11 12:05:11 +01:00
commit ad2f6a964e
3 changed files with 21 additions and 1 deletions

View File

@ -147,6 +147,21 @@ i.space-invader.alt-6::before {
i.space-invader.alt-7::before { i.space-invader.alt-7::before {
content: 'O'; content: 'O';
} }
i.nyan-cat {
background-image: url('../images/nyan-cat.gif');
background-position: 0 -25px;
background-size: cover;
display: inline-block;
height: 85px;
left: -40px;
position: absolute;
top: -5px;
transform: rotate(-5deg);
transition: 0.25s;
width: 110px;
}
@media (max-width: 991px) { @media (max-width: 991px) {
.navbar-brand { .navbar-brand {
padding-left: 60px; padding-left: 60px;
@ -157,6 +172,10 @@ i.space-invader.alt-7::before {
top: -7px; top: -7px;
width: 70px; width: 70px;
} }
i.nyan-cat {
left: -57px;
top: -7px;
}
} }

BIN
public/images/nyan-cat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -20,12 +20,13 @@ class MainNavBar extends NavBar
// Select a random space invader, with a bias towards the mascot // Select a random space invader, with a bias towards the mascot
$rnd = rand(0, 100); $rnd = rand(0, 100);
$alt = $rnd > 50 ? ' alt-' . ($rnd % 6 + 1) : ''; $alt = $rnd > 50 ? ' alt-' . ($rnd % 6 + 1) : '';
$className = $rnd > 5 ? 'space-invader' . $alt : 'nyan-cat';
echo ' echo '
<nav id="', $this->outerMenuId, '" class="navbar navbar-expand-lg ', $this->navBarClasses, '" aria-label="', $this->ariaLabel, '"> <nav id="', $this->outerMenuId, '" class="navbar navbar-expand-lg ', $this->navBarClasses, '" aria-label="', $this->ariaLabel, '">
<div class="container"> <div class="container">
<a class="navbar-brand flex-grow-1" href="', BASEURL, '/"> <a class="navbar-brand flex-grow-1" href="', BASEURL, '/">
<i class="space-invader', $alt, '"></i> <i class="', $className, '"></i>
HashRU Pics HashRU Pics
</a> </a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#', $this->innerMenuId, '" aria-controls="', $this->innerMenuId, '" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#', $this->innerMenuId, '" aria-controls="', $this->innerMenuId, '" aria-expanded="false" aria-label="Toggle navigation">