forked from hjh010501/neis-counter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
107 lines (99 loc) Β· 7.34 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
<html lang="ko">
<head>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="description" content="λμ΄μ€(NEIS) κΈμμ κ³μ°κΈ°">
<meta property="og:title" content="λμ΄μ€(NEIS) κΈμμ κ³μ°κΈ°">
<meta property="og:type" content="website">
<meta property="og:url" content="https://hjh010501.github.io/neis-counter">
<meta property="og:locale" content="ko_KR">
<meta property="og:description" content="λμ΄μ€(NEIS) κΈμμ κ³μ°κΈ°">
<meta property="og:image" content="ogimage.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<link rel="stylesheet" type="text/css" href="main.css">
<script async defer src="https://buttons.github.io/buttons.js"></script>
<title>λμ΄μ€(NEIS) κΈμμ κ³μ°κΈ°</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-145929593-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-145929593-1');
</script>
</head>
<body>
<div class="center">
<header>
<div class="title">πλμ΄μ€(NEIS) κΈμμ κ³μ°κΈ°</div>
<button id="spellcheck_button">λ§μΆ€λ² κ²μ¬νκΈ°</button>
</header>
<div class="title_underbar_wrapper">
<div class="title_underbar"></div>
</div>
<spell-check-input id="counter" class="counter"></spell-check-input>
<table>
<tr>
<th>νλͺ©</td>
<th>μμ¨νλ</th>
<th>λμ리νλ</th>
<th>μ§λ‘νλ</th>
<th>κ΅κ³ΌμΈνΉ</th>
<th>κ°μΈλ³μΈνΉ</th>
</tr>
<tr>
<td>λ°μ΄νΈ</td>
<td>1500Bytes</td>
<td>1500Bytes</td>
<td>2100Bytes</td>
<td>1500Bytes</td>
<td>1500Bytes</td>
</tr>
</table>
<div id="result" class="result">곡백 μ μΈ 0μ, 곡백 ν¬ν¨ 0μ, 0λ°μ΄νΈ</div>
<span class="info">μμ΄, μ«μ, νΉμλ¬Έμ, λμ΄μ°κΈ° 1λ°μ΄νΈ / μν°ν€ 2λ°μ΄νΈ / νκΈ 3λ°μ΄νΈ<br>ν΄λΉ μ¬μ΄νΈ μ μμκ° 20λ
λ μ‘Έμ
μμΈλ°,<br class="small-screen"> μνκΈ°λ‘λΆ μ
λ ₯ μ νμ΄ λ°λ κ²μΌλ‘ μκ³ μμ΄ μ§μ μ΅λλ€.<br>PR λ‘ λ΄μ©μ 보λ΄μ£Όμλ©΄ λ°μνκ² μ΅λλ€!<br>λ°μν΄μ£Όμ λΆλ€: <a href="https://github.com/Dongyeongkim" target="_blank">κΉλμ</a>, <a href="https://github.com/rycont" target="_blank">μ ν(RyCont)</a>, <a href="https://github.com/cokia" target="_blank">νμ°μ</a>, <a href="https://github.com/hajin-chung" target="_blank">μ νμ§</a>, <a href="https://github.com/bshyuunn" target="_blank">λ°°μ‘ν</a>, <a href="https://github.com/mcgun1234" target="_blank">μ΅μν</a>, <a href="https://github.com/b0u0b-0w0" target="_blank">κΉμμ§</a>, <a href="https://github.com/jjoonleo" target="_blank">λ°μ΄μ€</a>, <a href="https://github.com/chanheecho426" target="_blank">μ‘°μ°¬ν¬</a><br><br><a href="https://hjh010501.github.io/neis-counter/"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fhjh010501.github.io%2Fneis-counter%2F&count_bg=%23000000&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=%EB%B0%A9%EB%AC%B8%EC%9E%90+%EC%88%98&edge_flat=true"/></a></span>
</div>
<div class="footbar">
<div class="footbar_content">
<span>π¨βπ» by <a href="https://github.com/hjh010501">kidevelop</a></span>
<span><a class="github-button" href="https://github.com/hjh010501/neis-counter" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star hjh010501/neis-counter on GitHub">Star</a></span>
</div>
</div>
<script type="module" src="./spellchecker/index.js"></script>
<script>
const textarea = document.getElementById("counter");
const spellCheckButton = document.getElementById("spellcheck_button")
function init() {
let content = localStorage.getItem("save");
if(content) {
counter(content);
textarea.setContent(content);
}
textarea.addEventListener("content-change", function(e) {
counter(e.detail.content);
});
spellCheckButton.addEventListener("click", function() {
spellCheckButton.classList.add("pending")
textarea.spellCheck().finally(() => spellCheckButton.classList.remove("pending"));
});
}
function counter(content) {
localStorage.setItem("save", content);
var english = content.replace(/[γ±-γ
|γ
-γ
£|κ°-ν£]/gi, "").replace(/[0-9]/gi, "").replace(/[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi, "").replace(/\s/gi, "").replace(/\s/gi, "").replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/β|β|β|β/g, "");
var korean = content.replace(/[a-zA-Z]/gi, "").replace(/[0-9]/gi, "").replace(/[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi, "").replace(/\s/gi, "").replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/β|β|β|β/g, "");
var number = content.replace(/[a-zA-Z]/gi, "").replace(/[γ±-γ
|γ
-γ
£|κ°-ν£]/gi, "").replace(/[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi, "").replace(/\s/gi, "").replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/β|β|β|β/g, "");
var onebyte_special = content.replace(/[a-zA-Z]/gi, "").replace(/[γ±-γ
|γ
-γ
£|κ°-ν£]/gi, "").replace(/[0-9]/gi, "").replace(/\s/gi, "").replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/β|β|β|β/g, "");
var threebyte_special = content.replace(/[a-zA-Z]/gi, "").replace(/[γ±-γ
|γ
-γ
£|κ°-ν£]/gi, "").replace(/[0-9]/gi, "").replace(/[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi, "").replace(/\s/gi, "").replace(/(\r\n\t|\n|\r\t)/gm,"");
var space = content.replace(/[a-zA-Z]/gi, "").replace(/[γ±-γ
|γ
-γ
£|κ°-ν£]/gi, "").replace(/[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi, "").replace(/[0-9]/gi, "").replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/β|β|β|β/g, "");
var line = content.replace(/[a-zA-Z]/gi, "").replace(/[γ±-γ
|γ
-γ
£|κ°-ν£]/gi, "").replace(/[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi, "").replace(/[0-9]/gi, "").replace(/ /gi, "").replace(/β|β|β|β/g, "");
var result = english.length + (korean.length * 3) + number.length + onebyte_special.length + (threebyte_special.length * 3) + space.length + (line.length * 2);
document.getElementById('result').innerHTML = "곡백 μ μΈ " + content.replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/ /gi, "").length + "μ, 곡백 ν¬ν¨ " + content.length + "μ, " + result + "λ°μ΄νΈ";
}
window.onload = init;
</script>
</body>
</html>