-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmidSec.js
273 lines (246 loc) · 11.9 KB
/
midSec.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
let Images=[["https://is2-ssl.mzstatic.com/image/thumb/WTDZpzkQlaatpb1X4w9jZg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/UbqKgHISX2yxGI_UfPieQg/738x416.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Ayre02kzYy-UP8Sefqbmdg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/5SQrBAWXONSSRweUSmuRyg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/IyvoDdhWEjtSADaSryepIw/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/kjrFHClZ3Bt-pT0MJnwdFw/738x416.webp",
"https://is5-ssl.mzstatic.com/image/thumb/P1P6DmiXiY9bhAsQJAdpkg/738x416.webp",
"https://is2-ssl.mzstatic.com/image/thumb/78-I7VenST4ztZYfwMf6AQ/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/i1482ZJ0WuDzQNcH_-HNpw/738x416.webp",
"https://is3-ssl.mzstatic.com/image/thumb/AWDRdQz0nepFpnsUNiTDuw/738x416.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Ayre02kzYy-UP8Sefqbmdg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/5SQrBAWXONSSRweUSmuRyg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/IyvoDdhWEjtSADaSryepIw/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/kjrFHClZ3Bt-pT0MJnwdFw/738x416.webp",
"https://is5-ssl.mzstatic.com/image/thumb/P1P6DmiXiY9bhAsQJAdpkg/738x416.webp",
"https://is2-ssl.mzstatic.com/image/thumb/78-I7VenST4ztZYfwMf6AQ/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/i1482ZJ0WuDzQNcH_-HNpw/738x416.webp",
],[
"https://is2-ssl.mzstatic.com/image/thumb/Features112/v4/80/3b/58/803b580f-8b9f-e99d-d053-6124cf548479/79c42e3e-96f3-49d9-9c2b-252930176e12.lsr/1478x832fe.webp",
"https://is3-ssl.mzstatic.com/image/thumb/Features122/v4/c5/d0/30/c5d03030-9ec5-b7f3-7757-567f0d99f1bb/902a8709-411c-4f39-ac13-c65d25657a26.lsr/1478x832fe.webp",
"https://is3-ssl.mzstatic.com/image/thumb/Features112/v4/fb/38/6c/fb386ce9-de7c-8512-2a91-03ab8768e172/424306cc-bc3e-4d91-a805-791793e9d325.lsr/1478x832fe.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Features122/v4/bf/8d/cb/bf8dcbd1-9d32-377b-2980-127c5e8e09da/f177699a-5960-4504-b1d7-275f91999c02.lsr/1478x832fe.webp",
"https://is2-ssl.mzstatic.com/image/thumb/Features112/v4/80/3b/58/803b580f-8b9f-e99d-d053-6124cf548479/79c42e3e-96f3-49d9-9c2b-252930176e12.lsr/1478x832fe.webp",
"https://is3-ssl.mzstatic.com/image/thumb/Features122/v4/c5/d0/30/c5d03030-9ec5-b7f3-7757-567f0d99f1bb/902a8709-411c-4f39-ac13-c65d25657a26.lsr/1478x832fe.webp",
"https://is3-ssl.mzstatic.com/image/thumb/Features112/v4/fb/38/6c/fb386ce9-de7c-8512-2a91-03ab8768e172/424306cc-bc3e-4d91-a805-791793e9d325.lsr/1478x832fe.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Features122/v4/bf/8d/cb/bf8dcbd1-9d32-377b-2980-127c5e8e09da/f177699a-5960-4504-b1d7-275f91999c02.lsr/1478x832fe.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Features122/v4/cb/f1/78/cbf1786a-d76a-b572-dd42-de2d0d598a1e/fc0f5e83-9aff-48b7-a1a2-329faf4b45f6.lsr/1478x832fe.webp"
],[
"https://is2-ssl.mzstatic.com/image/thumb/6tJakyTEtS0vrgdc9POZpg/738x416.webp",
"https://is2-ssl.mzstatic.com/image/thumb/qYEYYvFXN2O4zEuCcBSbjw/738x416.webp",
"https://is4-ssl.mzstatic.com/image/thumb/rZ34KsuVSjdutVP-0HO95A/738x416.webp",
"https://is5-ssl.mzstatic.com/image/thumb/NHLksWLSZpTcIw36-n7vWA/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/yXhlXOFkS9yJ1kMmOhfIbg/738x416.webp",
"https://is2-ssl.mzstatic.com/image/thumb/SEsiWD2cTDShiJqUtRPAxg/738x416.webp",
"https://is2-ssl.mzstatic.com/image/thumb/dbEKo7rp5RGNNDrCbA7AUQ/738x416.webp",
"https://is3-ssl.mzstatic.com/image/thumb/kVTKGnVvCdFlB1sZeKa8YQ/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/Tb1jarRHaWN_SFiMjZcDHw/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/QiFf4rD5DY65HbtJUOjE7Q/738x416.webp",
"https://is4-ssl.mzstatic.com/image/thumb/fiTyznFr4Rsvd25TNhffww/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/lN-bUPh0Botn7U7jKgbnFg/738x416.webp",
"https://is3-ssl.mzstatic.com/image/thumb/IryLNqf3vJszRupPX70Elg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/vPnF3gIE_xEMoXPI1SyluA/738x416.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Ro6cUnMcHLf3sEVL38YlRg/738x416.webp"
],
[
"https://is5-ssl.mzstatic.com/image/thumb/XtNPMhEaBU1FKkk_QK-DeA/1478x832.webp",
"https://is1-ssl.mzstatic.com/image/thumb/kjrFHClZ3Bt-pT0MJnwdFw/1478x832.webp",
"https://is4-ssl.mzstatic.com/image/thumb/_WDO4pxq_b43sYn1s-nJQg/1478x832.webp",
"https://is1-ssl.mzstatic.com/image/thumb/vPnF3gIE_xEMoXPI1SyluA/1478x832.webp",
"https://is2-ssl.mzstatic.com/image/thumb/lQggjzswj8ZD1hym1_oVGQ/1478x832.webp",
"https://is1-ssl.mzstatic.com/image/thumb/BXmR2-KFYGt0UOGwMaocBg/1478x832.webp",
"https://is1-ssl.mzstatic.com/image/thumb/UbqKgHISX2yxGI_UfPieQg/1478x832.webp",
"https://is1-ssl.mzstatic.com/image/thumb/Ulms3rha_yDCvDVlZyYUoQ/1478x832.webp",
"https://is2-ssl.mzstatic.com/image/thumb/MPHEuT8HXoHbzDAGFDcYJA/1478x832.webp",
"https://is3-ssl.mzstatic.com/image/thumb/IryLNqf3vJszRupPX70Elg/1478x832.webp"
],[
"https://tv.apple.com/in/show/black-bird/umc.cmc.30gx1y8nwthydkrvhqu156p3?ctx_brand=tvs.sbd.4000",
"https://tv.apple.com/in/show/shining-girls/umc.cmc.22xs4xobsimzy5qqdif0rhmdy?ctx_brand=tvs.sbd.4000",
"https://tv.apple.com/in/show/pachinko/umc.cmc.17vf6g68dy89kk1l1nnb6min4?ctx_brand=tvs.sbd.4000",
"https://tv.apple.com/in/show/the-essex-serpent/umc.cmc.1vyhx06lta7a21tshl8qitota?ctx_brand=tvs.sbd.4000",
"https://tv.apple.com/in/show/slow-horses/umc.cmc.2szz3fdt71tl1ulnbp8utgq5o?ctx_brand=tvs.sbd.4000",
],
["https://is2-ssl.mzstatic.com/image/thumb/WTDZpzkQlaatpb1X4w9jZg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/UbqKgHISX2yxGI_UfPieQg/738x416.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Ayre02kzYy-UP8Sefqbmdg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/5SQrBAWXONSSRweUSmuRyg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/IyvoDdhWEjtSADaSryepIw/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/kjrFHClZ3Bt-pT0MJnwdFw/738x416.webp",
"https://is5-ssl.mzstatic.com/image/thumb/P1P6DmiXiY9bhAsQJAdpkg/738x416.webp",
"https://is2-ssl.mzstatic.com/image/thumb/78-I7VenST4ztZYfwMf6AQ/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/i1482ZJ0WuDzQNcH_-HNpw/738x416.webp",
"https://is3-ssl.mzstatic.com/image/thumb/AWDRdQz0nepFpnsUNiTDuw/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/UbqKgHISX2yxGI_UfPieQg/738x416.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Ayre02kzYy-UP8Sefqbmdg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/5SQrBAWXONSSRweUSmuRyg/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/IyvoDdhWEjtSADaSryepIw/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/kjrFHClZ3Bt-pT0MJnwdFw/738x416.webp",
"https://is5-ssl.mzstatic.com/image/thumb/P1P6DmiXiY9bhAsQJAdpkg/738x416.webp",
"https://is2-ssl.mzstatic.com/image/thumb/78-I7VenST4ztZYfwMf6AQ/738x416.webp",
"https://is1-ssl.mzstatic.com/image/thumb/i1482ZJ0WuDzQNcH_-HNpw/738x416.webp",
],[
"https://is2-ssl.mzstatic.com/image/thumb/Features112/v4/80/3b/58/803b580f-8b9f-e99d-d053-6124cf548479/79c42e3e-96f3-49d9-9c2b-252930176e12.lsr/1478x832fe.webp",
"https://is3-ssl.mzstatic.com/image/thumb/Features122/v4/c5/d0/30/c5d03030-9ec5-b7f3-7757-567f0d99f1bb/902a8709-411c-4f39-ac13-c65d25657a26.lsr/1478x832fe.webp",
"https://is3-ssl.mzstatic.com/image/thumb/Features112/v4/fb/38/6c/fb386ce9-de7c-8512-2a91-03ab8768e172/424306cc-bc3e-4d91-a805-791793e9d325.lsr/1478x832fe.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Features122/v4/bf/8d/cb/bf8dcbd1-9d32-377b-2980-127c5e8e09da/f177699a-5960-4504-b1d7-275f91999c02.lsr/1478x832fe.webp",
"https://is2-ssl.mzstatic.com/image/thumb/Features112/v4/80/3b/58/803b580f-8b9f-e99d-d053-6124cf548479/79c42e3e-96f3-49d9-9c2b-252930176e12.lsr/1478x832fe.webp",
"https://is3-ssl.mzstatic.com/image/thumb/Features122/v4/c5/d0/30/c5d03030-9ec5-b7f3-7757-567f0d99f1bb/902a8709-411c-4f39-ac13-c65d25657a26.lsr/1478x832fe.webp",
"https://is3-ssl.mzstatic.com/image/thumb/Features112/v4/fb/38/6c/fb386ce9-de7c-8512-2a91-03ab8768e172/424306cc-bc3e-4d91-a805-791793e9d325.lsr/1478x832fe.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Features122/v4/bf/8d/cb/bf8dcbd1-9d32-377b-2980-127c5e8e09da/f177699a-5960-4504-b1d7-275f91999c02.lsr/1478x832fe.webp",
"https://is4-ssl.mzstatic.com/image/thumb/Features122/v4/cb/f1/78/cbf1786a-d76a-b572-dd42-de2d0d598a1e/fc0f5e83-9aff-48b7-a1a2-329faf4b45f6.lsr/1478x832fe.webp"
]
]
//Most popular now First=0;
let divN=5;
let headT="Most Popular Now";
let class1="mpn"
let ImageInd=0;
let hr=1;
divMake(divN,headT,class1,ImageInd,".category",hr)
//Black bird;
divN=4;
headT="Black Bird";
class1="bb"
ImageInd=1;
divMake(divN,headT,class1,ImageInd,".category",hr)
//Watch Entire Seasons
divN=5;
headT="Watch Entire Seasons";
class1="wes"
ImageInd=2;
divMake(divN,headT,class1,ImageInd,".category",hr)
// Latest Originals
divN=5;
headT="Latest Originals";
class1="lo"
ImageInd=3;
divMake(divN,headT,class1,ImageInd,".category",hr)
// coming Soon
divN=4;
headT="Coming Soon";
class1="cs"
ImageInd=0;
divMake(divN,headT,class1,ImageInd,".category",hr)
//Bottom Section
divN=6;
headT="";
class1="inDiv"
ImageInd=1;
hr=0;
divMake(divN,headT,class1,ImageInd,".BotSec",hr)
//Laugh Out Loud
divN=5;
headT="Laugh Out Loud";
class1="lol"
ImageInd=2;
hr=1;
divMake(divN,headT,class1,ImageInd,".BotCategory",hr)
//Adventures of a lifetime
divN=5;
headT="Adventures of a Lifetime";
class1="aol"
ImageInd=3;
hr=1;
divMake(divN,headT,class1,ImageInd,".BotCategory",hr)
//Thrilling Series
divN=5;
headT="Thrilling Series";
class1="ts"
ImageInd=0;
hr=1;
divMake(divN,headT,class1,ImageInd,".BotCategory",hr)
//Extraoridinary People
divN=5;
headT="Extraoridinary People";
class1="ep"
ImageInd=1;
hr=1;
divMake(divN,headT,class1,ImageInd,".BotCategory",hr)
//All Feature Films
divN=5;
headT="All Feature Films";
class1="aff"
ImageInd=2;
hr=1;
divMake(divN,headT,class1,ImageInd,".BotCategory",hr)
//Cha cha real smooth
divN=4;
headT="Cha Cha Real Smooth";
class1="ccrs"
ImageInd=3;
hr=1;
divMake(divN,headT,class1,ImageInd,".BotCategory",hr)
//All Comedy Series
divN=5;
headT="All Comedy Series";
class1="acs"
ImageInd=2;
hr=0;
divMake(divN,headT,class1,ImageInd,".BotCategory",hr)
function divMake(divN,headT,class1,ImageInd,appendIn,hr){
let b1=class1+"l";
let b2=class1+"r";
let btn1=document.createElement("button")
btn1.setAttribute("class",b1)
btn1.innerText="<";
let btn2=document.createElement("button")
btn2.setAttribute("class",b2)
btn2.innerText=">";
let divMain1=document.createElement("div")
divMain1.setAttribute("class",class1)
divMain1.append(btn1)
let a=0;
for(let i=0;i<divN;i++){
let div=document.createElement("div")
let imge=document.createElement("img")
imge.setAttribute("class",class1+i)
imge.setAttribute("src",Images[ImageInd][a]);
a++;
div.append(imge)
divMain1.append(div)
}
a=0;
let heading1=document.createElement("h3")
heading1.innerText=headT
divMain1.append(btn2)
document.querySelector(appendIn).append(heading1,divMain1)
if(hr==1){
document.querySelector(appendIn).append(document.createElement("hr"))
}
btn1.addEventListener("click",function(){
a--;
let b=a;
for(let i=0;i<divN;i++){
let imge=document.querySelector("."+class1+i)
if(b<0){
if(a==-(Images[ImageInd].length+1)){
a=-1;
}
b=Images[ImageInd].length+a;
} else if (b>Images[ImageInd].length-1){
b=0;
}
console.log(a,b)
imge.setAttribute("src",Images[ImageInd][b])
b++;
}
})
btn2.addEventListener("click",function(){
a++;
console.log(a)
let b=a;
for(let i=0;i<divN;i++){
let imge=document.querySelector("."+class1+i)
if(b<0){
b=Images[ImageInd].length-1;
} else if (b>Images[ImageInd].length-1){
if(a==(Images[ImageInd].length)){
a=0;
}
b=0;
}
imge.setAttribute("src",Images[ImageInd][b])
b++;
}
})
}