-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript1.js
134 lines (119 loc) · 5.52 KB
/
script1.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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
let i;
const topp=document.getElementById("trending");
const thriller=document.getElementById("thriller");
const children=document.getElementById("children");
const romantic=document.getElementById("romantic");
const suspense=document.getElementById("suspence");
async function ne(){
const data=await fetch("./clif.json");
const respdata = await data.json();
// console.log(respdata)
for (i=1;i<=6;i++){
let imgg=document.createElement("div");
imgg.setAttribute('id',String(i))
imgg.innerHTML=`<img src=${respdata["top"][i].Poster} alt="" id="${String(i)}" class="cardimg">`;
topp.appendChild(imgg);
imgg.addEventListener("click",()=>{
const newel=document.createElement("div");
newel.setAttribute('id','discon');
newel.classList.add("content");
newel.innerHTML=`<h1> ${respdata["top"][imgg.id].Title}</h1>
<h2>${respdata["top"][imgg.id].Plot}</h2>
<button class="btn" onclick="lightbox_close();">Play</button>`;
document.querySelector(".judgy").innerHTML=`<img src=${respdata["top"][imgg.id].Poster} alt="" class="imgshow">`;
document.querySelector(".judgy").appendChild(newel);
});
}
i=0;
for (i=1;i<=6;i++){
let imgg=document.createElement("div");
imgg.setAttribute('id',String(i))
imgg.innerHTML=`<img src=${respdata["thriller"][i].Poster} alt="" class="cardimg">`;
thriller.appendChild(imgg);
imgg.addEventListener("click",()=>{
const newel=document.createElement("div");
newel.setAttribute('id','discon');
newel.classList.add("content");
newel.innerHTML=`<h1> ${respdata["thriller"][imgg.id].Title}</h1>
<h2>${respdata["thriller"][imgg.id].Plot}</h2>
<button class="btn" onclick="lightbox_close();">Play</button>`;
document.querySelector(".judgy").innerHTML=`<img src=${respdata["thriller"][imgg.id].Poster} alt="" class="imgshow">`;
document.querySelector(".judgy").appendChild(newel);
});
}
i=0;
for (i=1;i<=6;i++){
let imgg=document.createElement("div");
imgg.setAttribute('id',String(i))
imgg.innerHTML=`<img src=${respdata["children"][i].Poster} alt="" class="cardimg">`;
children.appendChild(imgg);
imgg.addEventListener("click",()=>{
const newel=document.createElement("div");
newel.setAttribute('id','discon');
newel.classList.add("content");
newel.innerHTML=`<h1> ${respdata["children"][imgg.id].Title}</h1>
<h2>${respdata["children"][imgg.id].Plot}</h2>
<button class="btn" onclick="lightbox_close();">Play</button>`;
document.querySelector(".judgy").innerHTML=`<img src=${respdata["children"][imgg.id].Poster} alt="" class="imgshow">`;
document.querySelector(".judgy").appendChild(newel);
});
}
i=0;
for (i=1;i<=6;i++){
let imgg=document.createElement("div");
imgg.setAttribute('id',String(i))
imgg.innerHTML=`<img src=${respdata["suspense"][i].Poster} alt="" class="cardimg">`;
suspense.appendChild(imgg);
imgg.addEventListener("click",()=>{
const newel=document.createElement("div");
newel.setAttribute('id','discon');
newel.classList.add("content");
newel.innerHTML=`<h1> ${respdata["suspense"][imgg.id].Title}</h1>
<h2>${respdata["suspense"][imgg.id].Plot}</h2>
<button class="btn" onclick="lightbox_close();">Play</button>`;
document.querySelector(".judgy").innerHTML=`<img src=${respdata["suspense"][imgg.id].Poster} alt="" class="imgshow">`;
document.querySelector(".judgy").appendChild(newel);
});
}
i=0;
for (i=1;i<=6;i++){
let imgg=document.createElement("div");
imgg.setAttribute('id',String(i))
imgg.innerHTML=`<img src=${respdata["romantic"][i].Poster} alt="" class="cardimg">`;
romantic.appendChild(imgg);
imgg.addEventListener("click",()=>{
const newel=document.createElement("div");
newel.setAttribute('id','discon');
newel.classList.add("content");
newel.innerHTML=`<h1> ${respdata["romantic"][imgg.id].Title}</h1>
<h2>${respdata["romantic"][imgg.id].Plot}</h2>
<button class="btn" onclick="lightbox_close();">Play</button>`;
document.querySelector(".judgy").innerHTML=`<img src=${respdata["romantic"][imgg.id].Poster} alt="" class="imgshow">`;
document.querySelector(".judgy").appendChild(newel);
});
}
}
ne()
window.document.onkeydown = function(e) {
if (!e) {
e = event;
}
if (e.keyCode == 27) {
lightbox_close();
}
}
function lightbox_open() {
document.getElementById("VisaChipCardVideo").classList.toggle("hide");
var lightBoxVideo = document.getElementById("VisaChipCardVideo");
window.scrollTo(0, 0);
document.getElementById('light').style.display = 'block';
document.getElementById('fade').style.display = 'block';
lightBoxVideo.play();
}
function lightbox_close() {
document.getElementById("VisaChipCardVideo").classList.toggle("hide");
var lightBoxVideo = document.getElementById("VisaChipCardVideo");
document.getElementById('light').style.display = 'none';
document.getElementById('fade').style.display = 'none';
lightBoxVideo.pause();
}