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

transparent navbar #613

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 1 deletion assets/css/darkmode.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,6 @@ body.light .hacktober-heading {
}

body.light .card {
background-color: #eff2f5;
/* background-color: #eff2f5; */
background-color: rgba(0, 15, 15, 0.5);
}
16 changes: 10 additions & 6 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,15 @@ h6 {
--------------------------------------------------------------*/

#header {
height: 80px;
transition: all 0.5s;
z-index: 997;
background: var(--bar);
box-shadow: 0px 6px 9px 0px rgba(0, 0, 0, 0.06);
position: fixed;
transition: all ease 0.5s;
background-color: rgba(0, 15, 15, 0.1); /* Transparent background */
margin-left: -18px;
padding: 18px;
border-radius: 10px;
transform: translateY(0);
top: 0;
width: 100%;
}

#header #logo h1 {
Expand Down Expand Up @@ -356,7 +360,7 @@ h6 {
position: relative;
background: url("../img/hero-carousel/1.jpg") no-repeat;
background-size: cover;
padding: 0;
padding:0;
}

#hero .hero-content {
Expand Down
19 changes: 19 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
position: fixed;
z-index: 999999;
}

</style>

</head>
Expand Down Expand Up @@ -554,6 +555,24 @@ <h4>Made with ❤️ by CodeSetGo Team</h4>
function myFunction() {
preloader.style.display = "none";
}

var prevScrollpos = window.pageYOffset;
var header = document.getElementById("header");
var navbarHeight = header.offsetHeight;
var scrollThreshold = 200;


window.onscroll = function() {
var currentScrollPos = window.pageYOffset;

if (window.scrollY > 200) {
if (window.scrollY > prevScrollpos) {
header.style.top = '-100px';
}
}else{
header.style.top='0px'
}
};
</script>
</body>

Expand Down