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

Use logo in navbar instead of text (and mobile improvements) #39

Merged
merged 4 commits into from
Sep 2, 2020
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
3 changes: 1 addition & 2 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<nav id="top" class="top-bar">
<div class="top-bar-inner flex flex-items-baseline flex-space-between">
<div class="sites links flex flex-items-baseline">
<a href="/" class="sites-current">Alt-F4</a>
<span class="separator separator-blue">|</span>
<a href="/" class="sites-current"><div id="navbar-logo" role="img" aria-label="Alt-F4 Logo"></div></a>
<a href="https://discord.gg/AsXAwyV" class="">Discord</a>
<span class="separator separator-blue">|</span>
<a href="https://factorio.com/blog" class="">FFF</a>
Expand Down
60 changes: 60 additions & 0 deletions _sass/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,63 @@
font-size: 30px;
margin-top: -5px;
}

#navbar-logo {
height: 30px; /* Size of logo image(s) */
width: 120px;

background-image: url("/assets/GLOBAL/img/Alt-F4-logo_white.png");

background-repeat: no-repeat; /* Size the image correctly */
background-size: cover;

vertical-align: middle; /* Centering the div */
transform: translateY(-5%);

display: inline-block;

margin-right: 30px; /* Gap between links to the right */
}

#navbar-logo:hover {
background-image: url("/assets/GLOBAL/img/Alt-F4-logo_colour.png"); /* Switch to orange coloured logo on hover */
}

@media (max-width: 500px) {
/* Shrink logo, gap between logo and links and the nav bar itself slightly */

#navbar-logo {
height: 20px; /* Shrink logo on smaller screens */
width: 80px;

margin-right: 15px; /* Shrink gap between logo and links as well */
}

.top-bar {
padding: 12px; /* Reduce padding slightly (by 4px) as well */
}


/* Shrink the translation button */

.fa-language {
height: 20px; /* Shrink the language icon */
}

.top-bar .dropdown .button { /* Shrink the button itself */
min-height: 20px;
min-width: 45px;

padding: 7px 9px;
}

.top-bar .dropdown .button:active,
.top-bar .dropdown .button.active {
margin: 0; /* Disable desktop button navbar bump fix, it causes the bump on mobile */
}
}

body:after { /* For preloading the hover image so it does not flicker on first hover */
display: none;
content: url("/assets/GLOBAL/img/Alt-F4-logo_colour.png");
}
Binary file added assets/GLOBAL/img/Alt-F4-logo_colour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/GLOBAL/img/Alt-F4-logo_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.