abdelhaqueidali commited on
Commit
2f3e6ba
·
verified ·
1 Parent(s): b1230ea

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +49 -192
index.html CHANGED
@@ -1,208 +1,65 @@
1
  <!DOCTYPE html>
2
- <html lang="ber">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>ⴰⵎⵙⵏⴼⵍ ⵏ ⵡⵓⵟⵟⵓⵏⵏ ⵖⵔ ⵜⵎⴰⵣⵉⵖⵜ</title>
7
  <style>
8
- body {
9
- font-family: Arial, sans-serif;
10
- line-height: 1.6;
11
  margin: 0;
12
- padding: 20px;
13
- background-color: #f4f4f4;
 
14
  }
15
- h1 {
16
- color: #333;
17
- text-align: center;
18
- }
19
- .container {
20
- max-width: 600px;
21
- margin: 0 auto;
22
- background-color: white;
23
- padding: 20px;
24
- border-radius: 5px;
25
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
26
- }
27
- input, button {
28
- width: 100%;
29
- padding: 10px;
30
- margin-bottom: 10px;
31
- }
32
- button {
33
- background-color: #4CAF50;
34
- color: white;
35
- border: none;
36
- cursor: pointer;
37
- }
38
- button:hover {
39
- background-color: #45a049;
40
- }
41
- #result {
42
- margin-top: 20px;
43
- font-weight: bold;
44
- }
45
- </style>
46
- </head>
47
- <body>
48
- <div class="container">
49
- <h1>ⵓⵟⵟⵓⵏⵏ ⵖⵔ ⵜⵉⵔⵔⴰ</h1>
50
- <input type="number" id="numberInput" placeholder="ⴰⵔⴰ ⴳⵔ ⵓⵎⵢⴰ ⴰⵔ ⴰⵜⵔⵉⵍⵢⴰⵕ">
51
- <button onclick="convertNumber()">ⵙⵏⴼⵍ</button>
52
- <div id="result"></div>
53
- <p/>
54
- <button onclick="copyResult()">ⵙⵙⵏⵖⵍ</button>
55
- </div>
56
- <script>
57
- function convertNumber() {
58
- const number = document.getElementById('numberInput').value;
59
- const result = document.getElementById('result');
60
-
61
- if (number === '') {
62
- result.textContent = 'ⵓⵔ ⵜⴰⵔⵉⵎ/ⵜ ⵡⴰⵍⵓ, ⴰⵔⴰⵎ/ⵜ ⴽⵔⴰ ⵏ ⵡⵓⵟⵟⵓⵏ.';
63
- return;
64
- }
65
 
66
- const num = parseInt(number);
67
- // This if statement limits the input number so to avoid mistakes this code makes above this number.
68
- if (isNaN(num) || num < 0 || num > 999999999999999) {
69
- result.textContent = 'ⵖⴰⵙ ⴳⵔ ⵥⵉⵕⵓ ⴰⵔ ⴰⵜⵔⵉⵍⵢⵓⵏ';
70
- return;
71
- }
72
-
73
- result.textContent = numberToTamazight(num);
74
  }
 
 
 
 
 
 
 
 
75
 
76
- function numberToTamazight(num) {
77
- const units = ['', 'ⵢⴰⵏ', 'ⵙⵉⵏ', 'ⴽⵕⴰⴹ', 'ⴽⴽⵓⵥ', 'ⵙⵎⵎⵓⵙ', 'ⵚⴹⵉⵚ', 'ⵙⴰ', 'ⵜⴰⵎ', 'ⵜⵥⴰ'];
78
- const tens = ['', 'ⵎⵔⴰⵡ', 'ⵙⵉⵎⵔⴰⵡ', 'ⴽⵕⴰⵎⵔⴰⵡ', 'ⴽⴽⵓⵥⵎⵔⴰⵡ', 'ⵙⵎⵎⵓⵎⵔⴰⵡ', 'ⵚⴹⵉⵎⵔⴰⵡ', 'ⵙⴰⵎⵔⴰⵡ', 'ⵜⴰⵎⵔⴰⵡ', 'ⵜⵥⴰⵎⵔⴰⵡ'];
79
-
80
- if (num === 0) return 'ⴰⵎⵢⴰ';
81
- if (num === 100) return 'ⵜⵉⵎⵉⴹⵉ';
82
- if (num === 1000) return 'ⵉⴼⴹ';
83
- if (num === 1000000) return 'ⴰⴳⵏⴷⵉⴷ';
84
- if (num === 1000000000) return 'ⴰⵎⵍⵢⴰⵕ';
85
- if (num === 1000000000000) return 'ⴰⵜⵔⵉⵍⵢⵓⵏ'; // This page is capable of calculating correctly up to this number, above it starts to make mistakes most of the time.
86
- if (num === 1000000000000000) return 'ⴰⵜⵔⵉⵍⵢⴰⵕ';
87
- if (num === 1000000000000000000) return 'ⴰⴽⵯⴰⵏⵜⵉⵍⵢⵓⵏ';
88
- if (num === 1000000000000000000000) return 'ⴰⴽⵯⴰⵏⵜⵉⵍⵢⴰⵕ';
89
- let result = '';
90
- if (num > 1999999999999999999) {
91
- result += numberToTamazight(Math.floor(num / 1000000000000000000)) + ' ';
92
- result += 'ⵉⴽⵯⴰⵏⵜⵉⵍⵢⵓⵏⵏ';
93
- if (num % 1000000000000000000 !== 0) result += ' ⴷ ';
94
- num %= 1000000000000000000;
95
- } else if (num >= 1000000000000000000) {
96
- result += numberToTamazight(Math.floor(num / 1000000000000000000)) + ' ';
97
- result = 'ⴰⴽⵯⴰⵏⵜⵉⵍⵢⵓⵏ';
98
- if (num % 1000000000000000000 !== 0) result += ' ⴷ ';
99
- num %= 1000000000000000000;
100
- }
101
-
102
- if (num > 1999999999999999) {
103
- result += numberToTamazight(Math.floor(num / 1000000000000000)) + ' ';
104
- result += 'ⵉⵜⵔⵉⵍⵢⴰⵕⵏ';
105
- if (num % 1000000000000000 !== 0) result += ' ⴷ ';
106
- num %= 1000000000000000;
107
- } else if (num >= 1000000000000000) {
108
- result += numberToTamazight(Math.floor(num / 1000000000000000)) + ' ';
109
- result = 'ⴰⵜⵔⵉⵍⵢⴰⵕ';
110
- if (num % 1000000000000000 !== 0) result += ' ⴷ ';
111
- num %= 1000000000000000;
112
- }
113
-
114
- // The following if statement is the max allowed to be used because of mistakes that are made up to this point.
115
- // The limitation is set in line 67 or so if its place changed a bit later than when this comment was made
116
- if (num > 1999999999999) {
117
- result += numberToTamazight(Math.floor(num / 1000000000000)) + ' ';
118
- result += 'ⵉⵜⵔⵉⵍⵢⵓⵏⵏ';
119
- if (num % 1000000000000 !== 0) result += ' ⴷ ';
120
- num %= 1000000000000;
121
- } else if (num >= 1000000000000) {
122
- result += numberToTamazight(Math.floor(num / 1000000000000)) + ' ';
123
- result = 'ⴰⵜⵔⵉⵍⵢⵓⵏ';
124
- if (num % 1000000000000 !== 0) result += ' ⴷ ';
125
- num %= 1000000000000;
126
- }
127
-
128
-
129
- if (num > 1999999999) {
130
- result += numberToTamazight(Math.floor(num / 1000000000)) + ' ';
131
- result += 'ⵉⵎⵍⵢⴰⵕⵏ';
132
- if (num % 1000000000 !== 0) result += ' ⴷ ';
133
- num %= 1000000000;
134
- } else if (num >= 1000000000) {
135
- result += numberToTamazight(Math.floor(num / 1000000000)) + ' ';
136
- result = 'ⴰⵎⵍⵢⴰⵕ';
137
- if (num % 1000000000 !== 0) result += ' ⴷ ';
138
- num %= 1000000000;
139
- }
140
-
141
-
142
- if (num > 1999999) {
143
- result += numberToTamazight(Math.floor(num / 1000000)) + ' ';
144
- result += 'ⵉⴳⵏⴷⴰⴷ';
145
- if (num % 1000000 !== 0) result += ' ⴷ ';
146
- num %= 1000000;
147
- } else if (num >= 1000000) {
148
- result += numberToTamazight(Math.floor(num / 1000000)) + ' ';
149
- result = 'ⴰⴳⵏⴷⵉⴷ';
150
- if (num % 1000000 !== 0) result += ' ⴷ ';
151
- num %= 1000000;
152
- }
153
-
154
- if (num > 1999) {
155
- result += numberToTamazight(Math.floor(num / 1000)) + ' ';
156
- result += 'ⵉⴼⴹⵏ';
157
- if (num % 1000 !== 0) result += ' ⴷ ';
158
- num %= 1000;
159
- } else if (num >= 1000) {
160
- result += ' ';
161
- result += 'ⵉⴼⴹ';
162
- if (num % 1000 !== 0) result += ' ⴷ ';
163
- num %= 1000;
164
- }
165
-
166
- if (num >= 100) {
167
- if (num <= 199) {
168
- result += 'ⵜⵉⵎⵉⴹⵉ';
169
- } else if (num <= 299) {
170
- result += 'ⵙⵏⴰⵜ ⵜⵎⴰⴹ';
171
- } else {
172
- result += units[Math.floor(num / 100)] + 'ⵜ ';
173
- result += 'ⵜⵎⴰⴹ';
174
- }
175
- if (num % 100 !== 0) result += ' ⴷ ';
176
- num %= 100;
177
- }
178
 
179
- if (num >= 20) {
180
- result += tens[Math.floor(num / 10)];
181
- if (num % 10 !== 0) result += ' ⴷ ';
182
- num %= 10;
183
- } else if (num >= 10) {
184
- result += 'ⵎⵔⴰⵡ';
185
- if (num % 10 !== 0) result += ' ⴷ ';
186
- num %= 10;
187
- }
188
 
189
- if (num > 0) {
190
- result += units[num];
191
- }
 
 
 
192
 
193
- return result.trim();
194
- }
195
-
196
- function copyResult() {
197
- const result = document.getElementById('result').textContent;
198
- if (result) {
199
- navigator.clipboard.writeText(result)
200
- .then(() => alert('ⵜⴻⵜⵜⵓⵙⵙⵏⵖⵍ!'))
201
- .catch(err => alert('ⵓⵔ ⵉⵜⵜⵓⵙⵙⵏⵖⴰⵍ ⵢⴰⵜ! '));
202
- } else {
203
- alert('ⵓⵔ ⵉⵍⵍⵉ ⵎⴰⴷ ⵉⵜⵜⵓⵙⵙⵏⵖⴰⵍⵏ.');
204
- }
205
  }
206
- </script>
 
 
 
 
 
 
207
  </body>
208
  </html>
 
1
  <!DOCTYPE html>
2
+ <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
6
  <style>
7
+ /* Reset default margin and padding */
8
+ body, html {
 
9
  margin: 0;
10
+ padding: 0;
11
+ height: 100%; /* Make sure body and html take up the full height */
12
+ overflow: hidden; /* Prevent scrollbars on the outer page */
13
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ /* Style the iframe to take up the entire viewport */
16
+ iframe {
17
+ width: 100%;
18
+ height: 100%;
19
+ border: none; /* Remove default iframe border */
 
 
 
20
  }
21
+
22
+ /* Reset default margin and padding */
23
+ body, html {
24
+ margin: 0;
25
+ padding: 0;
26
+ height: 100%; /* Make sure body and html take up the full height */
27
+ overflow: hidden; /* Prevent scrollbars on the outer page */
28
+ }
29
 
30
+ /* Style the iframe to take up the entire viewport */
31
+ iframe {
32
+ width: 100%;
33
+ height: 100%;
34
+ border: none; /* Remove default iframe border */
35
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
+ /* Style for the div containing the links */
38
+ div {
39
+ text-align: center; /* Center the links horizontally */
40
+ background-color: #f0f0f0; /* Light gray background (optional) */
41
+ padding: 10px; /* Add some padding around the links */
42
+ position: relative; /* Important for z-index to work */
43
+ z-index: 2; /* Ensure the div is above the iframe */
44
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow (optional) */
45
+ }
46
 
47
+ /* Style for the links themselves (optional) */
48
+ div a {
49
+ margin: 0 10px; /* Add some horizontal spacing between links */
50
+ color: #007bff; /* Blue link color (adjust as desired) */
51
+ text-decoration: none; /* Remove underline (optional) */
52
+ }
53
 
54
+ div a:hover {
55
+ text-decoration: underline; /* Add underline on hover (optional) */
 
 
 
 
 
 
 
 
 
 
56
  }
57
+ </style>
58
+ </head>
59
+ <body>
60
+ <div style="text-align: center;">
61
+ <a href="https://abdelhaqueidali.github.io/Numbers-To-Amazigh-Words/">Original webpage</a> <a href="https://github.com/abdelhaqueidali/Numbers-To-Amazigh-Words">Original Repository</a>
62
+ </div>
63
+ <iframe src="https://abdelhaqueidali.github.io/Numbers-To-Amazigh-Words/"></iframe>
64
  </body>
65
  </html>