-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
82 lines (61 loc) · 1.95 KB
/
script.js
File metadata and controls
82 lines (61 loc) · 1.95 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
// ================= SLAYT =================
let currentSlide = 0;
const slides = document.querySelectorAll(".slide");
const slider = document.querySelector(".slider");
const dots = document.querySelectorAll(".dot");
function showSlide(index) {
if (index < 0) index = slides.length - 1;
if (index >= slides.length) index = 0;
currentSlide = index;
// Kaydırma
slider.style.transform = `translateX(-${index * 100}%)`;
// Nokta güncelleme
dots.forEach((dot, i) => {
dot.classList.toggle("active", i === index);
});
}
function nextSlide() {
showSlide(currentSlide + 1);
}
function prevSlide() {
showSlide(currentSlide - 1);
}
function goToSlide(index) {
showSlide(index);
}
// İlk gösterim
showSlide(0);
// Otomatik geçiş
setInterval(nextSlide, 5000);
// ================= NAVBAR MENÜ =================
function toggleMenu() {
const sidebar = document.getElementById("sidebar");
sidebar.style.left = sidebar.style.left === "0px" ? "-260px" : "0px";
}
// ================= PROGRAM =================
function openFullScreen(img) {
const modal = document.getElementById("imgModal");
const modalImg = document.getElementById("modalImg");
modal.style.display = "block";
modalImg.src = img.src;
}
function closeFullScreen() {
document.getElementById("imgModal").style.display = "none";
}
// ================= DUYURU =================
function openDuyuru(id) {
document.getElementById(id).style.display = "block";
}
function closeDuyuru(id) {
document.getElementById(id).style.display = "none";
}
// ================= GALLERY =================
function openGallery(img) {
const modal = document.getElementById("galleryModal");
const modalImg = document.getElementById("galleryModalImg");
modal.style.display = "block";
modalImg.src = img.src;
}
function closeGallery() {
document.getElementById("galleryModal").style.display = "none";
}