-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeypads.html
135 lines (124 loc) · 4.7 KB
/
keypads.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Symbol keypads - Keep talking</title>
<style>
span, button {
font-family: 'Times New Roman', Times, serif;
font-size: 20pt;
}
</style>
</head>
<body>
<h3>Symbol keypads</h3>
<button id="s1">ϙ</button> <!-- o-Strich -->
<button id="s2">Ѧ</button> <!-- A-Strich -->
<button id="s3">ƛ</button> <!-- Lambda-Strich -->
<button id="s4">Ϟ</button> <!-- Blitz -->
<button id="s5">Ѭ</button> <!-- Dreieck-Bogen -->
<button id="s6">ϗ</button> <!-- H-Haken -->
<button id="s7">Ͽ</button> <!-- C Punkt falschrum -->
<button id="s8">Ӭ</button> <!-- E Punkt falschrum -->
<button id="s9">Ҩ</button> <!-- C L -->
<button id="s10">☆</button> <!-- Stern leer -->
<button id="s11">¿</button> <!-- Fragezeichen falschrum -->
<button id="s12">©</button> <!-- Copyright -->
<button id="s13">Ѽ</button> <!-- W Dach -->
<button id="s14">Җ</button> <!-- X Strich -->
<button id="s15">Ԇ</button> <!-- C Haken -->
<button id="s16">б</button> <!-- roh -->
<button id="s17">¶</button> <!-- Word-Symbol -->
<button id="s18">Ѣ</button> <!-- B T -->
<button id="s19">ټ</button> <!-- Smiley -->
<button id="s20">ψ</button> <!-- Kronleuchter/Kerzen -->
<button id="s21">Ͼ</button> <!-- C Punkt richtigrum -->
<button id="s22">Ѯ</button> <!-- Epsilon Dach / Haken -->
<button id="s23">★</button> <!-- Stern ausgefüllt -->
<button id="s24">҂</button> <!-- Puzzleteil -->
<button id="s25">æ</button> <!-- ae -->
<button id="s26">Й</button> <!-- N Dach-->
<button id="s27">Ω</button> <!-- Omega -->
<br>
<button id="reset">Reset</button>
<br><br>
<span id="out"></span>
<script>
var columns = [
[1,2,3,4,5,6,7],
[8,1,7,9,10,6,11],
[12,13,9,14,15,3,10],
[16,17,18,5,14,11,19],
[20,19,18,21,17,22,23],
[16,8,24,25,20,26,27]
];
var out = document.getElementById("out");
var btnReset = document.getElementById("reset");
var btns = document.getElementsByTagName("button");
var pressed = [];
function init() {
btnReset.addEventListener("click", reset);
for (var i = 0; i < btns.length; i++) {
if (btns[i] != btnReset) {
btns[i].addEventListener("click", pressedSymbol);
btns[i].style.backgroundColor = "initial";
btns[i].setAttribute("sel", "0");
pressed = [];
}
}
}
function reset() {
for (var i = 0; i < btns.length; i++) {
if (btns[i] != btnReset) {
btns[i].style.backgroundColor = "initial";
btns[i].setAttribute("sel", "0");
pressed = [];
}
}
out.innerHTML = "";
}
function pressedSymbol(e) {
if (e.target.getAttribute("sel") == "1") {
e.target.style.backgroundColor = "initial";
e.target.setAttribute("sel", "0");
pressed.splice(pressed.indexOf(parseInt(e.target.id.substr(1))), 1);
} else {
e.target.style.backgroundColor = "darkgreen";
e.target.setAttribute("sel", "1");
pressed.push(parseInt(e.target.id.substr(1)));
}
var erg = "";
columns.forEach(col => {
var contained = true;
pressed.forEach(p => {
if (!contained || col.indexOf(p) < 0) {
contained = false;
}
});
if (contained) {
col.forEach(elem => {
if (pressed.indexOf(elem) >= 0) {
erg += btns["s"+elem].innerHTML + " ";
}
});
erg += "<br>";
}
});
out.innerHTML = erg;
}
function showAll() {
var erg = "";
columns.forEach(col => {
col.forEach(elem => {
erg += btns["s"+elem].innerHTML + " ";
});
erg += "<br>";
});
out.innerHTML = erg;
}
init();
</script>
</body>
</html>