-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
160 lines (157 loc) · 4.91 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link id="style" rel="stylesheet" href="style.css" />
<title>Enigma Machine</title>
</head>
<body>
<div id="main">
<div id="heading">
<h1>Enigma Machine</h1>
</div>
<div class="rotor-container">
<div class="rotor">
<h3>Left Rotor</h3>
<select
name="rotor"
id="leftRotorType"
onchange="updateRotorType('left')"
>
<option value="I">I</option>
<option value="II">II</option>
<option value="III">III</option>
<option value="IV">IV</option>
<option value="V">V</option>
<option value="VI">VI</option>
<option value="VII">VII</option>
<option value="VIII">VIII</option>
</select>
<br />
<button class="rotor-sign" onclick="updateRotorPos('left', 'inc')">
+
</button>
<p class="rotor-content" id="leftRotorPos">0</p>
<button class="rotor-sign" onclick="updateRotorPos('left', 'dec')">
-
</button>
</div>
<div class="rotor">
<h3>Middle Rotor</h3>
<select
name="rotor"
id="middleRotorType"
onchange="updateRotorType('middle')"
>
<option value="I">I</option>
<option value="II">II</option>
<option value="III">III</option>
<option value="IV">IV</option>
<option value="V">V</option>
<option value="VI">VI</option>
<option value="VII">VII</option>
<option value="VIII">VIII</option>
</select>
<br />
<button class="rotor-sign" onclick="updateRotorPos('middle', 'inc')">
+
</button>
<p class="rotor-content" id="middleRotorPos">0</p>
<button class="rotor-sign" onclick="updateRotorPos('middle', 'dec')">
-
</button>
</div>
<div class="rotor">
<h3>Right Rotor</h3>
<select
name="rotor"
id="rightRotorType"
onchange="updateRotorType('right')"
>
<option value="I">I</option>
<option value="II">II</option>
<option value="III">III</option>
<option value="IV">IV</option>
<option value="V">V</option>
<option value="VI">VI</option>
<option value="VII">VII</option>
<option value="VIII">VIII</option>
</select>
<br />
<button class="rotor-sign" onclick="updateRotorPos('right', 'inc')">
+
</button>
<p class="rotor-content" id="rightRotorPos">0</p>
<button class="rotor-sign" onclick="updateRotorPos('right', 'dec')">
-
</button>
</div>
</div>
<div class="relfectorType rotor-container">
<h3>Reflector</h3>
<br />
<select
name="reflector"
id="reflectorType"
onchange="updateReflector()"
>
<option value="B">B</option>
<option value="C">C</option>
</select>
</div>
<div class="pluboard rotor-container">
<!-- make a plugboard input with maxLenght 20 and it should check condition written in js whenever ther is a chaneg -->
<h3>Plugboard</h3>
<br />
<input
type="text"
id="plugboard"
name="plugboard"
placeholder="Enter plugboard settings"
maxlength="20"
oninput="updatePlugboard()"
/>
<p1 id="plugboardError"></p1>
</div>
<div class="text">
<div class="input">
<h3>Enter the text to Encode</h3>
<textarea
placeholder="Enter something funny."
id="texti"
name="text"
rows="4"
style="
overflow: hidden;
word-wrap: break-word;
resize: none;
height: 160px;
"
oninput="newEnigma()"
></textarea>
</div>
<div class="output">
<h3>Encoded Text</h3>
<textarea
readonly
placeholder="Magic Is Gone Happen."
id="texto"
name="text"
rows="4"
style="
overflow: hidden;
word-wrap: break-word;
resize: none;
height: 160px;
"
></textarea>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
<footer>
<p>Made with ❤️ by Jay Sabva</p>
</footer>
</html>