site/script.js

30 lines
1.3 KiB
JavaScript
Raw Normal View History

/* 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');
}
}
}
2024-09-25 20:21:07 -05:00
}
/* 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!");
}