-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
112 lines (107 loc) · 4.64 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>OpenEdu_PendulumLab</title>
<script src="js/matter.js"></script>
<script src="js/main.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
.slider {
-webkit-appearance: none;
width: 33%;
height: 15px;
border-radius: 5px;
background: #d3d3d3;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 25px;
height: 25px;
border-radius: 50%;
background: rgb(20, 127, 250);
cursor: pointer;
}
.slider::-moz-range-thumb {
border-radius: 50%;
background: rgb(20, 127, 250);
cursor: pointer;
}
</style>
</head>
<body>
<div>
<div class="container" style="margin-top: 30px">
<h1 align="center">單擺實驗</h1>
</div>
<div>
<div class="container">
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab"
aria-controls="nav-home" aria-selected="true">練習模式</a>
<a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab"
aria-controls="nav-profile" aria-selected="false">測驗模式</a>
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">
<br>
<h3 style="margin-left: 10px" id="Practice">
{"length":?,"density":?,"gravity":?,"air_resistance":?}
</h3>
</div>
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">
<br>
<h3 style="margin-left: 10px" id="Exam">
警告!測驗只有一次機會,送出後無法修改
<button type="button" class="btn btn-success" onclick="StartExam()" style="margin-left: 10px">開始考試</button>
</h3>
</div>
</div>
</div>
<br>
<div class="row" id="Try">
<div class="col-md-7" id="script"></div>
<div class="col-md-5">
<p id="Exam-len">長度: <span id="length_value"></span><br>
0.1 <input type="range" min="1" max="10" value="5" class="slider" id="length"> 1.0
</p>
<br>
<p>質量: <span id="density_value"></span><br>
0.1 <input type="range" min="1" max="15" value="10" class="slider" id="density"> 1.5
</p>
<br>
<p>重力: <span id="gravity_value"></span><br>
0.0 <input type="range" min="0" max="23.7" value="10" class="slider" id="gravity"> 2.3
</p>
<br>
<p>空氣阻力: <span id="air_resistance_value"></span><br>
0.0 <input type="range" min="0" max="100" value="0" class="slider" id="air_resistance"> 0.1
</p>
<br>
<button type="button" class="btn btn-primary" id="submit-btn" style="display: none;">送出</button>
<p class="text-center" id="state"></p>
</div>
</div>
</div>
</div>
<script>
function StartExam() {
$('#Try').show();
$('#Exam').html('題目:增加單擺的的周期');
$('#nav-tab').html('<a class="nav-link" href="#">練習模式</a>'+'<a class="nav-link active" href="#">測驗模式</a>');
$("#density").attr('disabled',true);
$("#gravity").attr('disabled',true);
$("#air_resistance").attr('disabled',true);
}
</script>
</body>
</html>