2020-10-04 01:34:27 +02:00
|
|
|
let isTooltipVisible = false;
|
|
|
|
|
|
|
|
function toggleTooltip() {
|
|
|
|
const articleFooter = document.querySelector(".articleFooter");
|
|
|
|
const articleImage = document.querySelector(".authorImage");
|
|
|
|
const articleAuthorAndDate = document.querySelector(".nameAndDate");
|
|
|
|
const articleShareButton = document.querySelector(".articleShareButton");
|
|
|
|
const articleShareTooltip = document.querySelector(".articleShareButtonTooltip");
|
|
|
|
const articleShareSection = document.querySelector(".articleShareSection");
|
|
|
|
|
2020-10-04 11:56:44 +02:00
|
|
|
if (window.innerWidth <= 650) {
|
2020-10-04 01:34:27 +02:00
|
|
|
if (isTooltipVisible) {
|
|
|
|
articleFooter.classList.remove("backgroundDark");
|
|
|
|
articleShareButton.classList.remove("buttonDark");
|
|
|
|
articleShareSection.style.display = "none";
|
|
|
|
articleImage.style.display = "block";
|
|
|
|
articleAuthorAndDate.style.display = "block";
|
|
|
|
isTooltipVisible = false;
|
|
|
|
} else {
|
|
|
|
articleFooter.classList.add("backgroundDark");
|
|
|
|
articleShareButton.classList.add("buttonDark");
|
|
|
|
articleShareSection.style.display = "flex";
|
|
|
|
articleImage.style.display = "none";
|
|
|
|
articleAuthorAndDate.style.display = "none";
|
|
|
|
isTooltipVisible = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (isTooltipVisible) {
|
|
|
|
articleShareButton.classList.remove("buttonDark");
|
|
|
|
articleShareTooltip.style.display = "none";
|
|
|
|
isTooltipVisible = false;
|
|
|
|
} else {
|
|
|
|
articleShareButton.classList.add("buttonDark");
|
|
|
|
articleShareTooltip.style.display = "flex";
|
|
|
|
isTooltipVisible = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|