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

Improved navbar links and responsive design across pages. #149

Merged
merged 2 commits into from
Oct 4, 2024
Merged
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
12 changes: 9 additions & 3 deletions Appearances.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@

<nav class="navbar h-nav background">
<ul class="nav-list visibility">
<div class="logo" id="ironmask"><img src="assets\logo\icon.png" alt="logo" srcset=""></div>
<div class="logo" id="ironmask"><a href="/index.html"><img src="assets\logo\icon.png" alt="logo" srcset=""></a></div>
<li> <a href="index.html#home" class="active">Home</a></li>
<li> <a href="index.html#about">About</a></li>
<li> <a href="#">Appearances</a></li>
<li> <a href="#" id="appearance_active">Appearances</a></li>
<li> <a href="index.html#contact">Contact</a></li>

</ul>

<div class="rightNav visibility">
<form class="search-bar">
<input type="text" name="search" placeholder="Search the website">
<input type="text" name="search" id="search-bar" placeholder="Search the website">
<button type="submit"><i class="fa-solid fa-magnifying-glass"></i></button>
</form>
</div>

<div class="burger">
<div class="line"></div>
<div class="line"></div>
Expand Down Expand Up @@ -116,6 +117,11 @@ <h2>Avengers: Endgame (2019)</h2>
</p>
</footer>

<script>
window.onload = function() {
document.getElementById('search-bar').focus();
};
</script>

<script>
window.addEventListener('scroll', function() {
Expand Down
1 change: 1 addition & 0 deletions Js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ window.addEventListener('scroll', () => {
const sections=document.querySelectorAll('section');
const navLinks=document.querySelectorAll('nav a');


let current='';

sections.forEach(section => {
Expand Down
21 changes: 16 additions & 5 deletions css/Appearances.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ body {
text-shadow: 2px 2px 15px rgba(255, 238, 107, 0.847);
}
.nav-list li a.active{
color: rgb(238, 10, 10);
text-decoration: underline;
text-decoration: none;
}

/* Right Nav */
Expand All @@ -140,7 +139,7 @@ body {
}

.search-bar{
margin-left: 90px;
margin-left: 90px;
width:300px;
height:40px;
max-width: 600px;
Expand Down Expand Up @@ -192,7 +191,7 @@ body {

.logo{
width: 40%;
margin: 6px 80px 6px 20px;
margin: 6px 80px 6px 80px;
display: flex;
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -379,6 +378,7 @@ footer p {
.nav-list {
flex-direction: column;
align-items: center; /* Added for central alignment */
margin-right: 0px;
}
.navbar {
flex-direction: column;
Expand Down Expand Up @@ -462,6 +462,13 @@ footer p {
display: inline-block; /* Make images inline-block for centering */
margin: 0 auto; /* Center the image */
}
.search-bar{
margin-left: 0px;
}
.logo a{
display: flex;
justify-content: center;
}
}


Expand All @@ -477,4 +484,8 @@ footer p {
color:rgb(247, 242, 242);
text-decoration: underline;
}


#appearance_active{
color: rgb(238, 10, 10);
text-decoration: underline;
}
23 changes: 19 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

<nav class="navbar h-nav background">
<ul class="nav-list visibility">
<div class="logo" id="ironmask"><img src="assets\logo\icon.png" alt="logo" srcset=""></div>
<li> <a href="#home" class="active">Home</a></li>
<li> <a href="#about">About</a></li>
<div class="logo" id="ironmask" ><a href="/index.html"><img src="assets\logo\icon.png" alt="logo" srcset=""></a></div>
<li> <a href="#home" class="active" onclick="scrollToSection(event, 'home')" >Home</a></li>
<li> <a href="#about" onclick="scrollToSection(event, 'about')">About</a></li>
<li> <a href="Appearances.html">Appearances</a></li>
<li> <a href="#contact">Contact</a></li>

Expand All @@ -39,7 +39,7 @@
<div class="line"></div>
</div>
</nav>
<section class="background1 firstSection" id="home">
<section class="background1 firstSection" id="home">
<div class="box-main">
<div class="firstHalf DoAnimation">
<p class="text-big"> <strong>Who is Ironman ?</strong></p>
Expand Down Expand Up @@ -161,6 +161,21 @@ <h2 class="text-center" >Contact</h2>
document.getElementById('search-bar').focus();
};
</script>

<!-- making the about section clealy visible when "about" or "home" is clicked -->
<script>
function scrollToSection(event, sectionId) {
event.preventDefault();
const section = document.getElementById(sectionId);
const navbarHeight = 85; // Fixed navbar height

window.scrollTo({
top: section.offsetTop - navbarHeight,
behavior: 'smooth'
});
}
</script>

</body>

</html>
13 changes: 9 additions & 4 deletions movies.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stark Tech Portfolio</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="movieStyle.css">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="website icon" href="/assets/logo/icon.png">
<link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet">

</head>
<body>
<nav class="navbar h-nav background">
<ul class="nav-list visibility">
<div class="logo" id="ironmask"><img src="assets\logo\icon.png" alt="logo" srcset=""></div>
<div class="logo" id="ironmask"><a href="/index.html"><img src="assets\logo\icon.png" alt="logo" srcset=""></a></div>
<li> <a href="index.html">Home</a></li>
<li> <a href="#about">About</a></li>
<li> <a href="index.html#about" onclick="scrollToSection(event, 'home')">About</a></li>
<li> <a href="Appearances.html">Appearances</a></li>
<li> <a href="#contact">Contact</a></li>

<li> <a href="index.html#contact">Contact</a></li>
</ul>

<div class="rightNav visibility">
Expand Down Expand Up @@ -130,3 +131,7 @@ <h2 class="movie-title">SPIDER-MAN: FAR FROM HOME(2019)<br>ARCHIVE FOOTAGE<span
</div>
</div>

<script src="./Js/script.js"></script>

</body>
</html>
12 changes: 10 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ html,body{

.logo{
width: 40%;
margin: 6px 80px 6px 20px;
margin: 6px 80px 6px 80px;
display: flex;
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -429,6 +429,7 @@ html,body{
.nav-list {
flex-direction: column;
align-items: center; /* Added for central alignment */
margin-right: 0px;
}
.navbar {
flex-direction: column;
Expand Down Expand Up @@ -462,7 +463,7 @@ html,body{
display: block;
}
.h-nav {
height: 75px;
height: 85px;
}
.visibility {
visibility: hidden;
Expand Down Expand Up @@ -514,6 +515,13 @@ html,body{
display: inline-block; /* Make images inline-block for centering */
margin: 0 auto; /* Center the image */
}
.search-bar{
margin-left: 0px;
}
.logo a{
display: flex;
justify-content: center;
}
}


Expand Down
9 changes: 5 additions & 4 deletions videos.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
</head>
<nav class="navbar h-nav background">
<ul class="nav-list visibility">
<div class="logo" id="ironmask"><img src="assets\logo\icon.png" alt="logo" srcset=""></div>
<div class="logo" id="ironmask"><a href="/index.html"><img src="assets\logo\icon.png" alt="logo" srcset=""></a></div>
<li> <a href="index.html">Home</a></li>
<li> <a href="#about">About</a></li>
<li> <a href="index.html#about">About</a></li>
<li> <a href="Appearances.html">Appearances</a></li>
<li> <a href="#contact">Contact</a></li>
<li> <a href="index.html#contact">Contact</a></li>

</ul>

Expand Down Expand Up @@ -115,4 +115,5 @@ <h2 class="movie-title">I AM IRON MAN SCENE ICONIC</h2>
}
</style>


<script src="/Js/script.js"></script>
</html>