-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
104 lines (75 loc) · 3.9 KB
/
Copy pathscript.js
File metadata and controls
104 lines (75 loc) · 3.9 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* ALERT-i perdoret si njoftim ne kuader te faqes*/
//window.alert("Mobileria Learti ofron zbritje nga data 13 - 20 Qershor!")
//inicializimi i konstanteve per butona te filterit dhe fotografi te kategorive
const butoni = document.querySelectorAll(".button");
const image = document.querySelectorAll(".image");
// kushtezimi i cili grumbullon te gjitha fotografite e kategorive permes klases image dhe i dallon apo i filtron ne baze te klases femije, nese prindi klase eshte image atehere femiu i prindit eshte kuzhina dmth mirret apo zgjedhet image kuzhina me crast e ka fotografine e vete te kuzhines, tash kushti jon eshte qe kudo qe ka klase te thirrur image kuzhina te shfaqet vetem ajo ndersa tjerat jo.
// kushtezimi per filtrimin dhe kategorizimin e fotografive
for (i = 0; i < butoni.length; i++) // nese jane 4 butona ne faqe sic eshte rasti butoni te gjitha, kuzhina, dhomagjumi, komodina... i grumbullon qe te gjithe i = 0, ska ose nuk gjene butona, krahasimi per me gjete butona i<butoni.length dhe ne fund i++ per ti marr(grumbullu) te gjithe butonat ekzistues
{
butoni[i].addEventListener("click", (e) => {
e.preventDefault();
const filter = e.target.dataset.filter;
image.forEach((image) => {
if (filter === "tegjitha") {
image.style.display = "block";
} else {
if (image.classList.contains(filter)) {
image.style.display = "block";
} else {
image.style.display = "none";
}
}
})
})
}
//ndryshimi i fotografive tek sektori rreth nesh
function mousimbi() {
document.getElementById("first-photo").style.display = "none";
}
function mousijasht() {
document.getElementById("second-photo").style.display = "block";
}
//shfaqja e permbajtjes tek sektori i informatave
function shfaqpunimet() {
document.getElementById("shfaq").style.display = "block";
document.getElementById("butoni").style.display = "none";
}
//ndryshimi i titullit tek sektori i heroit
function ndryshotitullin() {
document.getElementById("titulli-i-ri").innerHTML = "Modelet e fundit i gjeni tek ne!";
}
//funksioni per te ekzekutuar animacionin e kartave pra rrokullisjen e tyre
const cards = document.querySelectorAll(".card")
function flipCard() {
this.classList.toggle("flip");
}
cards.forEach((card) => card.addEventListener("click", flipCard));
//llogaritja e cmimit per meter
const metri = document.getElementById("input1");
const cmimimeter = document.getElementById("input2");
function ndryshoinput2() {
cmimimeter.value = metri.value * 300;
}
metri.addEventListener("input", ndryshoinput2);
//validimi apo kushtezimi i fushave kontaktuese
const emriInput = document.getElementById("emriInput");
const emailInput = document.getElementById("emailInput");
const pershkrimiInput = document.getElementById("pershkrimiInput");
const sendButton = document.getElementById("send-button");
function dergo() { //operatori OSE || operatori DHE &&
if (emriInput.value === "" || emailInput.value === "" || pershkrimiInput.value === "") {
window.alert("Ju lutem mbushi fushat kontaktuese me te dhenat e tyre perkatese!");
} else {
sendButton.value = "Duke u procesuar...";
}
}
sendButton.addEventListener("click", dergo);
const koha = document.getElementById("ora"); // Gjej elementin HTML me id "ora"
function perditesoKohen() {
const tani = new Date(); // Merr kohën aktuale
const kohaStr = tani.toLocaleTimeString('sq-AL', { hour12: false }); // Formato kohën në varg me formatin 24-orësh
koha.innerText = kohaStr; // Vendos vargun e formatizuar në elementin HTML
}
perditesoKohen(); // Thirret funksioni menjëherë për të vendosur kohën fillestare
setInterval(perditesoKohen, 1000); // Përditëso kohën çdo sekondë