OpenLab-NLP commited on
Commit
390d0b6
·
verified ·
1 Parent(s): 78e2dfd

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +126 -96
index.html CHANGED
@@ -2,80 +2,86 @@
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>
@@ -84,23 +90,30 @@
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,98 +121,115 @@
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>
 
2
  <html lang="ko">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <title>HUIUCL CORE ARCHIVE v5.0</title>
6
  <style>
7
  :root {
8
+ --bg: #f5f3f0;
9
+ --card: #ffffff;
10
+ --accent: #a68b6a;
11
+ --primary: #2c2c2c;
12
+ --secondary: #767676;
13
+ --border: #e0ddd5;
14
  }
15
 
16
+ body { font-family: 'Pretendard', -apple-system, sans-serif; background: var(--bg); color: var(--primary); margin: 0; line-height: 1.6; }
17
 
18
+ /* Navigation */
19
+ nav { background: var(--primary); padding: 1rem 0; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 15px rgba(0,0,0,0.1); }
20
+ .nav-container { max-width: 1100px; margin: 0 auto; display: flex; justify-content: center; gap: 40px; }
21
+ nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 0.9rem; letter-spacing: 2px; cursor: pointer; opacity: 0.7; transition: 0.3s; }
22
+ nav a:hover, nav a.active { opacity: 1; color: var(--accent); }
23
+
24
+ /* Header */
25
+ header { background: #fff; padding: 60px 20px; text-align: center; border-bottom: 1px solid var(--border); }
26
+ h1 { margin: 0; letter-spacing: 12px; font-weight: 200; color: var(--primary); font-size: 2.5rem; }
27
+ .sub-header { color: var(--secondary); font-size: 0.8rem; margin-top: 15px; letter-spacing: 3px; text-transform: uppercase; }
28
+
29
+ .container { max-width: 1100px; margin: 40px auto; padding: 0 20px; }
30
 
31
+ /* Dictionary Styling */
32
+ .search-box { width: 100%; padding: 20px 30px; border: 1px solid var(--border); border-radius: 40px; font-size: 1.1rem; box-sizing: border-box; outline: none; background: #fff; box-shadow: 0 5px 20px rgba(0,0,0,0.03); transition: 0.3s; margin-bottom: 30px; }
33
+ .search-box:focus { border-color: var(--accent); box-shadow: 0 5px 25px rgba(166, 139, 106, 0.15); }
34
 
35
+ .table-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.04); border: 1px solid var(--border); }
36
  table { width: 100%; border-collapse: collapse; table-layout: fixed; }
37
+ th { background: #faf9f7; padding: 20px; text-align: left; font-size: 0.75rem; color: #999; letter-spacing: 1px; border-bottom: 2px solid var(--border); }
38
  td { padding: 20px; border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-all; }
39
 
40
+ .word-cell { width: 25%; font-size: 1.2rem; font-weight: 700; color: var(--primary); }
41
+ .meaning-cell { width: 55%; }
42
+ .path-cell { width: 20%; text-align: right; font-size: 0.7rem; color: #bbb; text-transform: uppercase; }
43
 
44
+ .ko-text { font-size: 1.1rem; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
45
+ .en-text { font-size: 0.95rem; color: var(--secondary); }
46
+ .usage-box { margin-top: 12px; padding: 12px; background: #fdfcfb; border: 1px solid #f0eee9; border-left: 4px solid var(--accent); font-size: 0.85rem; color: #555; }
47
 
48
+ /* Grammar Section Styling */
49
+ .grammar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); gap: 20px; }
50
+ .grammar-card { background: #fff; padding: 30px; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 5px 15px rgba(0,0,0,0.02); }
51
+ .grammar-card h2 { margin-top: 0; font-size: 1.3rem; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 15px; margin-bottom: 20px; font-weight: 400; }
52
+ .rule-item { margin-bottom: 15px; }
53
+ .rule-name { font-weight: 700; color: var(--primary); display: block; margin-bottom: 3px; font-size: 0.95rem; }
54
+ .rule-desc { font-size: 0.9rem; color: var(--secondary); display: block; }
55
 
56
  section { display: none; }
57
+ section.active { display: block; animation: fadeIn 0.4s ease-out; }
58
+ @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
59
  </style>
60
  </head>
61
  <body>
62
 
63
  <nav>
64
  <div class="nav-container">
65
+ <a id="btn-dict" class="active" onclick="showTab('dictionary')">DICTIONARY</a>
66
+ <a id="btn-gram" onclick="showTab('grammar')">GRAMMAR</a>
67
  </div>
68
  </nav>
69
 
70
  <header>
71
  <h1>HUIUCL</h1>
72
+ <div class="sub-header">Systemized Linguistic Archive v5.0</div>
73
  </header>
74
 
75
  <div class="container">
76
  <section id="dictionary" class="active">
77
+ <input type="text" id="searchInput" class="search-box" placeholder="Search words, meanings, or categories..." oninput="render()">
 
 
78
  <div class="table-card">
79
  <table>
80
  <thead>
81
  <tr>
82
+ <th>WORD</th>
83
+ <th>MEANING & USAGE</th>
84
+ <th style="text-align:right">CATEGORY</th>
85
  </tr>
86
  </thead>
87
  <tbody id="dictBody"></tbody>
 
90
  </section>
91
 
92
  <section id="grammar">
93
+ <div id="grammarContent" class="grammar-grid">
94
+ </div>
95
  </section>
96
  </div>
97
 
98
  <script>
99
+ let db = {};
100
 
101
  function showTab(id) {
102
  document.querySelectorAll('section').forEach(s => s.classList.remove('active'));
103
+ document.querySelectorAll('nav a').forEach(a => a.classList.remove('active'));
104
  document.getElementById(id).classList.add('active');
105
+ document.getElementById('btn-' + (id === 'dictionary' ? 'dict' : 'gram')).classList.add('active');
106
  }
107
 
108
  window.onload = () => {
109
+ fetch('Huiucl.json')
110
+ .then(res => res.json())
111
+ .then(data => {
112
+ db = data;
113
+ render();
114
+ renderGrammar();
115
+ })
116
+ .catch(err => console.error("JSON 로드 실패:", err));
117
  };
118
 
119
  function render() {
 
121
  const body = document.getElementById('dictBody');
122
  body.innerHTML = '';
123
 
124
+ for (const cat in db) {
125
  if (cat === "Settings") continue;
126
+ processCategory(db[cat], cat, query);
127
  }
128
  }
129
 
130
+ function processCategory(obj, path, query) {
131
  if (path.includes("Grammar_Rules")) return;
132
 
133
  for (const key in obj) {
134
  const val = obj[key];
135
  if (!val) continue;
136
 
137
+ const info = getInfo(key, val);
 
138
 
139
  if (info.isWord) {
140
+ if ((info.word + info.ko + info.en + path).toLowerCase().includes(query)) {
141
+ appendRow(info, path);
142
  }
 
143
  // 파생어 처리
144
  if (val.derivations) {
145
  for (const dk in val.derivations) {
146
+ appendRow({ word: dk, ko: val.derivations[dk], en: "", usage: "" }, path, true);
147
  }
148
  }
149
+ // 시제 변형 등 내부 재귀
 
150
  if (typeof val === 'object' && val.tense_variants) {
151
+ processCategory(val.tense_variants, path + " > " + key, query);
152
  }
153
+ } else if (typeof val === 'object') {
154
+ processCategory(val, path + " > " + key, query);
 
 
155
  }
156
  }
157
  }
158
 
159
+ function getInfo(key, val) {
160
  let res = { isWord: false, word: key, ko: "", en: "", usage: "" };
161
 
 
162
  if (typeof val === 'string') {
163
  res.isWord = true;
164
  res.ko = val;
165
+ } else if (typeof val === 'object') {
166
+ // morpheme 키가 있으면 그것을 단어로 취급
167
+ if (val.morpheme) res.word = val.morpheme;
 
 
 
 
 
 
 
 
 
 
168
 
169
+ res.ko = val.meaning_ko || val.ko || val.뜻 || val.definition || "";
170
+ res.en = val.meaning_en || val.en || "";
171
+ res.usage = val.usage || val.note || "";
172
+
173
+ // 객체 안의 객체 에러 방지 (강제 문자열화)
174
+ const clean = (v) => (typeof v === 'object' ? (v.ko || v.meaning_ko || v.en || JSON.stringify(v)) : v);
175
+ res.ko = clean(res.ko);
176
+ res.en = clean(res.en);
177
+ res.usage = clean(res.usage);
178
 
179
  if (res.ko || res.en) res.isWord = true;
180
  }
181
  return res;
182
  }
183
 
184
+ function appendRow(info, path, isSub) {
 
 
 
 
185
  const body = document.getElementById('dictBody');
186
  const row = body.insertRow();
187
+ if (isSub) row.style.background = "#fcfcfc";
188
 
189
+ let meaningHtml = `<div class="ko-text">${info.ko}</div>`;
190
+ if (info.en) meaningHtml += `<div class="en-text">${info.en}</div>`;
191
+ if (info.usage) meaningHtml += `<div class="usage-box"><strong>NOTE:</strong> ${info.usage}</div>`;
 
 
 
192
 
193
  row.innerHTML = `
194
+ <td class="word-cell" style="${isSub ? 'padding-left:40px; font-size:1rem; opacity:0.7;' : ''}">
195
+ ${isSub ? '↳ ' : ''}${info.word}
196
+ </td>
197
+ <td class="meaning-cell">${meaningHtml}</td>
198
+ <td class="path-cell">${path}</td>
199
  `;
200
  }
201
+
202
+ function renderGrammar() {
203
+ const container = document.getElementById('grammarContent');
204
+ let html = "";
205
+
206
+ // 1. Settings 데이터 처리
207
+ if (db.Settings) {
208
+ html += `<div class="grammar-card">
209
+ <h2>General System</h2>
210
+ <div class="rule-item"><span class="rule-name">Word Order</span><span class="rule-desc">${db.Settings.Syntax.Word_Order.join(', ')}</span></div>
211
+ <div class="rule-item"><span class="rule-name">Imperative</span><span class="rule-desc">${db.Settings.Syntax.Imperative["2"]}</span></div>
212
+ <div class="rule-item"><span class="rule-name">Phonology</span><span class="rule-desc">Vowels: ${Object.keys(db.Settings.Phonology.Vowels).join(', ')} / Consonants: ${Object.keys(db.Settings.Phonology.Consonants).join(', ')}</span></div>
213
+ </div>`;
214
+ }
215
+
216
+ // 2. 트리 전체를 뒤져서 Grammar_Rules 수집
217
+ function collect(obj, path) {
218
+ for (const key in obj) {
219
+ if (key === "Grammar_Rules") {
220
+ html += `<div class="grammar-card"><h2>${path} Rules</h2>`;
221
+ for (const r in obj[key]) {
222
+ html += `<div class="rule-item"><span class="rule-name">${r}</span><span class="rule-desc">${obj[key][r]}</span></div>`;
223
+ }
224
+ html += `</div>`;
225
+ } else if (typeof obj[key] === 'object' && key !== "Settings") {
226
+ collect(obj[key], path ? path + " > " + key : key);
227
+ }
228
+ }
229
+ }
230
+ collect(db, "");
231
+ container.innerHTML = html || "<p style='grid-column: 1/-1; text-align:center; padding:50px;'>No grammar rules found.</p>";
232
+ }
233
  </script>
234
  </body>
235
  </html>