-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
50 lines (44 loc) · 1.69 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//FUNKTIION FÖR FEEDBACK
// Hämta element för feedback
const feedbackIcon = document.getElementById("feedback-icon");
const feedbackPopup = document.getElementById("feedback-popup");
const closeBtn = document.getElementById("close-btn");
document.addEventListener("DOMContentLoaded", function () {
const feedbackIcon = document.getElementById("feedback-icon");
if (!feedbackIcon) {
console.error("Footer har inte laddats in innan main.js körs!");
return;
}
});
// Öppna pop-up när man klickar på ikonen
feedbackIcon.onclick = function() {
feedbackPopup.style.display = "flex";
};
// Stäng pop-up när man klickar på "×"
closeBtn.onclick = function() {
feedbackPopup.style.display = "none";
};
// Stäng pop-up om man klickar utanför pop-up innehållet
window.onclick = function(event) {
if (event.target === feedbackPopup) {
feedbackPopup.style.display = "none";
}
};
// FUNKTION FÖR YOUTUBE FILM SOM INTE VILL VISAS
function replaceWithIframe() {
const container = document.querySelector('.custom-thumbnail');
container.innerHTML = `
<iframe
width="560"
height="315"
src="https://www.youtube-nocookie.com/embed/ASPz8teIqCA?autoplay=1"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
`;
}
// BYTER UT ÅRTALET I FOOTERN AUTOMATISK
document.getElementById("current-year").textContent = new Date().getFullYear();