Spaces:
Running
Running
Update index.html
Browse files- 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
|
| 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;
|
| 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;
|
| 33 |
-
th, td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #eee;
|
| 34 |
-
th { background: #f1eee6; color: #777; font-size: 0.85rem;
|
| 35 |
-
|
| 36 |
-
.
|
| 37 |
-
.meaning-cell { width: 50%; }
|
| 38 |
.path-cell { font-size: 0.7rem; color: #bbb; width: 20%; text-align: right; }
|
| 39 |
-
.
|
| 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.
|
| 52 |
</header>
|
| 53 |
|
| 54 |
<div class="container">
|
| 55 |
<section id="dictionary" class="active">
|
| 56 |
-
<input type="text" id="searchInput" class="search-box" placeholder="
|
| 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 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
renderGrammarPage();
|
| 96 |
-
});
|
| 97 |
};
|
| 98 |
|
| 99 |
function initFilterButtons() {
|
|
@@ -125,54 +105,69 @@
|
|
| 125 |
: [currentCategory];
|
| 126 |
|
| 127 |
categories.forEach(cat => {
|
| 128 |
-
|
| 129 |
});
|
| 130 |
}
|
| 131 |
|
| 132 |
-
|
| 133 |
-
|
|
|
|
| 134 |
|
| 135 |
for (let key in obj) {
|
| 136 |
const val = obj[key];
|
| 137 |
if (!val) continue;
|
| 138 |
|
| 139 |
-
// 1. ๋จ์ด ๊ฐ์ฒด
|
| 140 |
-
if (typeof val === 'object' && (val.meaning_ko || val.ko || val.๋ป)) {
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
| 145 |
}
|
| 146 |
-
|
|
|
|
| 147 |
if (val.derivations) {
|
| 148 |
for (let dKey in val.derivations) {
|
| 149 |
-
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
| 165 |
}
|
| 166 |
}
|
| 167 |
}
|
| 168 |
|
| 169 |
-
function appendRow(word,
|
| 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">${
|
| 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 |
-
|
| 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;
|
| 200 |
for (let rKey in obj[key]) {
|
| 201 |
-
html += `<p
|
| 202 |
}
|
| 203 |
html += `</div>`;
|
| 204 |
} else if (typeof obj[key] === 'object' && key !== "Settings") {
|
| 205 |
-
|
| 206 |
}
|
| 207 |
}
|
| 208 |
}
|
| 209 |
-
|
| 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>
|