hide links in spoilers but still prevent clicking them if u cant see them

pull/176/head
Aevann 2023-08-03 11:23:08 +03:00
parent 27b1389da1
commit afea091a1d
2 changed files with 24 additions and 0 deletions

View File

@ -5240,6 +5240,17 @@ span.green {
.spoiler:hover img, spoiler:hover img {
visibility: visible;
}
.spoiler a, spoiler a {
visibility: hidden;
}
.spoiler:hover a[clicked], spoiler:hover a[clicked] {
visibility: visible;
}
@media (min-width: 768px) {
.spoiler:hover a, spoiler:hover a {
visibility: visible;
}
}
@media (min-width: 768px) {
.comment {

View File

@ -221,6 +221,19 @@ document.addEventListener("click", function (e) {
i.removeAttribute("data-bs-dismiss")
});
}
if (screen_width < 768) {
if (element.tagName == 'SPOILER') {
for (const a of element.getElementsByTagName('a')) {
a.setAttribute('clicked', true)
}
}
else if (element.tagName != 'A') {
for (const a of document.querySelectorAll('a[clicked]')) {
a.removeAttribute('clicked')
}
}
}
});
const inputs = document.querySelectorAll('input[type="number"]')