OpenLab-NLP commited on
Commit
94d5ad0
ยท
verified ยท
1 Parent(s): d81e85c

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +62 -79
index.html CHANGED
@@ -3,40 +3,29 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>HUIUCL Online Archive</title>
7
  <style>
8
- :root {
9
- --bg-color: #f9f7f2;
10
- --card-bg: #ffffff;
11
- --primary-color: #5d5b54;
12
- --accent-color: #d4a373;
13
- --border-color: #e0ddd5;
14
- }
15
-
16
  body { font-family: 'Pretendard', sans-serif; background-color: var(--bg-color); color: var(--primary-color); margin: 0; padding: 0; line-height: 1.6; }
17
  nav { position: sticky; top: 0; background: rgba(249, 247, 242, 0.9); backdrop-filter: blur(10px); padding: 15px; text-align: center; border-bottom: 1px solid var(--border-color); z-index: 100; }
18
  nav a { margin: 0 15px; text-decoration: none; color: var(--primary-color); font-weight: 600; cursor: pointer; }
19
  header { text-align: center; padding: 40px 20px; }
20
  h1 { font-weight: 300; letter-spacing: 8px; color: var(--accent-color); margin: 0; }
21
-
22
- .container { max-width: 1000px; margin: 0 auto; padding: 0 20px 100px; }
23
  section { display: none; }
24
  section.active { display: block; }
25
-
26
  .filter-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 25px; }
27
- .filter-btn { background: var(--card-bg); border: 1px solid var(--border-color); padding: 8px 16px; cursor: pointer; border-radius: 20px; font-size: 0.85rem; transition: 0.2s; }
28
  .filter-btn.active { background: var(--accent-color); color: white; border-color: var(--accent-color); }
29
-
30
- .search-box { width: 100%; padding: 15px 25px; border: 1px solid var(--border-color); border-radius: 30px; font-size: 1rem; margin-bottom: 20px; box-sizing: border-box; outline: none; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
31
  .table-wrapper { background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
32
- table { width: 100%; border-collapse: collapse; table-layout: fixed; }
33
- th, td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #eee; overflow: hidden; text-overflow: ellipsis; }
34
- th { background: #f1eee6; color: #777; font-size: 0.85rem; font-weight: 600; }
35
-
36
- .word-cell { font-weight: bold; color: var(--accent-color); width: 30%; }
37
- .meaning-cell { width: 50%; }
38
  .path-cell { font-size: 0.7rem; color: #bbb; width: 20%; text-align: right; }
39
- .variation-row { background: #faf9f6; font-size: 0.95rem; }
40
  </style>
41
  </head>
42
  <body>
@@ -48,32 +37,25 @@
48
 
49
  <header>
50
  <h1>HUIUCL</h1>
51
- <div style="color:#999; font-size:0.8rem; margin-top:5px;">DATABASE v2.5 (Full Load)</div>
52
  </header>
53
 
54
  <div class="container">
55
  <section id="dictionary" class="active">
56
- <input type="text" id="searchInput" class="search-box" placeholder="๋ชจ๋“  ๋‹จ์–ด, ๋Œ€๋ช…์‚ฌ, ์ธ์‚ฌ๋ง ๊ฒ€์ƒ‰..." oninput="renderTable()">
57
  <div class="filter-container" id="categoryButtons">
58
  <button class="filter-btn active" onclick="filterCategory('๋ชจ๋‘', this)">๋ชจ๋‘ ๋ณด๊ธฐ</button>
59
  </div>
60
  <div class="table-wrapper">
61
  <table>
62
  <thead>
63
- <tr>
64
- <th style="width:30%">๋‹จ์–ด</th>
65
- <th style="width:50%">์˜๋ฏธ</th>
66
- <th style="width:20%; text-align:right;">๋ถ„๋ฅ˜</th>
67
- </tr>
68
  </thead>
69
  <tbody id="dictBody"></tbody>
70
  </table>
71
  </div>
72
  </section>
73
-
74
- <section id="grammar">
75
- <div id="grammarContent"></div>
76
- </section>
77
  </div>
78
 
79
  <script>
@@ -86,14 +68,12 @@
86
  }
87
 
88
  window.onload = () => {
89
- fetch('Huiucl.json')
90
- .then(res => res.json())
91
- .then(data => {
92
- conlangData = data;
93
- initFilterButtons();
94
- renderTable();
95
- renderGrammarPage();
96
- });
97
  };
98
 
99
  function initFilterButtons() {
@@ -125,54 +105,69 @@
125
  : [currentCategory];
126
 
127
  categories.forEach(cat => {
128
- processData(conlangData[cat], cat, query);
129
  });
130
  }
131
 
132
- function processData(obj, path, query) {
133
- if (path.includes("Grammar_Rules")) return;
 
134
 
135
  for (let key in obj) {
136
  const val = obj[key];
137
  if (!val) continue;
138
 
139
- // 1. ๋‹จ์–ด ๊ฐ์ฒด ๊ตฌ์กฐ (meaning_ko ํ˜น์€ ko/en ํ‚ค๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ)
140
- if (typeof val === 'object' && (val.meaning_ko || val.ko || val.๋œป)) {
141
- const ko = val.meaning_ko || val.ko || val.๋œป || "";
142
- const en = val.meaning_en || val.en || "";
143
- if (key.toLowerCase().includes(query) || ko.toLowerCase().includes(query)) {
144
- appendRow(key, `${ko} ${en ? '/ ' + en : ''}`, path);
 
 
 
145
  }
146
- // ํŒŒ์ƒ์–ด ์ฒ˜๋ฆฌ
 
147
  if (val.derivations) {
148
  for (let dKey in val.derivations) {
149
- const dMean = val.derivations[dKey];
150
- if (dKey.toLowerCase().includes(query) || dMean.toLowerCase().includes(query)) {
151
- appendRow(dKey, dMean, path, true);
152
- }
153
  }
154
  }
 
 
 
 
 
155
  }
156
- // 2. ๋Œ€๋ช…์‚ฌ/์ธ์‚ฌ๋ง ๊ตฌ์กฐ (๋‹จ์ˆœ ํ‚ค-๊ฐ’ ์Œ์ธ ๊ฒฝ์šฐ)
157
  else if (typeof val === 'string') {
158
  if (key.toLowerCase().includes(query) || val.toLowerCase().includes(query)) {
159
- appendRow(key, val, path);
160
  }
161
  }
162
- // 3. ์ค‘์ฒฉ๋œ ์นดํ…Œ๊ณ ๋ฆฌ (๊ณ„์† ํƒ์ƒ‰)
163
  else if (typeof val === 'object') {
164
- processData(val, path + " > " + key, query);
 
 
 
165
  }
166
  }
167
  }
168
 
169
- function appendRow(word, meaning, path, isSub) {
170
  const body = document.getElementById('dictBody');
171
  const row = body.insertRow();
172
  if (isSub) row.className = 'variation-row';
 
 
 
 
 
173
  row.innerHTML = `
174
  <td class="word-cell">${isSub ? 'โ”” ' : ''}${word}</td>
175
- <td class="meaning-cell">${meaning}</td>
176
  <td class="path-cell">${path}</td>
177
  `;
178
  }
@@ -180,34 +175,22 @@
180
  function renderGrammarPage() {
181
  const target = document.getElementById('grammarContent');
182
  let html = "";
183
- if (conlangData.Settings) {
184
- const s = conlangData.Settings;
185
- html += `<div style="background:white; padding:30px; border-radius:15px; margin-bottom:20px; box-shadow:0 5px 15px rgba(0,0,0,0.05);">
186
- <h2 style="margin-top:0; color:var(--accent-color);">System Settings</h2>
187
- <p><strong>์–ด์ˆœ (Word Order):</strong> ${s.Syntax.Word_Order.join(', ')}</p>
188
- <p><strong>๋ช…๋ น๋ฌธ:</strong> ${s.Syntax.Imperative["2"]}</p>
189
- <hr style="border:0; border-top:1px solid #eee; margin:20px 0;">
190
- <p><strong>Vowels:</strong> ${Object.keys(s.Phonology.Vowels).join(', ')}</p>
191
- <p><strong>Consonants:</strong> ${Object.keys(s.Phonology.Consonants).join(', ')}</p>
192
- </div>`;
193
- }
194
-
195
- function extractRules(obj, path) {
196
  for (let key in obj) {
197
  if (key === "Grammar_Rules") {
198
  html += `<div style="background:white; padding:30px; border-radius:15px; margin-bottom:20px; box-shadow:0 5px 15px rgba(0,0,0,0.05);">
199
- <h3 style="margin-top:0; border-bottom:2px solid var(--accent-color); display:inline-block; padding-bottom:5px;">${path} Rules</h3>`;
200
  for (let rKey in obj[key]) {
201
- html += `<p style="margin:10px 0;"><strong>${rKey}:</strong> ${obj[key][rKey]}</p>`;
202
  }
203
  html += `</div>`;
204
  } else if (typeof obj[key] === 'object' && key !== "Settings") {
205
- extractRules(obj[key], path ? path + " > " + key : key);
206
  }
207
  }
208
  }
209
- extractRules(conlangData, "");
210
- target.innerHTML = html;
211
  }
212
  </script>
213
  </body>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>HUIUCL Database</title>
7
  <style>
8
+ :root { --bg-color: #f9f7f2; --card-bg: #ffffff; --primary-color: #5d5b54; --accent-color: #d4a373; --border-color: #e0ddd5; }
 
 
 
 
 
 
 
9
  body { font-family: 'Pretendard', sans-serif; background-color: var(--bg-color); color: var(--primary-color); margin: 0; padding: 0; line-height: 1.6; }
10
  nav { position: sticky; top: 0; background: rgba(249, 247, 242, 0.9); backdrop-filter: blur(10px); padding: 15px; text-align: center; border-bottom: 1px solid var(--border-color); z-index: 100; }
11
  nav a { margin: 0 15px; text-decoration: none; color: var(--primary-color); font-weight: 600; cursor: pointer; }
12
  header { text-align: center; padding: 40px 20px; }
13
  h1 { font-weight: 300; letter-spacing: 8px; color: var(--accent-color); margin: 0; }
14
+ .container { max-width: 1100px; margin: 0 auto; padding: 0 20px 100px; }
 
15
  section { display: none; }
16
  section.active { display: block; }
 
17
  .filter-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 25px; }
18
+ .filter-btn { background: var(--card-bg); border: 1px solid var(--border-color); padding: 8px 16px; cursor: pointer; border-radius: 20px; font-size: 0.85rem; }
19
  .filter-btn.active { background: var(--accent-color); color: white; border-color: var(--accent-color); }
20
+ .search-box { width: 100%; padding: 15px 25px; border: 1px solid var(--border-color); border-radius: 30px; font-size: 1rem; margin-bottom: 20px; box-sizing: border-box; outline: none; }
 
21
  .table-wrapper { background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
22
+ table { width: 100%; border-collapse: collapse; }
23
+ th, td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #eee; }
24
+ th { background: #f1eee6; color: #777; font-size: 0.85rem; }
25
+ .word-cell { font-weight: bold; color: var(--accent-color); width: 25%; }
26
+ .meaning-cell { width: 55%; font-size: 0.95rem; }
 
27
  .path-cell { font-size: 0.7rem; color: #bbb; width: 20%; text-align: right; }
28
+ .usage-tag { font-size: 0.8rem; color: #888; display: block; margin-top: 4px; border-top: 1px dashed #eee; padding-top: 4px; }
29
  </style>
30
  </head>
31
  <body>
 
37
 
38
  <header>
39
  <h1>HUIUCL</h1>
40
+ <div style="color:#999; font-size:0.8rem; margin-top:5px;">DATABASE v2.7 (Manual Mapping)</div>
41
  </header>
42
 
43
  <div class="container">
44
  <section id="dictionary" class="active">
45
+ <input type="text" id="searchInput" class="search-box" placeholder="๋‹จ์–ด, ๋œป, ์นดํ…Œ๊ณ ๋ฆฌ ๊ฒ€์ƒ‰..." oninput="renderTable()">
46
  <div class="filter-container" id="categoryButtons">
47
  <button class="filter-btn active" onclick="filterCategory('๋ชจ๋‘', this)">๋ชจ๋‘ ๋ณด๊ธฐ</button>
48
  </div>
49
  <div class="table-wrapper">
50
  <table>
51
  <thead>
52
+ <tr><th>๋‹จ์–ด</th><th>์˜๋ฏธ ๋ฐ ์„ค๋ช…</th><th style="text-align:right;">๋ถ„๋ฅ˜</th></tr>
 
 
 
 
53
  </thead>
54
  <tbody id="dictBody"></tbody>
55
  </table>
56
  </div>
57
  </section>
58
+ <section id="grammar"><div id="grammarContent"></div></section>
 
 
 
59
  </div>
60
 
61
  <script>
 
68
  }
69
 
70
  window.onload = () => {
71
+ fetch('Huiucl.json').then(res => res.json()).then(data => {
72
+ conlangData = data;
73
+ initFilterButtons();
74
+ renderTable();
75
+ renderGrammarPage();
76
+ });
 
 
77
  };
78
 
79
  function initFilterButtons() {
 
105
  : [currentCategory];
106
 
107
  categories.forEach(cat => {
108
+ manualProcess(conlangData[cat], cat, query);
109
  });
110
  }
111
 
112
+ // ํ•˜๋‚˜ํ•˜๋‚˜ ์„ฑ๊ฒฉ์— ๋งž์ถฐ ์ง€์ • ์ฒ˜๋ฆฌํ•˜๋Š” ์ˆ˜๋™ ๋งคํ•‘ ์—”์ง„
113
+ function manualProcess(obj, path, query) {
114
+ if (path.includes("Grammar_Rules")) return; // ๋ฌธ๋ฒ• ๊ทœ์น™์€ ์‚ฌ์ „์—์„œ ์ œ์™ธ
115
 
116
  for (let key in obj) {
117
  const val = obj[key];
118
  if (!val) continue;
119
 
120
+ // 1. [๋‹จ์–ด ๊ฐ์ฒด] - meaning_ko, ko, definition ๋“ฑ์˜ ํ‚ค๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ
121
+ if (typeof val === 'object' && (val.meaning_ko || val.ko || val.definition || val.๋œป)) {
122
+ let mainWord = key;
123
+ let kor = val.meaning_ko || val.ko || val.๋œป || val.definition || "";
124
+ let eng = val.meaning_en || val.en || "";
125
+ let extra = val.usage || val.note || "";
126
+
127
+ if (mainWord.toLowerCase().includes(query) || kor.toLowerCase().includes(query)) {
128
+ appendRow(mainWord, kor, eng, extra, path);
129
  }
130
+
131
+ // ํ•˜์œ„ ํŒŒ์ƒ์–ด ์ฒ˜๋ฆฌ
132
  if (val.derivations) {
133
  for (let dKey in val.derivations) {
134
+ appendRow(dKey, val.derivations[dKey], "", "", path, true);
 
 
 
135
  }
136
  }
137
+
138
+ // ์กฐ๋™์‚ฌ ๋“ฑ ๋‚ด๋ถ€ ํ…์Šค ๋ณ€ํ˜•์ด ์žˆ๋Š” ๊ฒฝ์šฐ (acam, acac ๋“ฑ)
139
+ if (val.tense_variants) {
140
+ manualProcess(val.tense_variants, path + " > " + key, query);
141
+ }
142
  }
143
+ // 2. [๋‹จ์ˆœ ํ‚ค-๊ฐ’] - ๋Œ€๋ช…์‚ฌ, ์ธ์‚ฌ๋ง ๋“ฑ (key: "string")
144
  else if (typeof val === 'string') {
145
  if (key.toLowerCase().includes(query) || val.toLowerCase().includes(query)) {
146
+ appendRow(key, val, "", "", path);
147
  }
148
  }
149
+ // 3. [์กฐ์‚ฌ/์ ‘์‚ฌ ๊ตฌ์กฐ] - ํ‚ค ๋‚ด๋ถ€์— ๋˜ ์„ค๋ช…์ด ์žˆ๊ฑฐ๋‚˜, ๋ฌถ์—ฌ ์žˆ๋Š” ๊ฒฝ์šฐ
150
  else if (typeof val === 'object') {
151
+ // ํŠน์ • ํ‚ค(usage, note, definition) ์ž์ฒด๊ฐ€ ๋‹จ์–ด๋กœ ๋œจ์ง€ ์•Š๋„๋ก ํ•„ํ„ฐ๋งํ•˜๋ฉฐ ์žฌ๊ท€ ํƒ์ƒ‰
152
+ if (!["usage", "note", "definition", "tense_variants"].includes(key)) {
153
+ manualProcess(val, path + " > " + key, query);
154
+ }
155
  }
156
  }
157
  }
158
 
159
+ function appendRow(word, kor, eng, usage, path, isSub) {
160
  const body = document.getElementById('dictBody');
161
  const row = body.insertRow();
162
  if (isSub) row.className = 'variation-row';
163
+
164
+ let meaningHtml = `<strong>${kor}</strong>`;
165
+ if (eng) meaningHtml += ` <span style="color:#888;">(${eng})</span>`;
166
+ if (usage) meaningHtml += `<span class="usage-tag">โ€ป ${usage}</span>`;
167
+
168
  row.innerHTML = `
169
  <td class="word-cell">${isSub ? 'โ”” ' : ''}${word}</td>
170
+ <td class="meaning-cell">${meaningHtml}</td>
171
  <td class="path-cell">${path}</td>
172
  `;
173
  }
 
175
  function renderGrammarPage() {
176
  const target = document.getElementById('grammarContent');
177
  let html = "";
178
+ function findRules(obj, path) {
 
 
 
 
 
 
 
 
 
 
 
 
179
  for (let key in obj) {
180
  if (key === "Grammar_Rules") {
181
  html += `<div style="background:white; padding:30px; border-radius:15px; margin-bottom:20px; box-shadow:0 5px 15px rgba(0,0,0,0.05);">
182
+ <h3 style="margin-top:0; color:var(--accent-color);">${path || 'General'} Rules</h3>`;
183
  for (let rKey in obj[key]) {
184
+ html += `<p><strong>${rKey}:</strong> ${obj[key][rKey]}</p>`;
185
  }
186
  html += `</div>`;
187
  } else if (typeof obj[key] === 'object' && key !== "Settings") {
188
+ findRules(obj[key], path ? path + " > " + key : key);
189
  }
190
  }
191
  }
192
+ findRules(conlangData, "");
193
+ target.innerHTML = html || "<p>๋กœ๋“œ๋œ ๋ฌธ๋ฒ• ๊ทœ์น™์ด ์—†์Šต๋‹ˆ๋‹ค.</p>";
194
  }
195
  </script>
196
  </body>