Spaces:
Running
Running
Update index.html
Browse files- 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
|
| 6 |
<style>
|
| 7 |
:root {
|
| 8 |
--bg: #f8f9fa;
|
| 9 |
-
--
|
| 10 |
-
--accent: #
|
| 11 |
-
--
|
| 12 |
-
--
|
| 13 |
}
|
| 14 |
|
| 15 |
-
body { font-family: '
|
| 16 |
-
.container { max-width: 1200px; margin: 0 auto; }
|
| 17 |
|
| 18 |
-
/*
|
| 19 |
-
|
| 20 |
-
.
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 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 |
-
|
| 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 |
-
.
|
| 35 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
.
|
| 38 |
-
.
|
| 39 |
|
| 40 |
-
|
| 41 |
-
.
|
| 42 |
</style>
|
| 43 |
</head>
|
| 44 |
<body>
|
| 45 |
|
| 46 |
-
<
|
| 47 |
-
<div class="
|
| 48 |
-
<
|
| 49 |
-
|
| 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 |
-
|
| 71 |
-
|
| 72 |
-
|
| 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
|
| 83 |
-
if (
|
| 84 |
-
|
| 85 |
}
|
| 86 |
}
|
| 87 |
|
| 88 |
-
function
|
| 89 |
if (path.includes("Grammar_Rules")) return;
|
| 90 |
|
| 91 |
-
for (const key in
|
| 92 |
-
const
|
| 93 |
-
if (!
|
| 94 |
|
| 95 |
-
// 1.
|
| 96 |
-
const
|
| 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 (
|
| 114 |
-
for (const
|
| 115 |
-
|
| 116 |
}
|
| 117 |
}
|
| 118 |
|
| 119 |
-
//
|
| 120 |
-
if (
|
| 121 |
-
|
| 122 |
}
|
| 123 |
}
|
| 124 |
-
// 2.
|
| 125 |
-
else if (typeof
|
| 126 |
-
|
| 127 |
-
appendRow(key, { ko: item, en: "", usage: "" }, path);
|
| 128 |
-
}
|
| 129 |
}
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
}
|
|
|
|
| 138 |
}
|
| 139 |
|
| 140 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
const body = document.getElementById('dictBody');
|
| 142 |
const row = body.insertRow();
|
| 143 |
if (isSub) row.className = 'sub-row';
|
| 144 |
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
if (
|
| 148 |
-
|
| 149 |
-
|
| 150 |
}
|
| 151 |
|
| 152 |
row.innerHTML = `
|
| 153 |
-
<td>
|
| 154 |
-
|
| 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>
|