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
58 changes: 42 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,36 @@
<head>
<meta charset="utf-8">
<title>Developer Students Club|Navarachna University</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
<link rel="stylesheet" type="text/css" href="main.css">



</head>

<body>

<header>

<a href="#" class="logo"><img src="images/logo-full.png"></a>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#Motto">About</a></li>
<li><a href="#Updates">Updates</a></li>
<li><a href="#Contact-Us">Contact</a></li>
</ul>
</header>

<nav class="navbar">
<div class="content">
<div class="logo">
<a href="#"><img src="images/logo-full.png"></a>
</div>
<ul class="menu-list">
<div class="icon cancel-btn">
<i class="fas fa-times"></i>
</div>
<li><span><a href="#">What is dsc</a></span></li>
<li><span><a href="#">Roadmap</a></span></li>
<li><span><a href="#">Team</a></span></li>
<li><span><a href="#">Faq</a></span></li>
<li><span><a href="#">Forum</a></span></li>
<li><span><a href="#">Events</a></span></li>
</ul>
<div class="icon menu-btn">
<i class="fas fa-bars"></i>
</div>
</div>
</nav>
<section>
<img src="images/logo.png" class="logomain" alt="">
<img class="illustration" src="images/illustration.png" alt="">
Expand Down Expand Up @@ -76,6 +84,24 @@ <h1>Contact Us</h1>


</body>

<script>
const body = document.querySelector("body");
const navbar = document.querySelector(".navbar");
const menuBtn = document.querySelector(".menu-btn");
const cancelBtn = document.querySelector(".cancel-btn");
menuBtn.onclick = ()=>{
navbar.classList.add("show");
menuBtn.classList.add("hide");
body.classList.add("disabled");
}
cancelBtn.onclick = ()=>{
body.classList.remove("disabled");
navbar.classList.remove("show");
menuBtn.classList.remove("hide");
}
window.onscroll = ()=>{
this.scrollY > 20 ? navbar.classList.add("sticky") : navbar.classList.remove("sticky");
}
</script>

</html>
218 changes: 162 additions & 56 deletions main.css
Original file line number Diff line number Diff line change
@@ -1,68 +1,174 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
scroll-behavior: smooth;
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Barlow', sans-serif;
}

body {
background: rgb(255, 255, 255);
/* custom scroll bar */
::-webkit-scrollbar {
width: 10px;
}

header img {
width: auto;
height: 47px;
padding-left: 1rem;
position: absolute;
::-webkit-scrollbar-track {
background: #f1f1f1;
}

header {
position: fixed;
top: 0;
left: 0;
height: 72px;
width: 100vw;
padding: 0;
display: flex;
justify-content: space-around;
align-items: center;
z-index: 10000;
background: rgb(255, 255, 255);
filter: drop-shadow(0px 2px 2px rgba(77, 50, 50, 0.25));
::-webkit-scrollbar-thumb {
background: #888;
}

header ul {
display: flex;
justify-content: space-around;
align-items: center;
height: 100%;
width: 50%;
margin-right: 1.2rem;
::selection{
background: rgb(0,123,255,0.3);
}

header ul li {
list-style: none;
.content{
max-width: 1250px;
margin: auto;
padding: 0% 0px;
}

header ul li a {
text-decoration: none;
padding: 6px 15px;
color: rgb(0, 0, 0);
border-radius: 20px;
.navbar{
position: fixed;
width: 100%;
z-index: 2;
padding: 25px 0;
transition: all 0.3s ease;
}

header ul li a:hover,
header ul li a:active {
background: #5185EB;
color: #ffffff;
.navbar.sticky{
background: #fff;
padding: 10px 0;
box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.1);
}

.logo {
height: 47px;
width: 50%;
.navbar .content{
display: flex;
align-items: center;
justify-content: space-between;
}
.navbar .logo img{
width: 300px;
}
.navbar .menu-list{
display: inline-flex;
}
.menu-list li{
list-style: none;
}
.menu-list li a{
color: #567FC0;
text-transform: uppercase;
font-size: 17px;
font-weight: 400;
margin-left: 25px;
text-decoration: none;
transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);;
}
.icon{
color: #000;
font-size: 20px;
cursor: pointer;
display: none;
}
.menu-list .cancel-btn{
color: #fff;
position: absolute;
right: 30px;
top: 20px;
}
@media (max-width: 1230px) {
.content{
padding: 0 60px;
}

}
@media (max-width: 1100px) {
.content{
padding: 0 40px;
}
}
@media (max-width: 900px) {
.content{
padding: 0 30px;
}
}
@media (max-width: 868px) {
body.disabled{
overflow: hidden;
}
.icon{
display: block;
}
.icon.hide{
display: none;
}
.navbar .menu-list{
position: fixed;
height: 100vh;
width: 100%;
max-width: 400px;
left: -100%;
top: 0px;
display: block;
padding: 40px 0;
text-align: center;
background: #567FC0;
color:#fff;
transition: all 0.3s ease;
}
.navbar.show .menu-list{
left: 0%;
}
.navbar .menu-list li{
margin-top: 45px;
}
.navbar .menu-list li a{
font-size: 15px;
margin-left: -100%;
transition: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
color: #fff;
}
.navbar.show .menu-list li a{
margin-left: 0px;
}
}
@media (max-width: 380px) {
.navbar .logo img{
width:230px;
}
}
@media (min-width: 868px) and (max-width : 1600px){
span {
position: relative;
display: block;
cursor: pointer;
}

span:before, span:after {
content: '';
position: absolute;
width: 0%;
height: 1px;
top: 50%;
margin-top: -0.5px;
background: #DF3235;
}

span:before {
left: 10px;
}
span:after {
right: -10px;
background: #DF3235;
transition: width 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

span:hover:before {
background: #DF3235;
width: 100%;
transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

span:hover:after {
background: transparent;
width: 100%;
transition: 0s;
}
}

section {
position: relative;
width: 100%;
Expand Down