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

Resolved navbar conflict #356 #397

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
170 changes: 142 additions & 28 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,147 @@ div.card {
backface-visibility: hidden;
}

/*navbar section*/
nav {
position: fixed;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.7);
height: 80px;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 1000;
}

label.logo {
color: white;
font-size: 35px;
line-height: 80px;
padding: 0 20px;
font-weight: bold;
display: flex;
align-items: center;
}

label.logo img {
height: 68px;
width: 68px;
margin-top: -5px;
border-radius: 450px;
}

nav ul {
display: flex;
margin-right: 20px;
list-style: none;
}

nav ul li {
display: inline-block;
font-family: 'Josefin Sans', sans-serif;
line-height: 80px;
margin: 0 5px;
}

nav ul li a {
color: rgb(252, 250, 250);
font-size: 15px;
padding: 10px 28px;
border-radius: 3px;
text-transform: uppercase;
transition: color 0.3s ease, transform 0.3s ease, background 0.3s ease;
text-decoration: none;
}

i {
font-size: larger;
font-weight: 200;
font-style: normal;
}

nav ul li a:hover {
color: #000000;
background: linear-gradient(to top left, #edfc4890 30%, #f4d01e 20%);
transform: scale(1.2) translateY(10px);
}

.navbar nav .checkbut {
font-size: 30px;
color: white;
display: none;
}

#check {
display: none;
}

.navbar .fas {
color: white;
}

@media (max-width: 952px) {
label.logo img {
height: 0px;
width: 0px;
}

label.logo {
font-size: 15px;
padding-left: 50px;
}

nav ul li a {
font-size: 16px;
}
}

@media (max-width: 858px) {
.navbar nav .checkbut {
display: block;
color: white;
}

.navbar ul {
position: fixed;
width: 100%;
height: 100vh;
background: #2c3e50;
top: 80px;
left: -100%;
text-align: center;
transition: all .5s;
z-index: 2;
}

.navbar nav ul li {
display: block;
margin: 50px 0;
line-height: 30px;
}

.navbar nav ul li a {
font-size: 20px;
}

a:hover, a.active {
background: none;
color: #0082e6;
}

#check:checked ~ ul {
left: 0;
}
}

.navbar section {
background: url(bg1.jpg) no-repeat;
background-size: cover;
height: 0px;
}


/* home section */
.home {
height: 100vh;
Expand Down Expand Up @@ -823,33 +964,12 @@ div.card {
background: black;
color: white;
border-color: transparent;
box-shadow: none;
}
.service-cards{
transition: all 0.3s ease;
}
.service-cards:hover{
transform:translateY(-6px);

}
.heading-hover{
font-size:20px;
color:#0082e6;
}
.service-cards:hover .heading-hover{
color:white;

}





/* contact section */




#contact .form-control {
background: transparent;
border: 2px solid #e0e0e0;
Expand All @@ -861,11 +981,8 @@ div.card {
}

#contact .form-control:hover {

border-color:#999;

border-color: #999;
border: 2px solid #797979;

}

#contact input {
Expand Down Expand Up @@ -1465,6 +1582,3 @@ button {
-webkit-border-radius: 0;
border-radius: 0;
}
}
}
}
106 changes: 18 additions & 88 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,78 +120,6 @@
font-family: Arial, sans-serif;
}

<!--navbar-->
<div class="navbar">
<nav>
<input type="checkbox" id="check">
<label for="check" class="checkbut">
<i class="fas fa-bars"></i>
</label>
<label class="logo" style="margin-left:5px;"><img src="images/fav.png" alt="logo">
<span class="logo-text" style="margin-left: 0;">Open Source Village</span>
</label>
<ul>
<li><i class="fa-solid fa-house" style="filter:invert(1)"></i><a class="active" href="#home">Home</a></li>
<li><i class="fa-solid fa-circle-info" style="filter:invert(1)"></i><a href="#about">About</a></li>
<li><i class="fa-solid fa-list" style="filter:invert(1)"></i><a href="#services">Services</a></li>
<li><i class="fa-solid fa-user"style="filter:invert(1)"></i><a href="#testimonials">Reviews</a></li>
<li><i class="fa-solid fa-at" style="filter:invert(1)"></i><a href="#contact">Contact Us</a></li>
<li><i class="fa-solid fa-message" style="filter:invert(1)"></i><a href="#feedback">Feedback</a></li>
</ul>
</nav>


.navbar {
width: 100%;
background: #333;
display: flex;
justify-content: left;
align-items: center;
position: fixed;
top: 0;
z-index: 1000;
}

.navbar nav ul {
margin: 0px;
display: flex;
height: inherit;
/* Removed align-self: flex-end; */
display: flex;
align-items: center;
justify-content: space-around;
gap: 20px;
}

.navbar nav {
justify-content: flex-end; /* Align links to the right */
align-items: flex-start; /* Vertically align to top */
}

.navbar nav ul a {
display: inline; /* Reset in case of accidental overrides */
text-decoration: none;
color: white;
font-size: 20px;
margin-right: 10px;
padding: 10px;
border-radius: 10px;


}

nav ul li a:hover{
color:#000000;
transform: scale(1.2);

background: linear-gradient(to top left, #edfc4890 30%, #f4d01e 20%);
/* margin-left: 30px; */
/* margin-right: 30px; */
transform: translateY(20px);


}

.logo {
margin-right: auto; /* Optional: space between logo and right edge */
}
Expand Down Expand Up @@ -277,25 +205,27 @@
</div>
</section>



<!-- Navbar -->
<div class="navbar">
<label class="logo">
<img src="images/fav.png" alt="logo">
<div class="navbar">
<nav>
<input type="checkbox" id="check">
<label for="check" class="checkbut">
<i class="fas fa-bars"></i>
</label>

<nav style="height: 30px; padding: 0; margin: 0;">
<ul >
<li><a class="active" href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#testimonials">Reviews</a></li>
<li><a href="#contact">Contact Us</a></li>
<li><a href="#feedback">Feedback</a></li>
</ul>
</nav>
</div>
<label class="logo" style="margin-left:5px;"><img src="images/fav.png" alt="logo">
<span class="logo-text" style="margin-left: 0;">Open Source Village</span>
</label>
<ul>
<li><i class="fa-solid fa-house" style="filter:invert(1)"></i><a class="active" href="#home">Home</a></li>
<li><i class="fa-solid fa-circle-info" style="filter:invert(1)"></i><a href="#about">About</a></li>
<li><i class="fa-solid fa-list" style="filter:invert(1)"></i><a href="#services">Services</a></li>
<li><i class="fa-solid fa-user"style="filter:invert(1)"></i><a href="#testimonials">Reviews</a></li>
<li><i class="fa-solid fa-at" style="filter:invert(1)"></i><a href="#contact">Contact Us</a></li>
<li><i class="fa-solid fa-message" style="filter:invert(1)"></i><a href="#feedback">Feedback</a></li>
</ul>
</nav>
</div>

<!-- Home Section -->
<section class="home" id="home">
Expand Down