Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ANSHIKA-26 committed Oct 2, 2024
2 parents 27f7201 + b90f87c commit 2cd973a
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 22 deletions.
2 changes: 1 addition & 1 deletion blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</head>
<body>
<!--header-->
<header id="header" class="shadow bg-light">
<header id="header" class="shadow">
<nav class="container navbar">
<a href="index.html" class="nav-brand text-dark">
WordWise
Expand Down
20 changes: 10 additions & 10 deletions category.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


<!--header-->
<header id="header" class="shadow bg-light">
<header id="header" class="shadow">
<nav class="container navbar">
<a href="index.html" class="nav-brand text-dark">
WordWise
Expand Down Expand Up @@ -238,22 +238,22 @@ <h2 class="footer-title secondary-title">Tags</h2>

<div class="tags">
<div class="d-flex flex-wrap">
<a href="#" class="nav-link btn bg-light">Travel</a>
<a href="#" class="nav-link btn bg-light">Food</a>
<a href="#" class="nav-link btn bg-light">Lifestyle</a>
<a href="#" class="nav-link btn bg-light">Techonogy</a>
<a href="#" class="nav-link btn bg-light">Fashion</a>
<a href="#" class=" btn bg-light">Travel</a>
<a href="#" class=" btn bg-light">Food</a>
<a href="#" class=" btn bg-light">Lifestyle</a>
<a href="#" class=" btn bg-light">Techonogy</a>
<a href="#" class=" btn bg-light">Fashion</a>
</div>
</div>

<h2 class="footer-title secondary-title mt-2">Social</h2>

<div class="tags social" id="contact">
<div class="d-flex flex-wrap">
<a href="#" class="nav-link btn bg-light"><i class="fab fa-facebook-f"></i></a>
<a href="#" class="nav-link btn bg-light"><i class="fab fa-twitter"></i></a>
<a href="#" class="nav-link btn bg-light"><i class="fab fa-instagram"></i></a>
<a href="#" class="nav-link btn bg-light"><i class="fab fa-dribbble"></i></a>
<a href="#" class="btn bg-light"><i class="fab fa-facebook-f"></i></a>
<a href="#" class="btn bg-light"><i class="fab fa-twitter"></i></a>
<a href="#" class="btn bg-light"><i class="fab fa-instagram"></i></a>
<a href="#" class="btn bg-light"><i class="fab fa-dribbble"></i></a>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</head>
<body>
<!--header-->
<header id="header" class="shadow bg-light">
<header id="header" class="shadow">
<nav class="container navbar">
<a href="index.html" class="nav-brand text-dark">
WordWise
Expand Down
30 changes: 27 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,37 @@ function myFunction() {
}
}

//Active Nav bar
const navLinks = document.querySelectorAll('.nav-link');
const setActiveLink = () => {
const activePath = localStorage.getItem('activeLink');
if (activePath) {
navLinks.forEach(link => {
const linkHref = link.getAttribute('href');
if (linkHref === activePath) {
link.classList.add('active');
} else {
link.classList.remove('active');
}
});
}
};

document.addEventListener('DOMContentLoaded', setActiveLink);

navLinks.forEach(link => {
link.addEventListener('click', function() {
navLinks.forEach(link => link.classList.remove('active'));

this.classList.add('active');

localStorage.setItem('activeLink', this.getAttribute('href'));
});
});


// Theme Switcher
//determines if the user has a set theme
function detectColorScheme() {
var theme = "light"; //default to light
var theme = "light";


//local storage is used to override OS theme settings
Expand Down
9 changes: 3 additions & 6 deletions start.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</head>
<body>
<!--header-->
<header id="header" class="shadow bg-light">
<header id="header" class="shadow ">
<nav class="container navbar">
<a href="index.html" class="nav-brand text-dark">
WordWise
Expand All @@ -34,10 +34,10 @@
<div class="collapse">
<ul class="navbar-nav">
<a href="index.html" class="nav-link">Home</a>
<a href="blog" class="nav-link"> Leading Blog</a>
<a href="blog.html" class="nav-link"> Leading Blog</a>
<a href="start.html" class="nav-link">Start Writing</a>
<a href="category.html" class="nav-link">Categories</a>
<a href="#contact" class="nav-link">About</a>
<a href="#About" class="nav-link">About</a>
<a href="#contact" class="nav-link">Contact </a>
</ul>
</div>
Expand All @@ -61,9 +61,6 @@
<a href="#" class="nav-link">
<i class="fa-brands fa-dribbble"></i>
</a>



</ul>
</div>
<div class="theme-switch-wrapper">
Expand Down
15 changes: 14 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ header {
flex-direction: row;
justify-content: space-around;
border-bottom: 1px solid black;
background-color: #343a40;
}

body {
Expand Down Expand Up @@ -302,6 +303,12 @@ a {
text-align: right;
}

.container{
background-color: #343a40;
}

/*section*/
/* navigation menu*/
.navbar {
position: relative;
display: flex;
Expand Down Expand Up @@ -331,7 +338,13 @@ a {
}

.nav-link:hover {
color: var(--primary-color);
color: #c9d3db;
text-decoration: underline;
}

.nav-link.active {
color: #c9d3db;
text-decoration: underline;
}

.search-box {
Expand Down

0 comments on commit 2cd973a

Please sign in to comment.