Add header files

This commit is contained in:
Avijit 🚀
2021-05-24 18:11:05 +02:00
parent 6d14eab549
commit 395f02a96e
3 changed files with 125 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<div class="container wrapper">
<div class="header header-dark" id="header-sroll">
<nav class="header-nav">
<div class="avatar">
<a href=".Site.BaseURL">
<img src=".Site.Params.Avatar" alt=" Avatar" />
</a>
</div>
<div class="nav-title">
<a class="nav-brand" href="https://shantanugoel.com">Title title</a>
</div>
</nav>
</div>
</div>

View File

@@ -0,0 +1,98 @@
html {
font-family: open sans, helvetica neue, Helvetica, Arial, sans-serif;
}
.container {
height: 800px;
}
.header-light {
background-color: #bbb;
color: black;
}
.header-dark {
background-color: #1b1c1d;
color: white;
}
.header {
position: fixed;
height: 100px;
left: 0;
top: 0;
width: 100%;
-ms-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-webkit-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
}
.header.small {
height: 70px;
}
/* #header-sroll h1 {
font-size: 30px;
font-family: Arial;
text-align: center;
line-height: 50px;
-ms-transition: all 0.2s ease-out;
-moz-transition: all 0.2s ease-out;
-webkit-transition: all 0.2s ease-out;
-o-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
}
#header-sroll.small h1{
height: 70px;
line-height: 35px;
font-size: 25px;
}
*/
.header a {
text-decoration: none;
color: inherit;
}
.header .header-nav {
height: 64px;
margin-top: 18px;
-ms-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-webkit-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
}
.header .header-nav.small {
margin-top: 0;
}
.header-nav .avatar {
float: left;
display: inline-block;
height: 100%;
border: 0.5px solid white;
border-radius: 18px;
}
.header-nav .avatar img {
display: block;
width: 64px;
height: 64px;
overflow: hidden;
border-radius: 100%;
}
.header-nav .nav-title {
display: inline-block;
padding-left: 10px;
height: 100%;
line-height: 60px;
}
.nav-title a {
height: 50px;
font-size: 20px;
}

View File

@@ -0,0 +1,10 @@
$(window).scroll(function () {
var sc = $(window).scrollTop()
if (sc > 100) {
$(".header").addClass("small");
$(".header-nav").addClass("small");
} else {
$(".header").removeClass("small");
$(".header-nav").removeClass("small");
}
});