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

Fixed: Small Login and Signup Buttons #165

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
13 changes: 9 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@
</head>

<body >

<header>
<header>
<nav class="navbar">
<div class="left">
<a href="../index.html">
<button class="hamburger" id="hamburger">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</button>
<a href="../index.html" class="logo-link">
<img src="./img/logo.jpg" alt="Logo" class="logo" />
</a>

Expand Down Expand Up @@ -142,7 +146,8 @@
</div>
</label>
</div>
</header>
</div>
</header>

<div class="content">
<br>
Expand Down
31 changes: 31 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@ document.addEventListener("DOMContentLoaded", function(event) {
document.querySelector(".Hi").classList.add("loaded");
});

document.addEventListener('DOMContentLoaded', function() {
const hamburger = document.getElementById('hamburger');
const navList = document.querySelector('.navbar-list');

hamburger.addEventListener('click', function() {
// Toggle active class on hamburger for animation
this.classList.toggle('active');

// Toggle active class on nav list for display
navList.classList.toggle('active');
});

// Close menu when clicking outside
document.addEventListener('click', function(event) {
const isClickInside = hamburger.contains(event.target) || navList.contains(event.target);

if (!isClickInside && navList.classList.contains('active')) {
hamburger.classList.remove('active');
navList.classList.remove('active');
}
});

// Close menu when window is resized above mobile breakpoint
window.addEventListener('resize', function() {
if (window.innerWidth > 768 && navList.classList.contains('active')) {
hamburger.classList.remove('active');
navList.classList.remove('active');
}
});
});

document.addEventListener("DOMContentLoaded", function() {
var paragraphs = document.querySelectorAll('#content p');
var currentParagraph = 0;
Expand Down
119 changes: 117 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ html,body{
color: white;
}

/* Navigation Links */
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}

.nav-links a {
color: white;
text-decoration: none;
font-weight: 500;
transition: color 0.3s;
}

.nav-links a:hover {
color: rgba(255, 255, 255, 0.8);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
.header {
Expand Down Expand Up @@ -103,6 +123,24 @@ html,body{
color: black;
text-decoration: none;
}

/* Hamburger Menu Styles */
.hamburger {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
}

.bar {
display: block;
width: 25px;
height: 3px;
background-color: white;
margin: 5px 0;
transition: all 0.3s ease;
}

header{
display: flex;
Expand Down Expand Up @@ -218,17 +256,20 @@ html,body{
.sign-up,.log-in {
display: flex;
align-items: center;
justify-content: center;
font-family: inherit;
cursor: pointer;
font-weight: 500;
font-size: 17px;
padding: 0.8em 1.3em 0.8em 0.9em;
padding: 0.8em 1.2em;
color: white;
background: #ad5389;
background: linear-gradient(to right, #0f0c29, #302b63, #24243e);
border: none;
letter-spacing: 0.05em;
border-radius: 16px;
width: 90px;
height: 35px;
text-align: center;
}


Expand Down Expand Up @@ -977,3 +1018,77 @@ footer {
.social-icons li {
display: inline-block;
}

/* Responsive Styles */
@media (max-width: 768px) {
.hamburger {
display: block;
}

.navbar ul {
display: none;
flex-direction: column;
position: absolute;
top: 60px;
left: 0;
width: 100%;
background-color: #333;
z-index: 10;
padding: 1rem 0;
}

.navbar ul.active {
display: flex;
}

.navbar ul li {
margin: 1rem 0;
text-align: center;
}

.navbar-list {
display: none;
flex-direction: column;
position: absolute;
top: 60px;
left: 0;
width: 100%;
background: linear-gradient(to right, #60a5fa, #4ade80);
padding: 1rem;
z-index: 1000;
}

.navbar-list.active {
display: flex;
}

.navbar-list li {
margin: 10px 0;
text-align: center;
}

.search-input {
display: none;
}

.Authenticate {
display: flex;
}

/* Hamburger Animation */
.hamburger.active .bar:nth-child(1) {
transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .bar:nth-child(2) {
opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
transform: rotate(-45deg) translate(7px, -7px);
}

.group {
display: none;
}
}