Skip to content

Commit

Permalink
Add smooth scroll to hero & rm duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
MedouneSGB committed Nov 1, 2023
1 parent 117ba92 commit 5b5f008
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 2 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ <h1>
</header>

<!-- cards -->

<section id="heroes">
<div style="background-color: #d2b863">
<div class="container p-5">
<h1
Expand Down Expand Up @@ -265,17 +265,12 @@ <h5 class="card-title p-2 mt-3 mb-3">Cheikh Oumar Diagne</h5>
</a>
</div>

<div class="col-md-3 col-sm-6 item">
<a href="./pages/CheikhoumarDiagne.html" class="card item-card card-block">
<img src="heroes/CheikhoumarDiagne.png" alt="Mouhamed Oury Diallo" />
<h5 class="card-title p-2 mt-3 mb-3">Cheikh Oumar Diagne</h5>
</a>
</div>
</div>

<p id="noMatchMessage" style="display:none; text-align:center; font-size: 24px;" class="no_match_message">No match found !</p>
</div>
</div>
</section>

<!-- footer -->

Expand Down
6 changes: 6 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ function searchFunction() {
} else {
noMatchMessage.style.display = "none";
}

// Scroll to the contact section
const contactSection = document.getElementById("heroes");
if (contactSection) {
contactSection.scrollIntoView({ behavior: "smooth" });
}
}

// Function to reset search when the input value is cleared
Expand Down

0 comments on commit 5b5f008

Please sign in to comment.