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

IMPROVED PLANET NAVBAR #3513

Merged
merged 14 commits into from
Jan 4, 2024
6 changes: 6 additions & 0 deletions planet/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,9 @@ a {
justify-content: space-between;
}

.nav-extended {
position: sticky;
top: 0;
z-index: 100;
}

34 changes: 28 additions & 6 deletions planet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@
<script type="text/javascript" src="js/Planet.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</head>
<script>
document.addEventListener("scroll", function () {
var navbar = document.querySelector(".nav-extended");
if (document.body.scrollTop > 210 || document.documentElement.scrollTop > 210) {
navbar.classList.remove("lighten-1");
}
else{
navbar.classList.add("lighten-1");
sivangbagri marked this conversation as resolved.
Show resolved Hide resolved
}
});
</script>

<body>
<nav class="nav-extended light-green lighten-1" role="navigation">
Expand All @@ -52,14 +63,25 @@
<ul class="right tabs tabs-transparent" id="localglobal">
<li class="tab"><a class="active" id="local-tab" href="#local"></a></li>
<li class="tab"><a id="global-tab" href="#global"></a></li>
<li>
<li>
<div class="nav-content" id="searchcontainer"
style="display: none;">
sivangbagri marked this conversation as resolved.
Show resolved Hide resolved
<div class="container">
<div class="input-field search">
<i class="material-icons prefix "
id="searchicon">search</i><input
placeholder="" id="global-search"
type="text"><span><i
sivangbagri marked this conversation as resolved.
Show resolved Hide resolved
class="material-icons"
id="search-close">clear</i></span>
</div>
</div>
</div>
</li>
</li>
</ul>
</div>
<div class="nav-content" id="searchcontainer" style="display: none;">
<div class="container">
<div class="input-field search">
<i class="material-icons prefix" id="searchicon">search</i><input placeholder="" id="global-search" type="text"><span><i class="material-icons" id="search-close">clear</i></span>
</div>
</div>
</div>
</nav>

Expand Down
Loading