-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinline_script_16.js
More file actions
95 lines (41 loc) · 1.67 KB
/
inline_script_16.js
File metadata and controls
95 lines (41 loc) · 1.67 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
document.querySelectorAll('.entertainment-card').forEach(card => {
const content = card.querySelector('.entertainment-content');
const iframe = card.querySelector('.entertainment-iframe');
const closeBtn = card.querySelector('.entertainment-close-btn');
const fullscreenBtn = card.querySelector('.entertainment-fullscreen-btn');
// Open iframe
content.addEventListener('click', () => {
card.classList.add('active');
});
// Close iframe without refresh
closeBtn.addEventListener('click', (e) => {
e.stopPropagation();
card.classList.remove('active');
card.classList.remove('fullscreen');
// Show other cards
document.querySelectorAll('.entertainment-card').forEach(otherCard => {
otherCard.style.display = 'block';
});
});
// Fullscreen functionality
fullscreenBtn.addEventListener('click', (e) => {
e.stopPropagation();
card.classList.add('fullscreen');
// Hide other cards
document.querySelectorAll('.entertainment-card').forEach(otherCard => {
if (otherCard !== card) {
otherCard.style.display = 'none';
}
});
});
// Exit fullscreen
document.addEventListener('fullscreenchange', () => {
if (!document.fullscreenElement) {
card.classList.remove('fullscreen');
// Show other cards
document.querySelectorAll('.entertainment-card').forEach(otherCard => {
otherCard.style.display = 'block';
});
}
});
});