-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathares.html
103 lines (99 loc) · 3.08 KB
/
ares.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ARES Phonetic Alphabet Converter</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
}
.container {
max-width: 600px;
margin: auto;
background: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
h1 {
text-align: center;
color: #333;
}
textarea, input, button {
font-size: 16px;
}
textarea {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ddd;
border-radius: 4px;
resize: vertical;
}
button {
display: block;
width: 100%;
padding: 10px;
background: #5cb85c;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background: #4cae4c;
}
#output {
margin-top: 20px;
padding: 10px;
background: #e9e9e9;
border-radius: 4px;
white-space: pre-wrap;
word-wrap: break-word;
}
</style>
</head>
<body>
<div class="container">
<h1>ARES Phonetic Alphabet Converter</h1>
<textarea id="input" rows="5" placeholder="Enter text to convert"></textarea>
<button onclick="convertText()">Convert</button>
<div id="output"></div>
</div>
<script>
const phoneticAlphabet = {
'A': 'Alpha', 'B': 'Bravo', 'C': 'Charlie', 'D': 'Delta', 'E': 'Echo',
'F': 'Foxtrot', 'G': 'Golf', 'H': 'Hotel', 'I': 'India', 'J': 'Juliett',
'K': 'Kilo', 'L': 'Lima', 'M': 'Mike', 'N': 'November', 'O': 'Oscar',
'P': 'Papa', 'Q': 'Quebec', 'R': 'Romeo', 'S': 'Sierra', 'T': 'Tango',
'U': 'Uniform', 'V': 'Victor', 'W': 'Whiskey', 'X': 'X-ray',
'Y': 'Yankee', 'Z': 'Zulu',
'0': 'Zero', '1': 'One', '2': 'Two', '3': 'Three', '4': 'Four',
'5': 'Five', '6': 'Six', '7': 'Seven', '8': 'Eight', '9': 'Nine'
};
function convertText() {
const input = document.getElementById('input').value.toUpperCase();
const output = document.getElementById('output');
let result = [];
for (let char of input) {
if (char in phoneticAlphabet) {
result.push(phoneticAlphabet[char]);
} else if (char === ' ') {
result.push('(SPACE)');
} else {
result.push(char);
}
}
output.textContent = result.join(' ');
}
</script>
</body>
</html>