-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
74 lines (60 loc) · 1.45 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
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<meta content="initial-scale=1, width=device-width" name="viewport" />
<title>ماشین حساب أبجد (آنلاین/آفلاین)</title>
<link href="res/favicon.ico" rel="shortcut icon" type="image/x-icon">
<script type="module">
import calculateAbjadCode, {intToFa} from './src/main.js'
const input = document.getElementById('input')
input.addEventListener('input', _ => {
const num = calculateAbjadCode(input.value)
document.getElementById('result').innerHTML = isNaN(num) ? '؟' : intToFa(num)
})
input.value = 'علی'
input.focus()
input.select()
input.dispatchEvent(new Event('input'))
</script>
<style>
@font-face {
font-family: Vazir;
src: local('Vazir'),
url('res/Vazir-Regular.woff2') format('woff2'),
url('res/Vazir-Regular.woff') format('woff');
font-weight: normal;
font-style: normal;
}
html {
font-family: Vazir, sans-serif;
}
input {
font-size: 1em;
font-family: Vazir, sans-serif;
}
::selection {
color: initial;
background-color: lightskyblue;
}
div {
margin: 16px;
}
a {
text-decoration: none;
}
</style>
</head>
<body>
<div>
<label for="input">واژه / عبارت:</label>
<input id="input" type="text" />
</div>
<div>
<a href="https://fa.wikipedia.org/wiki/حساب_جمل">
حساب جُمَّل (ابجد):
</a>
<label id="result"></label>
</div>
</body>
</html>