-
Notifications
You must be signed in to change notification settings - Fork 0
/
video.js
76 lines (70 loc) · 1.86 KB
/
video.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
//kod angående de två advergamesen.
//främst de statiska elementen på videosidan.
import { videoDOM } from "./includes/functions.js";
let whichLink = linkToSend;
let videoInfo = [
{
videoTitle: "How to play Horizon and not die all the time",
},
{
videoTitle: "Meditate like Dobby",
},
{
videoTitle: "Clickers are the new influencers",
},
{
videoTitle: "Clickers are the new influencers",
},
{
videoTitle: "Clickers are the new influencers",
},
{
videoTitle: "Clickers are the new influencers",
},
{
videoTitle: "Clickers are the new influencers",
},
{
videoTitle: "Clickers are the new influencers",
},
{
videoTitle: "Meditate like Voldemort",
},
{
videoTitle: "Azkaban ASMR",
},
{
videoTitle: "How to build a website. pls.",
},
{
videoTitle: "Meditate like Aloy",
},
]
//initialize alla videor på framsidan
for (let index = 0; index < videoInfo.length; index++) {
const element = videoInfo[index];
videoDOM(element.videoTitle, `assets/images/thumbnails/thumb${index}.png`,
`assets/images/userPics/user.png`,
`video.php?link=${whichLink}&title=${element.videoTitle}`);
index + 1;
}
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
console.log(content);
if (content.style.display === "block") {
content.style.display = "none";
showAttrs(array);
} else {
content.style.display = "block";
}
if (content.style.maxHeight){
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
});
}