-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
102 lines (92 loc) · 3.53 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
<!DOCTYPE html>
<html>
<head>
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="icon"
type="image/png"
href="https://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Magnetic_quadrupole_moment.svg/1200px-Magnetic_quadrupole_moment.svg.png">
<style type="text/css">
/* #background {
background-image: linear-gradient(#EFBDEB,#B68CB8);
} */
</style>
<title> Physics</title>
</head>
<style>
#playground {
border: 1px solid black;
display: block;
float: left;
height: 600px;
width: 600px;
}
#board {
background-color: gray;
height: 600px;
margin-left: 23%;
width: 800px;
}
#options {
width: 160px;
height: 20px;
left: 10px;
}
.slider {
-webkit-appearance: none;
height: 25px;
background: #d3d3d3;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
}
.slider:hover {
opacity: 1;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 25px;
height: 25px;
background: #4CAF50;
cursor: pointer;
}
.slider::-moz-range-thumb {
width: 160px;
height: 25px;
background: #4CAF50;
cursor: pointer;
}
</style>
<body>
<h1 class="text-center">3D Magnetic Field</h1>
<div id="board">
<div id="playground"></div><br>
<select onchange="getChoice()" id="options">
<option value="linecur">Line of Current</option>
<option value="movecharge">Moving Charge</option>
<option value="loopcur">Loop of Current</option>
<option value="solenoid">Solenoid</option>
</select><br>
<button id="reset">Reset</button><br>
<input type="range" min="0.1" max="2.0" value = "1" step = "0.1" class="slider" id="vectordensity"><br>
<p> Vector Density <span id="vectorslider"></span></p>
<input type="range" min="-20" max="20" value = "5" class="slider" id="currentrange"><br>
<p> Current (for Line only): <span id="currentslider"></span></p>
<input type="range" min="10" max="50" value = "20" step = "1" class="slider" id="lengthrange"><br>
<p> Length (for Solenoid and Line): <span id="lengthslider"></span></p>
<input type="range" min="1" max="10" value = "3" step = "1" class="slider" id="radiusrange"><br>
<p> Radius (for Solenoid and Loop): <span id="radslider"></span></p>
<input type="range" min="1" max="5" value = "3" step = "1" class="slider" id="turnrange"><br>
<p> Turns Per Step (for Solenoid only): <span id="turnslider"></span></p>
<input type = "radio" id= "ccw" name = "loopdir" value = "Counterclockwise"> Counterclockwise <br>
<input type = "radio" id= "cw" name = "loopdir" value = "Clockwise"> Clockwise <br>
<p> Direction (for Loop and Solenoid) <span id="loopradio"></span></p>
</div>
</body>
<script src="three.js"></script>
<script src="https://threejs.org/build/three.min.js"></script>
<script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script>
<script src="physics.js"></script>
</html>