Skip to content
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
24 changes: 14 additions & 10 deletions resources/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,20 @@
<body>

<header>
<img id="imgLogo" draggable=false
src="<?php echo getURL("assets", CONFIG["site"]["logo"]); ?>" alt="Unity Logo">
<button class="hamburger vertical-align">
<img
draggable="false"
src="<?php echo getURL("assets/menu.png") ?>"
alt="Menu Button"
>
</button>
</header>
<img
id="imgLogo"
draggable=false
src="<?php echo getURL("assets", CONFIG["site"]["logo"]); ?>"
alt="Unity Logo"
>
<button class="hamburger">
<img
draggable="false"
src="<?php echo getURL("assets/menu.png") ?>"
alt="Menu Button"
>
</button>
</header>

<nav class="mainNav">
<?php
Expand Down
6 changes: 0 additions & 6 deletions webroot/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ p {
margin: 0;
}

.vertical-align {
position: absolute;
top: 50%;
transform: translateY(-50%);
}

button.plusBtn span {
font-size: 24pt;
font-family: monospace;
Expand Down
54 changes: 27 additions & 27 deletions webroot/css/navbar.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/* Navbar */

:root {
--header-height: 50px;
}

hr.navHR {
margin-left: 10px;
margin-right: 10px;
}

nav.mainNav {
background: var(--accent);
position: fixed;
left: 0;
top: 45px;
font-size: 11pt;
overflow: hidden;
white-space: nowrap;
z-index: 100;
z-index: 9;
}

nav.mainNav a {
Expand All @@ -39,11 +39,7 @@ nav.mainNav a.active {

header {
background: var(--accent);
height: 50px;
width: 250px;
position: fixed;
top: 0;
left: 0;
height: var(--header-height);
z-index: 10;
}

Expand Down Expand Up @@ -73,49 +69,53 @@ header > a.unity-state:hover {
header > button.hamburger {
background: var(--accent);
padding: 0;
right: 23px;
height: 60%;
float: right;
}

header > button.hamburger > img {
position: relative;
height: 100%;
height: calc(var(--header-height) * 0.6);
margin-top: calc(var(--header-height) * 0.2);
margin-right: calc(var(--header-height) * 0.2);
}

/* MOBILE VIEW */

@media only screen and (max-width: 1000px) {
nav.mainNav {
right: 0;
}

header {
width: 100%;
}

main {
/* Header element height + 2*element padding */
margin-top: 45px;
}
}

/* DESKTOP VIEW */

@media only screen and (min-width: 1001px) {
:root {
--navbar-width: 250px;
}

nav.mainNav {
bottom: 0;
width: 250px;
position: fixed;
width: var(--navbar-width);
padding-top: var(--header-height);
height: 100%;
Comment on lines +98 to +100

Copilot AI Jan 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixed positioned nav.mainNav is missing left: 0 and top: 0 properties that were removed from the original code. Without left: 0, the navbar may not be anchored to the left edge of the viewport. Additionally, using height: 100% with padding-top: var(--header-height) will cause the total element height to exceed the viewport (100% + 50px), creating unwanted overflow. Consider restoring left: 0 and using either top: 0; bottom: 0; (removing the height property) or height: calc(100% - var(--header-height)) instead.

Suggested change
width: var(--navbar-width);
padding-top: var(--header-height);
height: 100%;
top: 0;
left: 0;
bottom: 0;
width: var(--navbar-width);
padding-top: var(--header-height);

Copilot uses AI. Check for mistakes.
}

header > button.hamburger {
display: none;
}

main {
margin-left: 250px;
margin-left: var(--navbar-width);
}

footer {
margin-left: 250px;
margin-left: var(--navbar-width);
}

header {
width: var(--navbar-width);
position: fixed;
top: 0;
left: 0;
}
}
16 changes: 1 addition & 15 deletions webroot/js/global-late.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,7 @@
}

$("button.hamburger").on("click", function () {
var mainNav = $("nav.mainNav");
if (mainNav.is(":visible")) {
mainNav.fadeOut(100);
} else {
mainNav.fadeIn(100);
}
});

$(window).click(function (e) {
if (
!$(e.target).parent().hasClass("hamburger") &&
$("button.hamburger").is(":visible")
) {
$("nav.mainNav").fadeOut(100);
}
$("nav.mainNav").toggle();
});

// Functions to set nav links as active. Sub links can activate parents by naming files with same prefix, for example: documentation.php and documentation_view.php activate the same link
Expand Down
Loading