30 lines
No EOL
1.3 KiB
JavaScript
30 lines
No EOL
1.3 KiB
JavaScript
/* dropdown menu for mobile users, used https://www.w3schools.com/howto/howto_js_dropdown.asp
|
|
When the user clicks on the button,
|
|
toggle between hiding and showing the dropdown content */
|
|
function mobileDropdown() {
|
|
document.getElementById("dropdown-box").classList.toggle("show-dropdown");
|
|
}
|
|
|
|
// Close the dropdown menu if the user clicks outside of it
|
|
window.onclick = function(event) {
|
|
if (!event.target.matches('.nav-baselink-mobile')) {
|
|
var dropdowns = document.getElementsByClassName("dropdown-content");
|
|
var i;
|
|
for (i = 0; i < dropdowns.length; i++) {
|
|
var openDropdown = dropdowns[i];
|
|
if (openDropdown.classList.contains('show-dropdown')) {
|
|
openDropdown.classList.remove('show-dropdown');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* snippet that copies the html for my button(s) */
|
|
function copyButtonRegular() {
|
|
navigator.clipboard.writeText ('<a href="https://sneexy.pages.gay"><img src="https://sneexy.pages.gay/assets/buttons/sneexy.png" alt="Sneexy" title="Sneexy"></a>');
|
|
alert("button html copied!");
|
|
}
|
|
function copyButtonCatppuccin() {
|
|
navigator.clipboard.writeText ('<a href="https://sneexy.pages.gay"><img src="https://sneexy.pages.gay/assets/buttons/sneexy_cat.png" alt="Sneexy" title="Sneexy"></a>');
|
|
alert("button html copied!");
|
|
} |