Skip to content

Commit 99e3f44

Browse files
committed
Decoder finished
1 parent 0a16ae7 commit 99e3f44

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<div id="botbtns" class="btnblock"></div>
1717
<div id="controls">
1818
<input type="text" id="buffer">
19-
<button class="ctrlbtn" id="clear">Clear</button>
20-
<button class="ctrlbtn" id="add">Add</button>
21-
<button class="ctrlbtn" id="reset">Reset</button>
19+
<button class="ctrlbtn" onclick="clearbuffer()">Clear</button>
20+
<button class="ctrlbtn" onclick="addchar()">Add</button>
21+
<button class="ctrlbtn" onclick="reset()">Reset</button>
2222
</div>
2323
</div>
2424
</body>

script.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ long.src = "assets/long.png";
2525
var topbar = document.getElementById("topbtns");
2626
var botbar = document.getElementById("botbtns");
2727

28-
var tophalf = document.getElementById("half-top");
29-
var bothalf = document.getElementById("half-bot");
30-
3128
var toppart = 0;
3229
var botpart = 0;
3330

@@ -50,6 +47,23 @@ function update()
5047
document.getElementById("dp-kix").innerText = grid[toppart][botpart];
5148
}
5249

50+
function reset()
51+
{
52+
toppart = botpart = 0;
53+
update();
54+
}
55+
56+
function clearbuffer()
57+
{
58+
document.getElementById("buffer").value = "";
59+
}
60+
61+
function addchar()
62+
{
63+
document.getElementById("buffer").value += grid[toppart][botpart];
64+
reset();
65+
}
66+
5367
(function() {
5468
for (var i = 0; i < blocks.length; i++)
5569
{

style.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ html, body {
55

66
#wrapper {
77
position: absolute;
8-
top: 10%;
8+
top: 50%;
99
left: 50%;
1010
margin-right: -50%;
11-
transform: translate(-50%, -10%);
11+
transform: translate(-50%, -50%);
1212
}
1313

1414
.stripe {

0 commit comments

Comments
 (0)