Spaces:
Running
Running
Update index.html
Browse files- index.html +195 -120
index.html
CHANGED
|
@@ -1,121 +1,196 @@
|
|
| 1 |
-
<!DOCTYPE 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 Dictionary</title>
|
| 7 |
-
<style>
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
}
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
}
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
<
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
</
|
| 119 |
-
|
| 120 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE 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 Dictionary</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 {
|
| 17 |
+
font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
|
| 18 |
+
background-color: var(--bg-color);
|
| 19 |
+
color: var(--primary-color);
|
| 20 |
+
margin: 0;
|
| 21 |
+
padding: 40px 20px;
|
| 22 |
+
line-height: 1.6;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
header { text-align: center; margin-bottom: 40px; }
|
| 26 |
+
h1 { font-weight: 300; letter-spacing: 5px; color: var(--accent-color); margin-bottom: 10px; }
|
| 27 |
+
.sub-title { font-size: 0.9rem; color: #999; }
|
| 28 |
+
|
| 29 |
+
/* ๊ฒ์์ฐฝ ์น์
*/
|
| 30 |
+
.search-container {
|
| 31 |
+
max-width: 600px;
|
| 32 |
+
margin: 0 auto 30px auto;
|
| 33 |
+
display: flex;
|
| 34 |
+
gap: 10px;
|
| 35 |
+
}
|
| 36 |
+
input[type="text"] {
|
| 37 |
+
flex: 1;
|
| 38 |
+
padding: 12px 20px;
|
| 39 |
+
border: 1px solid var(--border-color);
|
| 40 |
+
border-radius: 30px;
|
| 41 |
+
outline: none;
|
| 42 |
+
background-color: var(--card-bg);
|
| 43 |
+
}
|
| 44 |
+
input[type="text"]:focus { border-color: var(--accent-color); }
|
| 45 |
+
|
| 46 |
+
/* ์นดํ
๊ณ ๋ฆฌ ๋ฒํผ */
|
| 47 |
+
.filter-container {
|
| 48 |
+
display: flex;
|
| 49 |
+
flex-wrap: wrap;
|
| 50 |
+
justify-content: center;
|
| 51 |
+
gap: 8px;
|
| 52 |
+
margin-bottom: 40px;
|
| 53 |
+
max-width: 800px;
|
| 54 |
+
margin-left: auto;
|
| 55 |
+
margin-right: auto;
|
| 56 |
+
}
|
| 57 |
+
button {
|
| 58 |
+
background: var(--card-bg);
|
| 59 |
+
border: 1px solid var(--border-color);
|
| 60 |
+
color: var(--primary-color);
|
| 61 |
+
padding: 6px 16px;
|
| 62 |
+
cursor: pointer;
|
| 63 |
+
border-radius: 20px;
|
| 64 |
+
font-size: 0.85rem;
|
| 65 |
+
transition: all 0.2s;
|
| 66 |
+
}
|
| 67 |
+
button:hover, button.active {
|
| 68 |
+
background: var(--accent-color);
|
| 69 |
+
color: white;
|
| 70 |
+
border-color: var(--accent-color);
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
/* ํ
์ด๋ธ ๋์์ธ */
|
| 74 |
+
.table-wrapper {
|
| 75 |
+
max-width: 900px;
|
| 76 |
+
margin: 0 auto;
|
| 77 |
+
background: var(--card-bg);
|
| 78 |
+
border-radius: 15px;
|
| 79 |
+
overflow: hidden;
|
| 80 |
+
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
|
| 81 |
+
}
|
| 82 |
+
table { width: 100%; border-collapse: collapse; }
|
| 83 |
+
th, td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--bg-color); }
|
| 84 |
+
th { background: #f1eee6; font-weight: 600; font-size: 0.9rem; color: #777; }
|
| 85 |
+
tr:last-child td { border-bottom: none; }
|
| 86 |
+
tr:hover { background-color: #fafafa; }
|
| 87 |
+
|
| 88 |
+
.word-cell { font-weight: bold; color: var(--accent-color); font-size: 1.1rem; }
|
| 89 |
+
.path-cell { font-size: 0.75rem; color: #bbb; }
|
| 90 |
+
</style>
|
| 91 |
+
</head>
|
| 92 |
+
<body>
|
| 93 |
+
|
| 94 |
+
<header>
|
| 95 |
+
<h1>HUIUCL</h1>
|
| 96 |
+
<div class="sub-title">์ธ๊ณต์ด ํ์ด์ฐํด ์จ๋ผ์ธ ์ฌ์ ์์นด์ด๋ธ</div>
|
| 97 |
+
</header>
|
| 98 |
+
|
| 99 |
+
<div class="search-container">
|
| 100 |
+
<input type="text" id="searchInput" placeholder="๋จ์ด ๋๋ ๋ป์ ๊ฒ์ํ์ธ์..." onkeyup="filterData()">
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<div class="filter-container" id="categoryButtons">
|
| 104 |
+
<button onclick="changeCategory('๋ชจ๋')" id="btn-all" class="active">๋ชจ๋ ๋ณด๊ธฐ</button>
|
| 105 |
+
</div>
|
| 106 |
+
|
| 107 |
+
<div class="table-wrapper">
|
| 108 |
+
<table>
|
| 109 |
+
<thead>
|
| 110 |
+
<tr>
|
| 111 |
+
<th style="width: 30%;">๋จ์ด</th>
|
| 112 |
+
<th style="width: 40%;">์๋ฏธ</th>
|
| 113 |
+
<th style="width: 30%;">๋ถ๋ฅ</th>
|
| 114 |
+
</tr>
|
| 115 |
+
</thead>
|
| 116 |
+
<tbody id="dictBody"></tbody>
|
| 117 |
+
</table>
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
<script>
|
| 121 |
+
let conlangData = {};
|
| 122 |
+
let currentCategory = '๋ชจ๋';
|
| 123 |
+
|
| 124 |
+
// 1. JSON ๋ก๋
|
| 125 |
+
fetch('Conlang_1.json')
|
| 126 |
+
.then(res => res.json())
|
| 127 |
+
.then(data => {
|
| 128 |
+
conlangData = data;
|
| 129 |
+
initButtons();
|
| 130 |
+
renderTable();
|
| 131 |
+
});
|
| 132 |
+
|
| 133 |
+
function initButtons() {
|
| 134 |
+
const container = document.getElementById('categoryButtons');
|
| 135 |
+
Object.keys(conlangData).forEach(key => {
|
| 136 |
+
if (key === "์ค์ ") return;
|
| 137 |
+
const btn = document.createElement('button');
|
| 138 |
+
btn.innerText = key;
|
| 139 |
+
btn.onclick = (e) => {
|
| 140 |
+
document.querySelectorAll('button').forEach(b => b.classList.remove('active'));
|
| 141 |
+
e.target.classList.add('active');
|
| 142 |
+
currentCategory = key;
|
| 143 |
+
renderTable();
|
| 144 |
+
};
|
| 145 |
+
container.appendChild(btn);
|
| 146 |
+
});
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
// ๊ฒ์ ๋ฐ ํํฐ๋ง ํต์ฌ ํจ์
|
| 150 |
+
function renderTable() {
|
| 151 |
+
const body = document.getElementById('dictBody');
|
| 152 |
+
const searchTerm = document.getElementById('searchInput').value.toLowerCase();
|
| 153 |
+
body.innerHTML = '';
|
| 154 |
+
|
| 155 |
+
const targets = currentCategory === '๋ชจ๋'
|
| 156 |
+
? Object.keys(conlangData).filter(k => k !== "์ค์ ")
|
| 157 |
+
: [currentCategory];
|
| 158 |
+
|
| 159 |
+
targets.forEach(cat => {
|
| 160 |
+
traverse(conlangData[cat], cat, searchTerm);
|
| 161 |
+
});
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
function traverse(obj, path, search) {
|
| 165 |
+
for (const key in obj) {
|
| 166 |
+
if (typeof obj[key] === 'string' || obj[key].hasOwnProperty('๋ป')) {
|
| 167 |
+
const word = key;
|
| 168 |
+
const meaning = typeof obj[key] === 'string' ? obj[key] : obj[key].๋ป;
|
| 169 |
+
|
| 170 |
+
// ๊ฒ์์ด ํํฐ๋ง
|
| 171 |
+
if (word.toLowerCase().includes(search) || meaning.toLowerCase().includes(search)) {
|
| 172 |
+
addRow(word, meaning, path);
|
| 173 |
+
}
|
| 174 |
+
} else if (typeof obj[key] === 'object' && key !== "๋ณํ") {
|
| 175 |
+
traverse(obj[key], `${path} > ${key}`, search);
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
function addRow(word, meaning, path) {
|
| 181 |
+
const body = document.getElementById('dictBody');
|
| 182 |
+
const row = body.insertRow();
|
| 183 |
+
row.innerHTML = `
|
| 184 |
+
<td class="word-cell">${word}</td>
|
| 185 |
+
<td>${meaning}</td>
|
| 186 |
+
<td class="path-cell">${path}</td>
|
| 187 |
+
`;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
function filterData() {
|
| 191 |
+
renderTable();
|
| 192 |
+
}
|
| 193 |
+
</script>
|
| 194 |
+
|
| 195 |
+
</body>
|
| 196 |
</html>
|