-
Notifications
You must be signed in to change notification settings - Fork 0
/
video.js
119 lines (82 loc) · 2.62 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
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
let datas=JSON.parse(localStorage.getItem("userData"))
console.log(datas)
document.getElementById("baljor").innerHTML=datas.name
let data=JSON.parse(localStorage.getItem("data"))
console.log(data)
let title=document.getElementById("title")
title.innerText=data.title
let con=document.getElementById("f")
let video=document.createElement("iframe")
video.src=data.videos
con.append(video)
let data_container=document.getElementById("data_div")
let sort=document.createElement("p")
sort.innerText=data.Sort
sort.setAttribute("id","sort")
let fault=document.createElement("h4")
fault.innerText="Muscle group:"
fault.setAttribute("id","fault")
let muscleGroup=document.createElement("p")
muscleGroup.innerText=data.muscleGroup
muscleGroup.setAttribute("id","muscleGroup")
muscleGroup.addEventListener("click",function(){
window.location.href="chest.html"
})
let step=document.createElement("h2")
step.innerText=data.stepname
step.setAttribute("id","step")
let steps=document.createElement("p")
steps.innerText=data.steps
steps.setAttribute("id","steps")
let tip=document.createElement("h2")
tip.innerText=data.tipname
tip.setAttribute("id","tip")
let tips=document.createElement("p")
tips.innerText=data.tips
tips.setAttribute("id","tips")
let button=document.createElement("button")
button.innerText="❮ All exercise"
button.setAttribute("id","btn")
button.addEventListener("click",function(){
window.location.href="main.html"
})
data_container.append(sort,fault,muscleGroup,step,steps,tip,tips,button)
document.getElementById("video").addEventListener("click",function(){
window.location.reload()
})
document.getElementById("photo").addEventListener("click",function(){
let video= document.getElementById("video")
video.style.border="none",
video.style.borderBottom ="1px solid grey",
video.style.color="#428bca"
// video.setAttribute("id","video2")
let photo=document.getElementById("photo")
photo.style.border="1px solid grey"
photo.style.borderBottom="none"
photo.style.borderRadius="3px"
photo.style.color="none"
let data=JSON.parse(localStorage.getItem("data"))
console.log(data)
let con=document.getElementById("f")
con.innerHTML=null
con.setAttribute("id","con")
let videos=document.createElement("img")
videos.src=data.bigImg
videos.setAttribute("id","pic")
con.append(videos)
images = new Array;
images[0] = data.bigImg1;
images[1] = data.bigImg;
setInterval( function() {
changeImage()
}, 1000);
x = 0;
function changeImage() {
document.getElementById('pic').src = images[x];
if ( x < 1 ) {
x += 1;
} else if ( x = 2 ) {
x = 0;
}
}
})