-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #378 from aditya-bhaumik/pop
i have added the social media pop up in all the pages
- Loading branch information
Showing
6 changed files
with
69 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
document.addEventListener("DOMContentLoaded", function() { | ||
// Get the modal | ||
var accountNotAvailableModal = document.getElementById("accountNotAvailableModal"); | ||
|
||
// Get the <span> element that closes the modal | ||
var closeAccountNotAvailableModal = document.getElementById("closeAccountNotAvailableModal"); | ||
|
||
// Get all social media links | ||
var socialLinks = document.querySelectorAll(".socialIcons a"); | ||
|
||
if (!accountNotAvailableModal || !closeAccountNotAvailableModal || socialLinks.length === 0) { | ||
console.error("Required elements are missing"); | ||
return; | ||
} | ||
|
||
// When the user clicks on <span> (x), close the modal | ||
closeAccountNotAvailableModal.onclick = function() { | ||
accountNotAvailableModal.style.display = "none"; | ||
} | ||
|
||
// When the user clicks anywhere outside of the modal, close it | ||
window.onclick = function(event) { | ||
if (event.target == accountNotAvailableModal) { | ||
accountNotAvailableModal.style.display = "none"; | ||
} | ||
} | ||
|
||
// When the user clicks on a social media link, show the modal | ||
socialLinks.forEach(function(link) { | ||
link.onclick = function(event) { | ||
event.preventDefault(); | ||
accountNotAvailableModal.style.display = "block"; | ||
} | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters