forked from hjh010501/neis-counter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
106 lines (98 loc) ยท 6.71 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
<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 style="font-size: 12pt; color:#aaa; font-family: 'Noto Sans KR'; letter-spacing: -1.25px; float: right; text-align: right;">์์ด, ์ซ์, ํน์๋ฌธ์, ๋์ด์ฐ๊ธฐ 1๋ฐ์ดํธ / ์ํฐํค 2๋ฐ์ดํธ / ํ๊ธ 3๋ฐ์ดํธ<br>ํด๋น ์ฌ์ดํธ ์ ์์๊ฐ 20๋
๋ ์กธ์
์์ธ๋ฐ, ์ํ๊ธฐ๋ก๋ถ ์
๋ ฅ ์ ํ์ด ๋ฐ๋ ๊ฒ์ผ๋ก ์๊ณ ์์ด ์ง์ ์ต๋๋ค.<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/mcgun1234" 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 style="text-align: left;">๐จโ๐ป by <a href="https://github.com/hjh010501">kidevelop</a></span>
<span style="float: right;"><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,"");;
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,"");
var number = content.replace(/[a-zA-Z]/gi, "").replace(/[ใฑ-ใ
|ใ
-ใ
ฃ|๊ฐ-ํฃ]/gi, "").replace(/[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi, "").replace(/\s/gi, "").replace(/(\r\n\t|\n|\r\t)/gm,"");
var special = content.replace(/[a-zA-Z]/gi, "").replace(/[ใฑ-ใ
|ใ
-ใ
ฃ|๊ฐ-ํฃ]/gi, "").replace(/[0-9]/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,"");
var line = content.replace(/[a-zA-Z]/gi, "").replace(/[ใฑ-ใ
|ใ
-ใ
ฃ|๊ฐ-ํฃ]/gi, "").replace(/[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi, "").replace(/[0-9]/gi, "").replace(/ /gi, "");
var result = english.length + (korean.length * 3) + number.length + special.length + 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>