-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideo Screen.html
More file actions
142 lines (111 loc) · 5.54 KB
/
Video Screen.html
File metadata and controls
142 lines (111 loc) · 5.54 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Video</title>
<!-- Sets up Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<style>
</style>
</head>
<body>
<div id="container" class="container">
<!-- Navbar -->
<nav class="row">
<!-- Skill name and save skill -->
<div class="col row-cols-1">
<div id="skill-name" class="col text-center">Skill Name</div>
<btn id="save-skill" class="col btn-secondary">Save Skill</btn>
</div>
<!-- Search bar -->
<input id="search-bar" class="col" placeholder="Search" style="height: 2em;" on></input>
<!-- Skill categories -->
<div id="categories" class="col row-cols-1">
<div class="col text-center">Category1</div>
<div class="col text-center">Category2</div>
<div class="col text-center">Category3</div>
</div>
</nav>
<!-- Video -->
<figure class="text-center">
<iframe id="video" width="560" height="315" src="" title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
</figure>
<!-- Detail buttons -->
<div class="btn-group w-100">
<input id="explanation-btn" type="radio" class="btn-check" name="detail-btn" checked
onclick="changeDetails()">
<label for="explanation-btn" class="btn btn-outline-secondary">Explanation</label>
<input id="prerequisites-btn" type="radio" class="btn-check" name="detail-btn" onclick="changeDetails()">
<label for="prerequisites-btn" class="btn btn-outline-secondary">Prerequisites</label>
<input id="transitions-btn" type="radio" class="btn-check" name="detail-btn" onclick="changeDetails()">
<label for="transitions-btn" class="btn btn-outline-secondary">Transitions</label>
</div>
<!-- The chosen details -->
<section id="details"></section>
</div>
<!-- Sets up Bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js"
integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
crossorigin="anonymous"></script>
<!-- Sets up jQuery -->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
<!-- Setting up the skill list -->
<script src="Skill-List.js"></script>
<script>
// Takes the skill name and returns its data
function chooseSkill(skillName) {
if (skills.hasOwnProperty(skillName)) {
return skills[skillName]
}
}
// Changes the name and categories of the skill
function searchSkill(event) {
try {
const skill = chooseSkill(event.target.value)
$('#skill-name').text(skill['שם התרגיל'])
$('#categories').html(setCategories(skill))
$('#video').attr('src', skill['קישור'])
} catch (error) {
}
}
// Changes the categories to match the categories of the skill
function setCategories(skill) {
let retVal = `<div>רמת קושי: ${skill['רמת קושי']}</div>
<div>רמת סיכון: ${skill['רמת סיכון']}</div>`
// Find out which categories the skill has
for (let i = 0; i < categories.length; ++i) {
if (skill[categories[i]] != '') {
retVal += `<div>${categories[i]}</div>`
}
}
return retVal
}
function changeDetails() {
if ($('#explanation-btn').is(':checked') === true) {
$('#details').html(explanation)
}
else if ($('#prerequisites-btn').is(':checked') === true) {
$('#details').html(prerequisites)
}
else if ($('#transitions-btn').is(':checked') === true) {
$('#details').html(transitions)
}
}
const explanation = '<p id="explanation" class="">A description of the skill</p>'
const prerequisites = '<ul id="prerequisites" class="" style="list-style: none;"><li><a class="" href="">Skill1</a></li><li><a class="" href="">Skill2</a></li><li><a class="" href="">Skill3</a></li></ul>'
const transitions = '<ul id="transitions" class="" style="list-style: none;"><li><a class="" href="">Skill1</a></li><li><a class="" href="">Skill2</a></li><li><a class="" href="">Skill3</a></li></ul>'
$(document).ready(function () {
$('btn').addClass('btn')
$(document).on('keydown', 'input', searchSkill)
})
</script>
</body>
</html>