Skip to content

Commit

Permalink
improve dir structure and fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
SalmanAd01 committed Jan 21, 2023
1 parent 54d36e8 commit afcb091
Show file tree
Hide file tree
Showing 14 changed files with 1,595 additions and 1,600 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const About = () => {
<Box className="ch1About">
<Headline2 className="titleAbout">What is Turing Cup?</Headline2>
<Typography className="contentAbout">
Named after Alan Turing, the Turing Cup is CodeChef SIESGSTs annual flagship
Named after Alan Turing, the Turing Cup is CodeChef SIESGST&apos;s annual flagship
competitive coding contest. A national level programming challenge, the contest
invites individual coders to crack challenging problem statements and come up with the
most intuitive and efficient solution possible - all in the given time frame
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Footer = () => {
<Box id="footer">
<footer>
<Box className="footer-text d-flex align-items-center justify-content-center">
<a href="#">Turing Cup 2022</a>
<a href="#">Turing Cup 2023</a>
</Box>
<ul className="social-links">
<li>
Expand Down
File renamed without changes.
92 changes: 92 additions & 0 deletions src/Components/drawer/turingCup/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* eslint-disable jsx-a11y/anchor-is-valid */
import React, { useEffect, useRef } from 'react';

const Navbar = () => {
useEffect(() => {
const btns = document.getElementsByClassName('nav-item');
for (let i = 0; i < btns.length; i += 1) {
btns[i].addEventListener('click', function handelNavLink() {
const current = document.getElementsByClassName('active');
current[0].className = current[0].className.replace('active', 'nav-link');
// eslint-disable-next-line react/no-this-in-sfc
this.children[0].className = 'active btn-sm px-3';
});
}
});
const navRef = useRef(null);

function toggleNav() {
document.querySelector('.navbar-collapse').classList.toggle('show');
}
window.onscroll = () => {
if (window.scrollY > 0) {
navRef.current.classList.add('navbar-shadow');
} else {
navRef.current.classList.remove('navbar-shadow');
}
if (window.scrollY > 500) {
navRef.current.classList.remove('navbar-light');
navRef.current.classList.add('navbar-dark');
navRef.current.classList.add('navbar-shadow');
} else {
navRef.current.classList.remove('navbar-dark');
navRef.current.classList.add('navbar-light');
navRef.current.classList.add('navbar-shadow');
}
};
return (
<nav
className="relative navbar navbar-expand-md fixed-top flex justify-between items-center py-6 z-10 navbar-light navbar-shadow"
ref={navRef}
>
<div className="relative container px-4 mx-auto">
<a className="navbar-brand" href="#">
Turing Cup
</a>
<button
className="navbar-toggler"
onClick={toggleNav}
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarCollapse"
aria-controls="navbarCollapse"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span className="navbar-toggler-icon" />
</button>
<div className="collapse navbar-collapse" id="navbarCollapse">
<ul className="navbar-nav ml-auto mb-2 mb-md-0 align-items-center justify-content-end justify-content-md-between">
<li className="nav-item">
<a className="active btn-sm px-3" aria-current="page" href="#about">
About
</a>
</li>
<li className="nav-item">
<a className="nav-link" aria-current="page" href="#schedule">
Schedule
</a>
</li>
<li className="nav-item">
<a className="nav-link" aria-current="page" href="#registration">
Registration
</a>
</li>
<li className="nav-item">
<a className="nav-link" aria-current="page" href="#faq">
FAQ
</a>
</li>
<li className="nav-item">
<a className="nav-link" aria-current="page" href="#contact">
Contact
</a>
</li>
</ul>
</div>
</div>
</nav>
);
};

export default Navbar;
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit afcb091

Please sign in to comment.