Skip to content

Commit

Permalink
fixed the back to home button issue affecting the contact button
Browse files Browse the repository at this point in the history
  • Loading branch information
courthub74 committed Jul 14, 2024
1 parent c03b359 commit 2bdffee
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion index.css.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ $projectboxes: linear-gradient(45deg, #3b3e93, #060927);
width: 1.2em;
}
}
// For Home Button Dissapeared
// #back_home.gone {

// }
// Email Copied words
.email_copied {
text-align: right;
Expand Down
26 changes: 13 additions & 13 deletions slidemenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ let learn_more_button = document.querySelector('.learn_more');
// Query the Body to stop the scroll
let whole_body = document.querySelector('body');

// Query the back to home button
let home_button = document.getElementById('back_home');


// event listener for the menu button
menu_button.addEventListener('pointerdown', () => {
console.log('Menu Button Pressed');
Expand Down Expand Up @@ -64,23 +68,19 @@ contact_nav.addEventListener('pointerdown', () => {
whole_body.classList.toggle('stop_scroll');
});

// Query the back to home button
let home_button = document.getElementById('back_home');

// For the Home Button
// add event listener to the home button
home_button.addEventListener('pointerdown', () => {
console.log("Back to Home pressed");
menu_button_ring.classList.toggle('tapped');
menu_button.classList.toggle('tapped');
menu_button_text.classList.toggle('tapped');
slide_in_menu.classList.toggle('tapped');
if (menu_button_text.innerText === "Contact") {
menu_button_text.innerText = "Back";
} else {
menu_button_ring.classList.remove('tapped');
menu_button.classList.remove('tapped');
menu_button_text.classList.remove('tapped');
slide_in_menu.classList.remove('tapped');
if (menu_button_text.innerText === "Back") {
menu_button_text.innerText = "Contact";
}
learn_more_button.classList.toggle('slide');
whole_body.classList.toggle('stop_scroll');
}
learn_more_button.classList.remove('slide');
whole_body.classList.remove('stop_scroll');
});


0 comments on commit 2bdffee

Please sign in to comment.