MORE REFACTORING!! + some improvements
Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
parent
151b2d8fd9
commit
cba791deba
17 changed files with 376 additions and 223 deletions
|
@ -2,11 +2,11 @@ const header_links = document.getElementById("header-links");
|
|||
const hamburger = document.getElementById("header-links-toggle");
|
||||
|
||||
document.addEventListener("click", event => {
|
||||
if (!header_links.contains(event.target) && !hamburger.contains(event.target) && !header_links.href) {
|
||||
header_links.classList.remove("open");
|
||||
}
|
||||
if (!header_links.contains(event.target) && !hamburger.contains(event.target) && !header_links.href) {
|
||||
header_links.classList.remove("open");
|
||||
}
|
||||
});
|
||||
|
||||
hamburger.addEventListener("click", event => {
|
||||
header_links.classList.toggle("open");
|
||||
hamburger.addEventListener("click", () => {
|
||||
header_links.classList.toggle("open");
|
||||
});
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
import "./main.js";
|
||||
|
||||
document.addEventListener("swap", () => {
|
||||
document.querySelectorAll("h1.music-title").forEach(element => {
|
||||
element.href = "";
|
||||
});
|
||||
document.querySelectorAll("div.music").forEach(container => {
|
||||
const link = container.querySelector(".music-title a").href
|
||||
|
||||
container.addEventListener("click", event => {
|
||||
if (event.target.href) return;
|
||||
|
||||
event.preventDefault();
|
||||
location = link;
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue