Spaces:
Running
Running
Update index.html
Browse files- index.html +178 -171
index.html
CHANGED
|
@@ -2,87 +2,99 @@
|
|
| 2 |
<html lang="ko">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
-
<
|
|
|
|
| 6 |
<style>
|
| 7 |
:root {
|
| 8 |
-
--bg: #
|
| 9 |
-
--card: #ffffff;
|
| 10 |
-
--
|
| 11 |
-
--
|
| 12 |
-
--
|
| 13 |
-
--
|
| 14 |
}
|
| 15 |
|
| 16 |
-
body {
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 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.
|
|
|
|
| 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 |
-
<
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
</div>
|
| 68 |
</nav>
|
| 69 |
|
| 70 |
<header>
|
| 71 |
<h1>HUIUCL</h1>
|
| 72 |
-
<div class="sub-
|
| 73 |
</header>
|
| 74 |
|
| 75 |
<div class="container">
|
| 76 |
<section id="dictionary" class="active">
|
| 77 |
-
<
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>
|
| 88 |
</table>
|
|
@@ -90,146 +102,141 @@
|
|
| 90 |
</section>
|
| 91 |
|
| 92 |
<section id="grammar">
|
| 93 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
</div>
|
|
|
|
|
|
|
|
|
|
| 95 |
</section>
|
| 96 |
</div>
|
| 97 |
|
| 98 |
<script>
|
| 99 |
-
let
|
|
|
|
| 100 |
|
| 101 |
-
|
|
|
|
| 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 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
})
|
| 116 |
-
.catch(err => console.error("JSON ๋ก๋ ์คํจ:", err));
|
| 117 |
};
|
| 118 |
|
| 119 |
-
|
| 120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
const body = document.getElementById('dictBody');
|
|
|
|
| 122 |
body.innerHTML = '';
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
if (cat === "Settings") continue;
|
| 126 |
-
processCategory(db[cat], cat, query);
|
| 127 |
-
}
|
| 128 |
}
|
| 129 |
|
| 130 |
-
function
|
| 131 |
-
if (path.includes("Grammar_Rules")) return;
|
| 132 |
-
|
| 133 |
for (const key in obj) {
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
if (
|
| 140 |
-
if ((
|
| 141 |
-
|
| 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
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 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
|
| 185 |
-
const
|
| 186 |
-
|
| 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>
|
|
|
|
| 2 |
<html lang="ko">
|
| 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 |
+
--variation-bg: #faf9f6;
|
| 15 |
}
|
| 16 |
|
| 17 |
+
body {
|
| 18 |
+
font-family: 'Pretendard', sans-serif;
|
| 19 |
+
background-color: var(--bg-color);
|
| 20 |
+
color: var(--primary-color);
|
| 21 |
+
margin: 0; padding: 0; line-height: 1.6;
|
| 22 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
/* ๋ค๋น๊ฒ์ด์
: ARCHIVE๋ฅผ ๋งจ ๋ค๋ก ์ด๋ */
|
| 25 |
+
nav {
|
| 26 |
+
position: sticky; top: 0; background: rgba(249, 247, 242, 0.9);
|
| 27 |
+
backdrop-filter: blur(10px); padding: 20px; text-align: center;
|
| 28 |
+
border-bottom: 1px solid var(--border-color); z-index: 100;
|
| 29 |
+
}
|
| 30 |
+
nav a { margin: 0 15px; text-decoration: none; color: var(--primary-color); font-weight: 500; font-size: 0.9rem; transition: 0.2s; }
|
| 31 |
+
nav a:hover { color: var(--accent-color); }
|
| 32 |
+
|
| 33 |
+
header { text-align: center; padding: 60px 20px; }
|
| 34 |
+
h1 { font-weight: 300; letter-spacing: 8px; color: var(--accent-color); margin: 0; }
|
| 35 |
+
.sub-title { font-size: 0.9rem; color: #999; margin-top: 10px; }
|
| 36 |
+
|
| 37 |
+
.container { max-width: 900px; margin: 0 auto; padding: 0 20px 100px; }
|
| 38 |
section { display: none; }
|
| 39 |
+
section.active { display: block; animation: fadeIn 0.5s; }
|
| 40 |
+
|
| 41 |
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
| 42 |
+
|
| 43 |
+
/* ์ฌ์ (DICTIONARY) ์คํ์ผ */
|
| 44 |
+
.search-container { margin-bottom: 30px; display: flex; gap: 10px; }
|
| 45 |
+
input[type="text"] { flex: 1; padding: 12px 24px; border: 1px solid var(--border-color); border-radius: 30px; outline: none; }
|
| 46 |
+
.filter-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 30px; }
|
| 47 |
+
button { background: var(--card-bg); border: 1px solid var(--border-color); padding: 6px 16px; cursor: pointer; border-radius: 20px; font-size: 0.85rem; }
|
| 48 |
+
button.active { background: var(--accent-color); color: white; border-color: var(--accent-color); }
|
| 49 |
+
.table-wrapper { background: var(--card-bg); border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
|
| 50 |
+
table { width: 100%; border-collapse: collapse; }
|
| 51 |
+
th, td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--bg-color); }
|
| 52 |
+
th { background: #f1eee6; font-size: 0.9rem; color: #777; }
|
| 53 |
+
.word-cell { font-weight: bold; color: var(--accent-color); }
|
| 54 |
+
|
| 55 |
+
/* ๋ฌธ๋ฒ(GRAMMAR) ์คํ์ผ */
|
| 56 |
+
.card { background: var(--card-bg); padding: 40px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.03); margin-bottom: 20px; }
|
| 57 |
+
|
| 58 |
+
/* ์์นด์ด๋ธ(ARCHIVE) ์คํ์ผ: ๋ฆฌ์คํธ & ๋ทฐ์ด */
|
| 59 |
+
.archive-layout { display: flex; gap: 30px; }
|
| 60 |
+
.story-list { width: 250px; flex-shrink: 0; }
|
| 61 |
+
.story-item {
|
| 62 |
+
padding: 15px; background: var(--card-bg); margin-bottom: 10px;
|
| 63 |
+
border-radius: 10px; cursor: pointer; border: 1px solid var(--border-color);
|
| 64 |
+
font-size: 0.9rem; transition: 0.2s;
|
| 65 |
+
}
|
| 66 |
+
.story-item:hover, .story-item.active { border-color: var(--accent-color); color: var(--accent-color); background: #fdfcf9; }
|
| 67 |
+
.story-content { flex: 1; background: var(--card-bg); padding: 40px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.03); min-height: 400px; }
|
| 68 |
+
.story-line { margin-bottom: 25px; }
|
| 69 |
+
.huiucl-text { font-size: 1.2rem; color: var(--accent-color); font-weight: 600; margin-bottom: 5px; }
|
| 70 |
+
.korean-text { font-size: 1rem; color: #777; border-left: 2px solid var(--border-color); padding-left: 15px; }
|
| 71 |
</style>
|
| 72 |
</head>
|
| 73 |
<body>
|
| 74 |
|
| 75 |
<nav>
|
| 76 |
+
<a href="#" onclick="showSection('dictionary')">DICTIONARY</a>
|
| 77 |
+
<a href="#" onclick="showSection('grammar')">GRAMMAR</a>
|
| 78 |
+
<a href="#" onclick="showSection('archive')">ARCHIVE</a>
|
|
|
|
| 79 |
</nav>
|
| 80 |
|
| 81 |
<header>
|
| 82 |
<h1>HUIUCL</h1>
|
| 83 |
+
<div class="sub-title">v2.0 Revision - Artificial Language Project</div>
|
| 84 |
</header>
|
| 85 |
|
| 86 |
<div class="container">
|
| 87 |
<section id="dictionary" class="active">
|
| 88 |
+
<div class="search-container">
|
| 89 |
+
<input type="text" id="searchInput" placeholder="๋จ์ด ํน์ ์๋ฏธ ๊ฒ์..." onkeyup="renderTable()">
|
| 90 |
+
</div>
|
| 91 |
+
<div class="filter-container" id="categoryButtons">
|
| 92 |
+
<button onclick="changeCategory('๋ชจ๋', this)" class="active">๋ชจ๋ ๋ณด๊ธฐ</button>
|
| 93 |
+
</div>
|
| 94 |
+
<div class="table-wrapper">
|
| 95 |
<table>
|
| 96 |
<thead>
|
| 97 |
+
<tr><th>๋จ์ด</th><th>์๋ฏธ</th><th>๋ถ๋ฅ</th></tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
</thead>
|
| 99 |
<tbody id="dictBody"></tbody>
|
| 100 |
</table>
|
|
|
|
| 102 |
</section>
|
| 103 |
|
| 104 |
<section id="grammar">
|
| 105 |
+
<div class="card">
|
| 106 |
+
<h2 style="font-weight: 300;">Basic Grammar</h2>
|
| 107 |
+
<p><strong>1. ์ด์:</strong> ์ฃผ์ด-๋์ฌ(SV) ๋๋ ์ฃผ์ด-๋์ฌ-๋ชฉ์ ์ด(SVO)</p>
|
| 108 |
+
<p><strong>2. ๋ช
๋ น๋ฌธ:</strong> ๋์ฌ๋ฅผ ๋งจ ์์ ์์น</p>
|
| 109 |
+
<p><strong>3. ์์ :</strong> ๊ณผ๊ฑฐํ <code>-m</code>, ๋ฏธ๋ํ <code>-n</code></p>
|
| 110 |
+
<hr style="border: 0; border-top: 1px solid var(--border-color); margin: 20px 0;">
|
| 111 |
+
<h3>Phoneme (์์)</h3>
|
| 112 |
+
<p><strong>Vowels:</strong> a, i, u</p>
|
| 113 |
+
<p><strong>Consonants:</strong> m, n, s, h, l, c(ใฒ), t(ใธ)</p>
|
| 114 |
+
</div>
|
| 115 |
+
</section>
|
| 116 |
+
|
| 117 |
+
<section id="archive">
|
| 118 |
+
<div class="archive-layout">
|
| 119 |
+
<div class="story-list">
|
| 120 |
+
<div class="story-item active" onclick="loadStory(0, this)">01. ํ์</div>
|
| 121 |
+
<div class="story-item" onclick="loadStory(1, this)">02. ์ค๋น ์ค...</div>
|
| 122 |
</div>
|
| 123 |
+
<div class="story-content" id="storyViewer">
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
</section>
|
| 127 |
</div>
|
| 128 |
|
| 129 |
<script>
|
| 130 |
+
let conlangData = {};
|
| 131 |
+
let currentCategory = '๋ชจ๋';
|
| 132 |
|
| 133 |
+
// ์น์
์ ํ
|
| 134 |
+
function showSection(id) {
|
| 135 |
document.querySelectorAll('section').forEach(s => s.classList.remove('active'));
|
|
|
|
| 136 |
document.getElementById(id).classList.add('active');
|
|
|
|
| 137 |
}
|
| 138 |
|
| 139 |
+
// ์์ค ๋ฐ์ดํฐ ๋ก๋ ๋ฐ ์ ํ
|
| 140 |
+
const stories = [
|
| 141 |
+
{
|
| 142 |
+
title: "๊ธฐ๋ก 01: ํ์",
|
| 143 |
+
lines: [
|
| 144 |
+
{ h: "unal cinicl si hamolhilasna clamam..", k: "์ฐ์ฃผ์ ํ๋ชฐํ๋ผ์ค๋๊ฐ ํ์ด๋ฌ๋ค." },
|
| 145 |
+
{ h: "su u clum hoct.", k: "๊ทธ๋ ์ ์ด์๋ค." }
|
| 146 |
+
]
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
title: "๊ธฐ๋ก 02: (๋ด์ฉ์ ์ถ๊ฐํ์ธ์)",
|
| 150 |
+
lines: [
|
| 151 |
+
{ h: "...", k: "๋ค์ ์ด์ผ๊ธฐ๋ฅผ ์ค๋น ์ค์
๋๋ค." }
|
| 152 |
+
]
|
| 153 |
+
}
|
| 154 |
+
];
|
| 155 |
+
|
| 156 |
+
function loadStory(index, el) {
|
| 157 |
+
if(el) {
|
| 158 |
+
document.querySelectorAll('.story-item').forEach(item => item.classList.remove('active'));
|
| 159 |
+
el.classList.add('active');
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
const story = stories[index];
|
| 163 |
+
let html = `<h2 style="font-weight:300; margin-bottom:40px; text-align:center;">${story.title}</h2>`;
|
| 164 |
+
story.lines.forEach(line => {
|
| 165 |
+
html += `
|
| 166 |
+
<div class="story-line">
|
| 167 |
+
<div class="huiucl-text">${line.h}</div>
|
| 168 |
+
<div class="korean-text">${line.k}</div>
|
| 169 |
+
</div>`;
|
| 170 |
+
});
|
| 171 |
+
document.getElementById('storyViewer').innerHTML = html;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
// ์ด๊ธฐ ์คํ
|
| 175 |
window.onload = () => {
|
| 176 |
+
loadStory(0);
|
| 177 |
fetch('Huiucl.json')
|
| 178 |
.then(res => res.json())
|
| 179 |
.then(data => {
|
| 180 |
+
conlangData = data;
|
| 181 |
+
initButtons();
|
| 182 |
+
renderTable();
|
| 183 |
+
});
|
|
|
|
| 184 |
};
|
| 185 |
|
| 186 |
+
// --- ์ฌ์ ๋ก์ง (๊ธฐ์กด๊ณผ ๋์ผ) ---
|
| 187 |
+
function initButtons() {
|
| 188 |
+
const container = document.getElementById('categoryButtons');
|
| 189 |
+
Object.keys(conlangData).forEach(key => {
|
| 190 |
+
if (key === "์ค์ ") return;
|
| 191 |
+
const btn = document.createElement('button');
|
| 192 |
+
btn.innerText = key;
|
| 193 |
+
btn.onclick = (e) => {
|
| 194 |
+
document.querySelectorAll('#categoryButtons button').forEach(b => b.classList.remove('active'));
|
| 195 |
+
e.target.classList.add('active');
|
| 196 |
+
currentCategory = key;
|
| 197 |
+
renderTable();
|
| 198 |
+
};
|
| 199 |
+
container.appendChild(btn);
|
| 200 |
+
});
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
function renderTable() {
|
| 204 |
const body = document.getElementById('dictBody');
|
| 205 |
+
const search = document.getElementById('searchInput').value.toLowerCase();
|
| 206 |
body.innerHTML = '';
|
| 207 |
+
const targets = currentCategory === '๋ชจ๋' ? Object.keys(conlangData).filter(k => k !== "์ค์ ") : [currentCategory];
|
| 208 |
+
targets.forEach(cat => traverse(conlangData[cat], cat, search));
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
| 210 |
|
| 211 |
+
function traverse(obj, path, search) {
|
|
|
|
|
|
|
| 212 |
for (const key in obj) {
|
| 213 |
+
if (key === "์ค์ " || key === "๋ณํ") continue;
|
| 214 |
+
const item = obj[key];
|
| 215 |
+
if (item && typeof item === 'object' && item.hasOwnProperty('๋ป')) {
|
| 216 |
+
if (key.toLowerCase().includes(search) || item.๋ป.toLowerCase().includes(search)) addRow(key, item.๋ป, path, false);
|
| 217 |
+
if (item[key] && typeof item[key] === 'object') processVariations(item[key], `${path} > ${key}`, search);
|
| 218 |
+
} else if (typeof item === 'string') {
|
| 219 |
+
if (key.toLowerCase().includes(search) || item.toLowerCase().includes(search)) addRow(key, item, path, false);
|
| 220 |
+
} else if (typeof item === 'object') {
|
| 221 |
+
traverse(item, `${path} > ${key}`, search);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
}
|
| 223 |
}
|
| 224 |
}
|
| 225 |
|
| 226 |
+
function processVariations(vObj, path, search) {
|
| 227 |
+
for (const vKey in vObj) {
|
| 228 |
+
const vVal = vObj[vKey];
|
| 229 |
+
const meaning = typeof vVal === 'string' ? vVal : (vVal.๋ป || "");
|
| 230 |
+
if (vKey.toLowerCase().includes(search) || meaning.toLowerCase().includes(search)) addRow(vKey, meaning, path, true);
|
| 231 |
+
if (typeof vVal === 'object' && vVal[vKey]) processVariations(vVal[vKey], `${path} > ${vKey}`, search);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
}
|
|
|
|
| 233 |
}
|
| 234 |
|
| 235 |
+
function addRow(word, meaning, path, isVar) {
|
| 236 |
+
const row = document.getElementById('dictBody').insertRow();
|
| 237 |
+
row.innerHTML = `<td class="word-cell">${isVar ? 'โณ ' : ''}${word}</td><td>${meaning}</td><td style="font-size:0.7rem; color:#ccc;">${path}</td>`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
}
|
| 239 |
</script>
|
| 240 |
+
|
| 241 |
</body>
|
| 242 |
+
</html>
|