OpenLab-NLP commited on
Commit
78e2dfd
ยท
verified ยท
1 Parent(s): c60dc40

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +142 -100
index.html CHANGED
@@ -2,76 +2,105 @@
2
  <html lang="ko">
3
  <head>
4
  <meta charset="UTF-8">
5
- <title>HUIUCL Archive v4.0</title>
6
  <style>
7
  :root {
8
  --bg: #f8f9fa;
9
- --primary: #2c3e50;
10
- --accent: #e67e22;
11
- --border: #dcdde1;
12
- --card-bg: #ffffff;
13
  }
14
 
15
- body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: var(--bg); color: var(--primary); margin: 0; padding: 20px; }
16
- .container { max-width: 1200px; margin: 0 auto; }
17
 
18
- /* Search UI */
19
- .search-area { position: sticky; top: 0; background: var(--bg); padding: 10px 0 20px; z-index: 100; }
20
- .search-box { width: 100%; padding: 18px; border: 2px solid var(--border); border-radius: 12px; font-size: 1.1rem; outline: none; transition: border-color 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
21
- .search-box:focus { border-color: var(--accent); }
 
22
 
23
- /* Table UI */
24
- .table-wrapper { background: var(--card-bg); border-radius: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); overflow: hidden; border: 1px solid var(--border); }
25
- table { width: 100%; border-collapse: collapse; table-layout: fixed; }
26
- th { background: #f1f2f6; padding: 18px; text-align: left; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: #7f8c8d; border-bottom: 2px solid var(--border); }
27
- td { padding: 18px; border-bottom: 1px solid #f1f2f6; vertical-align: top; word-break: break-all; }
28
 
29
- /* Content Styling */
30
- .word-text { font-size: 1.2rem; font-weight: 800; color: var(--accent); display: block; margin-bottom: 5px; }
31
- .meaning-ko { font-size: 1.05rem; font-weight: 600; color: #2f3640; margin-bottom: 4px; }
32
- .meaning-en { font-size: 0.95rem; color: #7f8c8d; font-style: italic; }
33
 
34
- .usage-card { background: #fffcf0; border: 1px solid #f1e4b3; border-radius: 8px; padding: 10px; margin-top: 10px; font-size: 0.85rem; color: #5d5d5d; line-height: 1.5; }
35
- .usage-label { font-weight: 800; color: #b88e2f; margin-right: 5px; font-size: 0.75rem; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
- .path-tag { display: inline-block; padding: 4px 10px; background: #ebedef; border-radius: 20px; font-size: 0.75rem; color: #34495e; font-weight: bold; }
38
- .derivation-item { font-size: 0.9rem; padding: 5px 0; color: #636e72; border-top: 1px dashed #eee; margin-top: 5px; }
39
 
40
- tr:hover { background-color: #fdfdfd; }
41
- .sub-row { background-color: #fafbfc; }
42
  </style>
43
  </head>
44
  <body>
45
 
46
- <div class="container">
47
- <div class="search-area">
48
- <input type="text" id="searchInput" class="search-box" placeholder="Search by word, meaning, or category..." oninput="render()">
49
- </div>
50
-
51
- <div class="table-wrapper">
52
- <table>
53
- <thead>
54
- <tr>
55
- <th style="width: 25%;">Word / Morpheme</th>
56
- <th style="width: 55%;">Meaning & Description</th>
57
- <th style="width: 20%;">Category</th>
58
- </tr>
59
- </thead>
60
- <tbody id="dictBody"></tbody>
61
- </table>
62
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  </div>
64
 
65
  <script>
66
  let rawData = {};
67
 
 
 
 
 
 
68
  window.onload = () => {
69
- fetch('Huiucl.json')
70
- .then(res => res.json())
71
- .then(data => {
72
- rawData = data;
73
- render();
74
- });
75
  };
76
 
77
  function render() {
@@ -79,85 +108,98 @@
79
  const body = document.getElementById('dictBody');
80
  body.innerHTML = '';
81
 
82
- for (const section in rawData) {
83
- if (section === "Settings") continue;
84
- processNode(rawData[section], section, query);
85
  }
86
  }
87
 
88
- function processNode(node, path, query) {
89
  if (path.includes("Grammar_Rules")) return;
90
 
91
- for (const key in node) {
92
- const item = node[key];
93
- if (!item) continue;
94
 
95
- // 1. ํ•ต์‹ฌ: ์ด ๋…ธ๋“œ๊ฐ€ "๋‹จ์–ด ๋ฐ์ดํ„ฐ"๋ฅผ ๋‹ด๊ณ  ์žˆ๋Š”๊ฐ€?
96
- const isWordData = (typeof item === 'object' && (item.meaning_ko || item.ko || item.definition || item.morpheme));
97
-
98
- if (isWordData) {
99
- // sa- ๊ฐ™์€ Morpheme ์˜ˆ์™ธ ์ฒ˜๋ฆฌ: item.morpheme์ด ์žˆ์œผ๋ฉด ๊ทธ๊ฑธ ๋‹จ์–ด๋กœ ์‚ฌ์šฉ
100
- const displayWord = item.morpheme || key;
101
- const info = {
102
- ko: item.meaning_ko || item.ko || item.๋œป || item.definition || "",
103
- en: item.meaning_en || item.en || "",
104
- usage: item.usage || item.note || ""
105
- };
106
-
107
- // ๊ฒ€์ƒ‰ ํ•„ํ„ฐ
108
- if (displayWord.toLowerCase().includes(query) || info.ko.includes(query) || info.en.toLowerCase().includes(query) || path.toLowerCase().includes(query)) {
109
- appendRow(displayWord, info, path);
110
- }
111
 
 
 
 
 
 
112
  // ํŒŒ์ƒ์–ด ์ฒ˜๋ฆฌ
113
- if (item.derivations) {
114
- for (const dKey in item.derivations) {
115
- appendRow(dKey, { ko: item.derivations[dKey], en: "", usage: "" }, path, true);
116
  }
117
  }
118
 
119
- // ์กฐ๋™์‚ฌ ์‹œ์ œ ๋ณ€ํ˜•(tense_variants) ๊ฐ™์€ ํ•˜์œ„ ๊ฐ์ฒด ํƒ์ƒ‰
120
- if (item.tense_variants) {
121
- processNode(item.tense_variants, path + " > " + displayWord, query);
122
  }
123
  }
124
- // 2. ๋‹จ์ˆœ ๋ฌธ์ž์—ด์ธ ๊ฒฝ์šฐ (๋Œ€๋ช…์‚ฌ ๋“ฑ)
125
- else if (typeof item === 'string') {
126
- if (key.toLowerCase().includes(query) || item.toLowerCase().includes(query)) {
127
- appendRow(key, { ko: item, en: "", usage: "" }, path);
128
- }
129
  }
130
- // 3. ๋ฐ์ดํ„ฐ๊ฐ€ ์•„๋‹Œ ๋‹จ์ˆœ ์นดํ…Œ๊ณ ๋ฆฌ ์ธต์ธ ๊ฒฝ์šฐ (์žฌ๊ท€)
131
- else if (typeof item === 'object') {
132
- // 'morpheme'์ด ํ‚ค์ธ ๊ฒฝ์šฐ๋ฅผ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ํ•„ํ„ฐ๋ง
133
- if (!["derivations", "tense_variants"].includes(key)) {
134
- processNode(item, path + " > " + key, query);
135
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  }
 
 
 
 
 
 
 
137
  }
 
138
  }
139
 
140
- function appendRow(word, info, path, isSub) {
 
 
 
 
141
  const body = document.getElementById('dictBody');
142
  const row = body.insertRow();
143
  if (isSub) row.className = 'sub-row';
144
 
145
- // ์˜๋ฏธ๋ถ€ ๊ตฌ์„ฑ
146
- let meaningHtml = `<div class="meaning-ko">${info.ko}</div>`;
147
- if (info.en) meaningHtml += `<div class="meaning-en">${info.en}</div>`;
148
- if (info.usage) {
149
- meaningHtml += `<div class="usage-card"><span class="usage-label">USAGE</span>${info.usage}</div>`;
150
  }
151
 
152
  row.innerHTML = `
153
- <td>
154
- <span class="word-text">${isSub ? 'โ†ณ ' : ''}${word}</span>
155
- </td>
156
- <td>${meaningHtml}</td>
157
- <td><span class="path-tag">${path}</span></td>
158
  `;
159
  }
160
  </script>
161
-
162
  </body>
163
  </html>
 
2
  <html lang="ko">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <title>HUIUCL Database v4.0</title>
6
  <style>
7
  :root {
8
  --bg: #f8f9fa;
9
+ --header-bg: #2d2d2d;
10
+ --accent: #d4a373;
11
+ --text: #333;
12
+ --border: #e9ecef;
13
  }
14
 
15
+ body { font-family: 'Pretendard', -apple-system, sans-serif; background: var(--bg); color: var(--text); margin: 0; }
 
16
 
17
+ /* UI ๋ณต๊ตฌ ๋ฐ ๊ฐœ์„  */
18
+ nav { background: var(--header-bg); padding: 1rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
19
+ nav .nav-container { max-width: 1200px; margin: 0 auto; display: flex; gap: 20px; }
20
+ nav a { color: #fff; text-decoration: none; font-weight: 500; cursor: pointer; opacity: 0.8; transition: 0.3s; }
21
+ nav a:hover { opacity: 1; color: var(--accent); }
22
 
23
+ header { background: #fff; padding: 40px 20px; text-align: center; border-bottom: 1px solid var(--border); }
24
+ h1 { margin: 0; letter-spacing: 10px; font-weight: 300; color: #1a1a1a; }
25
+ .version { font-size: 0.8rem; color: #aaa; margin-top: 10px; }
 
 
26
 
27
+ .container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
 
 
 
28
 
29
+ .search-wrapper { margin-bottom: 30px; position: relative; }
30
+ .search-box { width: 100%; padding: 18px 25px; border: 1px solid #ddd; border-radius: 50px; font-size: 1.1rem; box-sizing: border-box; outline: none; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: 0.3s; }
31
+ .search-box:focus { border-color: var(--accent); box-shadow: 0 4px 20px rgba(212, 163, 115, 0.2); }
32
+
33
+ .table-card { background: #fff; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
34
+ table { width: 100%; border-collapse: collapse; table-layout: fixed; }
35
+ th { background: #fdfcfb; padding: 18px; text-align: left; font-size: 0.85rem; color: #888; text-transform: uppercase; border-bottom: 2px solid var(--border); }
36
+ td { padding: 20px; border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-all; }
37
+
38
+ .word-cell { width: 20%; font-size: 1.15rem; font-weight: 700; color: #1a1a1a; }
39
+ .meaning-cell { width: 60%; }
40
+ .cat-cell { width: 20%; text-align: right; font-size: 0.75rem; color: #bbb; }
41
+
42
+ .ko-text { font-size: 1.05rem; font-weight: 600; color: var(--accent); margin-bottom: 5px; }
43
+ .en-text { font-size: 0.95rem; color: #666; }
44
+ .usage-box { margin-top: 12px; padding: 10px; background: #f9f9f9; border-radius: 6px; border-left: 3px solid #ddd; font-size: 0.85rem; color: #777; }
45
 
46
+ .sub-row { background: #fcfcfc; }
47
+ .sub-mark { color: var(--accent); margin-right: 5px; }
48
 
49
+ section { display: none; }
50
+ section.active { display: block; }
51
  </style>
52
  </head>
53
  <body>
54
 
55
+ <nav>
56
+ <div class="nav-container">
57
+ <a onclick="showTab('dictionary')">DICTIONARY</a>
58
+ <a onclick="showTab('grammar')">GRAMMAR</a>
 
 
 
 
 
 
 
 
 
 
 
 
59
  </div>
60
+ </nav>
61
+
62
+ <header>
63
+ <h1>HUIUCL</h1>
64
+ <div class="version">CORE ARCHIVE v4.0 (STRICT MAPPING)</div>
65
+ </header>
66
+
67
+ <div class="container">
68
+ <section id="dictionary" class="active">
69
+ <div class="search-wrapper">
70
+ <input type="text" id="searchInput" class="search-box" placeholder="๋‹จ์–ด, ๋œป, ํŒŒ์ƒ์–ด, ๋ถ„๋ฅ˜๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”..." oninput="render()">
71
+ </div>
72
+ <div class="table-card">
73
+ <table>
74
+ <thead>
75
+ <tr>
76
+ <th>Word</th>
77
+ <th>Meaning & Usage</th>
78
+ <th style="text-align:right">Category</th>
79
+ </tr>
80
+ </thead>
81
+ <tbody id="dictBody"></tbody>
82
+ </table>
83
+ </div>
84
+ </section>
85
+
86
+ <section id="grammar">
87
+ <div id="grammarContent"></div>
88
+ </section>
89
  </div>
90
 
91
  <script>
92
  let rawData = {};
93
 
94
+ function showTab(id) {
95
+ document.querySelectorAll('section').forEach(s => s.classList.remove('active'));
96
+ document.getElementById(id).classList.add('active');
97
+ }
98
+
99
  window.onload = () => {
100
+ fetch('Huiucl.json').then(res => res.json()).then(data => {
101
+ rawData = data;
102
+ render();
103
+ });
 
 
104
  };
105
 
106
  function render() {
 
108
  const body = document.getElementById('dictBody');
109
  body.innerHTML = '';
110
 
111
+ for (const cat in rawData) {
112
+ if (cat === "Settings") continue;
113
+ deepSearch(rawData[cat], cat, query);
114
  }
115
  }
116
 
117
+ function deepSearch(obj, path, query) {
118
  if (path.includes("Grammar_Rules")) return;
119
 
120
+ for (const key in obj) {
121
+ const val = obj[key];
122
+ if (!val) continue;
123
 
124
+ // 1. ๋‹จ์–ด ๋ฐ์ดํ„ฐ ํŒ๋ณ„ ๋กœ์ง (morpheme sa- ๊ฐ™์€ ์ผ€์ด์Šค ๋Œ€์‘)
125
+ const info = extractInfo(key, val);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
+ if (info.isWord) {
128
+ if (match(info.word, info.ko, info.en, path, query)) {
129
+ append(info.word, info.ko, info.en, info.usage, path);
130
+ }
131
+
132
  // ํŒŒ์ƒ์–ด ์ฒ˜๋ฆฌ
133
+ if (val.derivations) {
134
+ for (const dk in val.derivations) {
135
+ append(dk, val.derivations[dk], "", "", path, true);
136
  }
137
  }
138
 
139
+ // ์‹œ์ œ ๋ณ€ํ˜•(tense_variants) ๋“ฑ ๋‚ด๋ถ€ ์žฌ๊ท€
140
+ if (typeof val === 'object' && val.tense_variants) {
141
+ deepSearch(val.tense_variants, path + " > " + key, query);
142
  }
143
  }
144
+ // 2. ํ•˜์œ„ ์นดํ…Œ๊ณ ๋ฆฌ์ธ ๊ฒฝ์šฐ ๊ณ„์† ํƒ์ƒ‰
145
+ else if (typeof val === 'object') {
146
+ deepSearch(val, path + " > " + key, query);
 
 
147
  }
148
+ }
149
+ }
150
+
151
+ function extractInfo(key, val) {
152
+ let res = { isWord: false, word: key, ko: "", en: "", usage: "" };
153
+
154
+ // ์ผ€์ด์Šค A: ๋‹จ์ˆœ ๋ฌธ์ž์—ด (Pronouns ๋“ฑ)
155
+ if (typeof val === 'string') {
156
+ res.isWord = true;
157
+ res.ko = val;
158
+ }
159
+ // ์ผ€์ด์Šค B: ๊ฐ์ฒดํ˜• (Auxiliary_Verbs, Affixes ๋“ฑ)
160
+ else if (typeof val === 'object') {
161
+ // morpheme: "sa-" ๊ฐ™์€ ์—ญ๊ตฌ์กฐ ๋Œ€์‘
162
+ if (val.morpheme) {
163
+ res.word = val.morpheme;
164
+ res.ko = val.meaning_ko || val.ko || val.definition || "";
165
+ res.en = val.meaning_en || val.en || "";
166
+ } else {
167
+ res.ko = val.meaning_ko || val.ko || val.๋œป || val.definition || "";
168
+ res.en = val.meaning_en || val.en || "";
169
  }
170
+ res.usage = val.usage || val.note || "";
171
+
172
+ // ko๋‚˜ en์ด ์˜ค๋ธŒ์ ํŠธ๋กœ ๋‚˜์˜ค๋Š” ๊ฒƒ ๋ฐฉ์ง€
173
+ if (typeof res.ko === 'object') res.ko = res.ko.ko || res.ko.meaning_ko || "";
174
+ if (typeof res.en === 'object') res.en = res.en.en || res.en.meaning_en || "";
175
+
176
+ if (res.ko || res.en) res.isWord = true;
177
  }
178
+ return res;
179
  }
180
 
181
+ function match(w, k, e, p, q) {
182
+ return (w+k+e+p).toLowerCase().includes(q);
183
+ }
184
+
185
+ function append(w, ko, en, use, path, isSub) {
186
  const body = document.getElementById('dictBody');
187
  const row = body.insertRow();
188
  if (isSub) row.className = 'sub-row';
189
 
190
+ let meaning = `<div class="ko-text">${ko}</div>`;
191
+ if (en) meaning += `<div class="en-text">${en}</div>`;
192
+ if (use) {
193
+ const useStr = typeof use === 'object' ? (use.ko || use.en || JSON.stringify(use)) : use;
194
+ meaning += `<div class="usage-box"><strong>USAGE:</strong> ${useStr}</div>`;
195
  }
196
 
197
  row.innerHTML = `
198
+ <td class="word-cell">${isSub ? '<span class="sub-mark">โ†ณ</span>' : ''}${w}</td>
199
+ <td class="meaning-cell">${meaning}</td>
200
+ <td class="cat-cell">${path}</td>
 
 
201
  `;
202
  }
203
  </script>
 
204
  </body>
205
  </html>