Skip to content

Commit

Permalink
IMPROVED PLANET NAVBAR (#3513)
Browse files Browse the repository at this point in the history
* Fixed inconsistencies in Gloabl Card width

* Fixed inconsistency in likes

* Removed console msgs

* Fixed

* Fixed

* Fixed

* merge

* improved global navbar

* checks and improvement
  • Loading branch information
sivangbagri authored Jan 4, 2024
1 parent 8d3db90 commit 619910c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
9 changes: 9 additions & 0 deletions planet/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,12 @@ a {
justify-content: space-between;
}

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

.nav-content {
display: none;
}
35 changes: 29 additions & 6 deletions planet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@
<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 (navbar){
if (document.body.scrollTop > 210 || document.documentElement.scrollTop > 210) {
navbar.classList.remove("lighten-1");
}
else{
navbar.classList.add("lighten-1");
}
}
});
</script>

<body>
<nav class="nav-extended light-green lighten-1" role="navigation">
Expand All @@ -52,14 +65,24 @@
<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">
<div class="container">
<div class="input-field search">
<i class="material-icons prefix "
id="searchicon">search</i><input
placeholder="Search here" id="global-search"
type="text"><span><i
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
2 changes: 1 addition & 1 deletion planet/js/GlobalCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,4 @@ function copyURLToClipboard() {
// eslint-disable-next-line no-console
console.error("Failed to copy:", e.action);
});
}
}

0 comments on commit 619910c

Please sign in to comment.