-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
176 lines (156 loc) · 6.55 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<html>
<head>
<title>משפחה בתנועה</title>
<meta name="description" content="תצוגת אותיות האלף בית עם ניקוד" />
<meta property="og:title" content="משפחה בתנועה" />
<meta property="og:url" content="https://https://shmueld.github.io/Alef-Bet/" />
<meta property="og:description" content="משפחה בתנועה" />
<meta property="og:locale" content="he_IL" />
<link rel="apple-touch-icon" sizes="180x180" href="assest/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assest/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assest/favicon-16x16.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Noto+Sans+Hebrew:wght@700&display=swap&version=1" rel="stylesheet">
<style type="text/css">
body{
font-family: arial;
border: 0px solid black;
align-self: center;
justify-content: center;
display: flex;
flex-direction: column;
}
h1{
text-align:center;
margin: 5px 0px 5px 0px;
}
h2{
text-align:center;
margin: 5px 0px 5px 0px;
}
.mainContainer {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.arrowBox {
font-weight: bolder;
background-color: rgb(201, 201, 201);
font-size: 30px;
padding: 30px 0;
cursor: pointer;
}
.helpContainer{
text-align: center;
direction: rtl;
}
.charBox {
font-family: 'Inter';
width: 200px;
height: 250px;
font-size: 200px;
border: 1px solid black;
border-radius: 30px;
text-align: center;
align-content: center;
justify-content: center;
}
.niqqudBox{
font-family: 'Noto Sans Hebrew', sans-serif;
margin-top: 25px;
width: 200px;
height: 150px;
font-size: 100px;
border-radius: 30px;
border: 1px solid black;
text-align: center;
text-justify: top;
direction: rtl;
}
</style>
</head>
<body>
<img src="assest/kid1.png" style="position:absolute;top:25vh;left:60vw;height: 400px;"/>
<img src="assest/kid2.png" style="position:absolute;top:25vh;left:30vw;height: 400px;"/>
<h1>משפחה בתנועה</h1>
<h2>גלגל האותיות</h2>
<div class="mainContainer">
<div class="arrowBox" onclick="nextChar();">⇐</div><div class="charBox" id="charBoxDiv">א</div><div class="arrowBox" onclick="previousChar();">⇒</div>
</div>
<div class="mainContainer">
<div class="arrowBox" onclick="nextNiqqud();">⇐</div><div class="niqqudBox" id="niqqudBoxDiv"> ָ</div><div class="arrowBox" onclick="previousNiqqud();">⇒</div>
</div>
<br />
<div class="helpContainer">
<h2>גלגל האותיות</h2>
<h3>הוראות הפעלה</h3>
למעבר בין האותיות/נקודות יש ללחוץ על החיצים.<br /><br />
ניתן להפעיל גם באמצעות מקשי החצים במקלדת: <br />
המקשים: ימין ושמאל למעבר בין האותיות<br />
המקשים: למעלה ומטה למעבר בין הנקודות
</div>
</body>
<script type="text/javascript">
const alefBetArr = ["א","בּ","ב", "ג","ד","ה","ו","ז","ח","ט","י","כּ","כ","ל","מ","נ","ס","ע","פּ","פ","צ","ק","ר","שׁ","שׂ","תּ","ת"];
const niqqudArr = ["ָ","ַ","ֵ","ִ","ֶ","ְ","ֹ","ֻ","ֱ","ֲ","ֳ"] //"ּ",
let alefBetIndex = 0;
let niqqudIndex = 0;
document.getElementById("charBoxDiv").innerText = alefBetArr[alefBetIndex] + niqqudArr[niqqudIndex];
document.addEventListener("keyup", (e)=> {
switch(e.code){
case "KeyE":
case "ArrowLeft":
nextChar();
break;
case "KeyT":
case "ArrowRight":
previousChar();
break;
case "KeyZ":
case "ArrowUp":
nextNiqqud();
break;
case "KeyX":
case "ArrowDown":
previousNiqqud();
break;
}
})
function getRandomColor(){
return Math.floor(Math.random()*16777215).toString(16);
}
function doChange(alerBetIndex, niqqudIndex){
document.getElementById("niqqudBoxDiv").innerText = niqqudArr[niqqudIndex];
document.getElementById("charBoxDiv").innerText = alefBetArr[alefBetIndex] + niqqudArr[niqqudIndex]
var color = "#"+getRandomColor()
document.getElementById("charBoxDiv").style.color = color
document.getElementById("niqqudBoxDiv").style.color=color
}
function nextChar(){
alefBetIndex++;
if (alefBetIndex == alefBetArr.length)
alefBetIndex = 0;
doChange(alefBetIndex, niqqudIndex);
}
function previousChar() {
alefBetIndex--;
if (alefBetIndex == -1)
alefBetIndex = alefBetArr.length-1;
doChange(alefBetIndex, niqqudIndex);
}
function nextNiqqud() {
niqqudIndex++;
if (niqqudIndex == niqqudArr.length)
niqqudIndex = 0;
doChange(alefBetIndex, niqqudIndex);
}
function previousNiqqud(){
niqqudIndex--;
if (niqqudIndex == -1)
niqqudIndex = niqqudArr.length-1;
doChange(alefBetIndex, niqqudIndex);
}
</script>
</html>