-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
66 lines (66 loc) · 1.84 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
<!doctype html>
<html>
<head>
<meta charset="utf8">
<title>u9y</title>
<style>
html, body {
height: 100%;
}
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
input {
margin-bottom: .5rem;
padding: 0.5rem;
font-family: monospace;
font-size: 1.125rem;
text-align: center;
}
div[output] {
border-bottom: 1px solid black;
font-size: 2rem;
font-family: monospace;
}
div[output]:before {
content: "";
display: inline-block;
}
</style>
</head>
<body>
<input type="text" value="internationalization" autofocus>
<div output>i18n</div>
<script>
var input = document.querySelector('input')
var output = document.querySelector('div[output]')
input.addEventListener('input', function () {
output.innerText = internationalizationize(input.value)
})
function internationalizationize (input) {
if (input.length < 3) return input
var first = input[0]
var number = input.length - 2
var last = input[input.length - 1]
return first + number + last
}
</script>
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '57866a34c88d90026501370a');
t.setAttribute('data-track-path', 'https://track.gaug.es/track.gif');
t.src = 'https://d36ee2fcip1434.cloudfront.net/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>