OpenLab-NLP commited on
Commit
5d5546a
ยท
verified ยท
1 Parent(s): 76441ae

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +81 -155
index.html CHANGED
@@ -11,60 +11,28 @@
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
- nav {
25
- position: sticky; top: 0; background: rgba(249, 247, 242, 0.9);
26
- backdrop-filter: blur(10px); padding: 20px; text-align: center;
27
- border-bottom: 1px solid var(--border-color); z-index: 100;
28
- }
29
- nav a { margin: 0 15px; text-decoration: none; color: var(--primary-color); font-weight: 500; font-size: 0.9rem; transition: 0.2s; cursor: pointer; }
30
- nav a:hover { color: var(--accent-color); }
31
-
32
- header { text-align: center; padding: 60px 20px; }
33
  h1 { font-weight: 300; letter-spacing: 8px; color: var(--accent-color); margin: 0; }
34
- .sub-title { font-size: 0.9rem; color: #999; margin-top: 10px; }
35
 
36
- .container { max-width: 1000px; margin: 0 auto; padding: 0 20px 100px; }
37
  section { display: none; }
38
- section.active { display: block; animation: fadeIn 0.5s; }
39
-
40
- @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
41
-
42
- /* ์‚ฌ์ „(DICTIONARY) ์Šคํƒ€์ผ */
43
- .search-container { margin-bottom: 30px; display: flex; gap: 10px; }
44
- input[type="text"] { flex: 1; padding: 12px 24px; border: 1px solid var(--border-color); border-radius: 30px; outline: none; font-size: 1rem; }
45
-
46
- .table-wrapper { background: var(--card-bg); border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
47
- table { width: 100%; border-collapse: collapse; table-layout: fixed; }
48
- th, td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #f1f1f1; }
49
- th { background: #f1eee6; font-size: 0.9rem; color: #777; font-weight: 500; }
50
-
51
  .word-cell { font-weight: bold; color: var(--accent-color); width: 25%; }
52
- .meaning-cell { width: 45%; }
53
- .eng-cell { width: 30%; font-size: 0.85rem; color: #999; font-style: italic; }
54
-
55
- .variation-row { background-color: var(--variation-bg); }
56
- .variation-mark { color: #ccc; margin-right: 8px; }
57
-
58
- /* ๋ฌธ๋ฒ• & ์•„์นด์ด๋ธŒ ์Šคํƒ€์ผ ๋™์ผ */
59
- .card { background: var(--card-bg); padding: 40px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.03); margin-bottom: 20px; }
60
- .archive-layout { display: flex; gap: 30px; }
61
- .story-list { width: 250px; flex-shrink: 0; }
62
- .story-item { padding: 15px; background: var(--card-bg); margin-bottom: 10px; border-radius: 10px; cursor: pointer; border: 1px solid var(--border-color); font-size: 0.9rem; }
63
- .story-item.active { border-color: var(--accent-color); color: var(--accent-color); background: #fdfcf9; }
64
- .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; }
65
- .story-line { margin-bottom: 25px; }
66
- .huiucl-text { font-size: 1.2rem; color: var(--accent-color); font-weight: 600; margin-bottom: 5px; }
67
- .korean-text { font-size: 1rem; color: #777; border-left: 2px solid var(--border-color); padding-left: 15px; }
68
  </style>
69
  </head>
70
  <body>
@@ -72,170 +40,128 @@
72
  <nav>
73
  <a onclick="showSection('dictionary')">DICTIONARY</a>
74
  <a onclick="showSection('grammar')">GRAMMAR</a>
75
- <a onclick="showSection('archive')">ARCHIVE</a>
76
  </nav>
77
 
78
  <header>
79
  <h1>HUIUCL</h1>
80
- <div class="sub-title">v2.0 Revision - Online Dictionary & Archive</div>
81
  </header>
82
 
83
  <div class="container">
84
  <section id="dictionary" class="active">
85
- <div class="search-container">
86
- <input type="text" id="searchInput" placeholder="HUIUCL ๋‹จ์–ด, ํ•œ๊ตญ์–ด ๋œป, ๋˜๋Š” ์˜๋ฌธ ์˜๋ฏธ ๊ฒ€์ƒ‰..." onkeyup="renderTable()">
87
- </div>
88
  <div class="table-wrapper">
89
  <table>
90
  <thead>
91
  <tr>
92
- <th style="width:25%">๋‹จ์–ด (Word)</th>
93
- <th style="width:45%">์˜๋ฏธ (Meaning)</th>
94
- <th style="width:30%">English</th>
95
  </tr>
96
  </thead>
97
- <tbody id="dictBody">
98
- </tbody>
99
  </table>
100
  </div>
101
  </section>
102
 
103
  <section id="grammar">
104
- <div class="card">
105
- <h2 style="font-weight: 300;">Grammar & Phonology</h2>
106
- <div id="grammarContent">
107
- </div>
108
- </div>
109
- </section>
110
-
111
- <section id="archive">
112
- <div class="archive-layout">
113
- <div class="story-list">
114
- <div class="story-item active" onclick="loadStory(0, this)">01. ํƒ„์ƒ (Clama)</div>
115
- <div class="story-item" onclick="loadStory(1, this)">02. ์ค€๋น„ ์ค‘...</div>
116
- </div>
117
- <div class="story-content" id="storyViewer"></div>
118
  </div>
119
  </section>
120
  </div>
121
 
122
  <script>
123
- let conlangData = {};
124
 
125
  function showSection(id) {
126
  document.querySelectorAll('section').forEach(s => s.classList.remove('active'));
127
  document.getElementById(id).classList.add('active');
128
  }
129
 
130
- // ์ดˆ๊ธฐ ๋ฐ์ดํ„ฐ ๋กœ๋“œ
131
  window.onload = () => {
132
  fetch('Huiucl.json')
133
  .then(res => res.json())
134
  .then(data => {
135
- conlangData = data;
136
- loadGrammar();
137
  renderTable();
138
- loadStory(0);
139
  })
140
- .catch(err => console.error("๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค. JSON ํŒŒ์ผ๋ช…์„ ํ™•์ธํ•˜์„ธ์š”.", err));
 
 
141
  };
142
 
143
- // ์‚ฌ์ „ ๋ Œ๋”๋ง ๋กœ์ง
144
  function renderTable() {
 
145
  const body = document.getElementById('dictBody');
146
- const search = document.getElementById('searchInput').value.toLowerCase();
147
  body.innerHTML = '';
148
 
149
- // Settings, Pronouns ๋“ฑ์„ ์ œ์™ธํ•œ ์‹ค์ œ ๋‹จ์–ด๋“ค ์ˆœํšŒ
150
- const skipKeys = ["Settings", "Pronouns"];
151
-
152
- for (const word in conlangData) {
153
- if (skipKeys.includes(word)) continue;
154
-
155
- const entry = conlangData[word];
156
- const kor = entry.meaning_ko || "";
157
- const eng = entry.meaning_en || "";
158
-
159
- // ๊ฒ€์ƒ‰ ํ•„ํ„ฐ๋ง (ํ‘œ์ œ์–ด ๋˜๋Š” ์˜๋ฏธ)
160
- if (word.toLowerCase().includes(search) || kor.includes(search) || eng.toLowerCase().includes(search)) {
161
- addRow(word, kor, eng, false);
162
- }
 
163
 
164
- // ํŒŒ์ƒ์–ด(derivations) ์ฒ˜๋ฆฌ
165
- if (entry.derivations) {
166
- for (const dWord in entry.derivations) {
167
- const dMeaning = entry.derivations[dWord];
168
- // ํŒŒ์ƒ์–ด๋„ ๊ฒ€์ƒ‰ ๋Œ€์ƒ์— ํฌํ•จ
169
- if (dWord.toLowerCase().includes(search) || dMeaning.toLowerCase().includes(search)) {
170
- addRow(dWord, dMeaning, "-", true);
 
171
  }
 
 
 
172
  }
173
  }
174
  }
 
 
175
  }
176
 
177
- function addRow(word, meaning, eng, isVar) {
178
  const body = document.getElementById('dictBody');
179
  const row = body.insertRow();
180
- if (isVar) row.className = "variation-row";
181
-
182
  row.innerHTML = `
183
- <td class="word-cell">${isVar ? '<span class="variation-mark">โ†ณ</span>' : ''}${word}</td>
184
- <td class="meaning-cell">${meaning}</td>
185
- <td class="eng-cell">${eng}</td>
186
  `;
187
  }
188
 
189
- // ๋ฌธ๋ฒ• ๋ฐ์ดํ„ฐ ๋กœ๋“œ
190
- function loadGrammar() {
191
- const container = document.getElementById('grammarContent');
192
- if (!conlangData.Settings) return;
193
-
194
- const set = conlangData.Settings;
195
- let html = `
196
- <h3>Syntax (์–ด์ˆœ)</h3>
197
- <p>๊ธฐ๋ณธ ์–ด์ˆœ: ${set.Syntax.Word_Order.join(' / ')}</p>
198
- <p>${set.Syntax.Imperative["2"]}</p>
199
- <hr style="border:0; border-top:1px solid #eee; margin:20px 0;">
200
- <h3>Phonology (์Œ์„ฑ)</h3>
201
- <p><strong>Vowels:</strong> ${Object.keys(set.Phonology.Vowels).join(', ')}</p>
202
- <p><strong>Consonants:</strong> ${Object.keys(set.Phonology.Consonants).join(', ')} (c=[k'], t=[t'])</p>
203
- `;
204
- container.innerHTML = html;
205
- }
206
-
207
- // ์•„์นด์ด๋ธŒ ๋กœ์ง
208
- const stories = [
209
- {
210
- title: "๊ธฐ๋ก 01: ํƒ„์ƒ",
211
- lines: [
212
- { h: "unal cinicl si hamolhilasna clamam..", k: "์šฐ์ฃผ์™€ ํ•˜๋ชฐํžˆ๋ผ์Šค๋‚˜๊ฐ€ ํƒœ์–ด๋‚ฌ๋‹ค." },
213
- { h: "su u clum hoct.", k: "๊ทธ๋Š” ์‹ ์ด์—ˆ๋‹ค." }
214
- ]
215
- },
216
- {
217
- title: "๊ธฐ๋ก 02: ์ค€๋น„ ์ค‘",
218
- lines: [{ h: "...", k: "๋‹ค์Œ ๋ฐ์ดํ„ฐ ์—…๋ฐ์ดํŠธ๋ฅผ ๊ธฐ๋‹ค๋ ค์ฃผ์„ธ์š”." }]
219
  }
220
- ];
221
-
222
- function loadStory(index, el) {
223
- if(el) {
224
- document.querySelectorAll('.story-item').forEach(item => item.classList.remove('active'));
225
- el.classList.add('active');
226
- }
227
- const story = stories[index];
228
- let html = `<h2 style="font-weight:300; margin-bottom:40px; text-align:center; color:var(--accent-color);">${story.title}</h2>`;
229
- story.lines.forEach(line => {
230
- html += `
231
- <div class="story-line">
232
- <div class="huiucl-text">${line.h}</div>
233
- <div class="korean-text">${line.k}</div>
234
- </div>`;
235
- });
236
- document.getElementById('storyViewer').innerHTML = html;
237
  }
238
  </script>
239
-
240
  </body>
241
  </html>
 
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; 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: 20px; }
23
  section { display: none; }
24
+ section.active { display: block; }
25
+
26
+ /* ์‚ฌ์ „ ์Šคํƒ€์ผ */
27
+ .search-box { width: 100%; padding: 15px 25px; border: 1px solid var(--border-color); border-radius: 30px; font-size: 1rem; margin-bottom: 25px; box-sizing: border-box; outline: none; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
28
+ .table-wrapper { background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
29
+ table { width: 100%; border-collapse: collapse; }
30
+ th, td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #eee; }
31
+ th { background: #f1eee6; color: #777; font-size: 0.9rem; }
 
 
 
 
 
32
  .word-cell { font-weight: bold; color: var(--accent-color); width: 25%; }
33
+ .variation-row { background: #faf9f6; font-size: 0.95rem; }
34
+
35
+ .card { background: white; padding: 30px; border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.02); }
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  </style>
37
  </head>
38
  <body>
 
40
  <nav>
41
  <a onclick="showSection('dictionary')">DICTIONARY</a>
42
  <a onclick="showSection('grammar')">GRAMMAR</a>
 
43
  </nav>
44
 
45
  <header>
46
  <h1>HUIUCL</h1>
47
+ <div style="color:#999; font-size:0.8rem; margin-top:5px;">SYSTEM ARCHIVE v2.0</div>
48
  </header>
49
 
50
  <div class="container">
51
  <section id="dictionary" class="active">
52
+ <input type="text" id="searchInput" class="search-box" placeholder="๋‹จ์–ด, ๋œป, ํŒŒ์ƒ์–ด๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”..." oninput="renderTable()">
 
 
53
  <div class="table-wrapper">
54
  <table>
55
  <thead>
56
  <tr>
57
+ <th>๋‹จ์–ด</th>
58
+ <th>์˜๋ฏธ (KO)</th>
59
+ <th>Meaning (EN)</th>
60
  </tr>
61
  </thead>
62
+ <tbody id="dictBody"></tbody>
 
63
  </table>
64
  </div>
65
  </section>
66
 
67
  <section id="grammar">
68
+ <div class="card" id="grammarBox">
69
+ <h2>Grammar Settings</h2>
70
+ <div id="settingsContent">๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ค‘...</div>
 
 
 
 
 
 
 
 
 
 
 
71
  </div>
72
  </section>
73
  </div>
74
 
75
  <script>
76
+ let rawData = {};
77
 
78
  function showSection(id) {
79
  document.querySelectorAll('section').forEach(s => s.classList.remove('active'));
80
  document.getElementById(id).classList.add('active');
81
  }
82
 
83
+ // JSON ๋กœ๋“œ
84
  window.onload = () => {
85
  fetch('Huiucl.json')
86
  .then(res => res.json())
87
  .then(data => {
88
+ rawData = data;
 
89
  renderTable();
90
+ renderGrammar();
91
  })
92
+ .catch(err => {
93
+ document.getElementById('dictBody').innerHTML = '<tr><td colspan="3" style="text-align:center; padding:50px;">JSON ํŒŒ์ผ์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. (Huiucl.json ํ™•์ธ)</td></tr>';
94
+ });
95
  };
96
 
 
97
  function renderTable() {
98
+ const query = document.getElementById('searchInput').value.toLowerCase();
99
  const body = document.getElementById('dictBody');
 
100
  body.innerHTML = '';
101
 
102
+ // ์žฌ๊ท€์ ์œผ๋กœ ๋‹จ์–ด ๋ฐ์ดํ„ฐ๋ฅผ ์ฐพ๋Š” ํ•จ์ˆ˜
103
+ function findEntries(obj) {
104
+ for (let key in obj) {
105
+ const item = obj[key];
106
+
107
+ // ๋‹จ์–ด ์—”ํŠธ๋ฆฌ ์กฐ๊ฑด: meaning_ko ํ•„๋“œ๊ฐ€ ์žˆ์„ ๋•Œ
108
+ if (item && typeof item === 'object' && item.meaning_ko) {
109
+ const word = key;
110
+ const kor = item.meaning_ko;
111
+ const eng = item.meaning_en || '';
112
+
113
+ // ๊ฒ€์ƒ‰ ์กฐ๊ฑด ๋Œ€์กฐ
114
+ if (word.toLowerCase().includes(query) || kor.includes(query) || eng.toLowerCase().includes(query)) {
115
+ appendRow(word, kor, eng, false);
116
+ }
117
 
118
+ // ํŒŒ์ƒ์–ด(derivations) ์ˆœํšŒ
119
+ if (item.derivations) {
120
+ for (let dKey in item.derivations) {
121
+ const dMean = item.derivations[dKey];
122
+ if (dKey.toLowerCase().includes(query) || dMean.toLowerCase().includes(query)) {
123
+ appendRow(dKey, dMean, '-', true);
124
+ }
125
+ }
126
  }
127
+ } else if (item && typeof item === 'object' && key !== "Settings") {
128
+ // ๋” ๊นŠ์€ ๊ณ„์ธต์ด ์žˆ๋‹ค๋ฉด ๋‹ค์‹œ ํƒ์ƒ‰
129
+ findEntries(item);
130
  }
131
  }
132
  }
133
+
134
+ findEntries(rawData);
135
  }
136
 
137
+ function appendRow(word, kor, eng, isSub) {
138
  const body = document.getElementById('dictBody');
139
  const row = body.insertRow();
140
+ if (isSub) row.className = 'variation-row';
141
+
142
  row.innerHTML = `
143
+ <td class="word-cell">${isSub ? 'โ”” ' : ''}${word}</td>
144
+ <td>${kor}</td>
145
+ <td style="color:#aaa; font-size:0.85rem;">${eng}</td>
146
  `;
147
  }
148
 
149
+ function renderGrammar() {
150
+ const target = document.getElementById('settingsContent');
151
+ if (!rawData.Settings) {
152
+ target.innerHTML = "์„ค์ • ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.";
153
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
+ const s = rawData.Settings;
156
+ target.innerHTML = `
157
+ <h3>Phonology</h3>
158
+ <p>Vowels: ${Object.keys(s.Phonology.Vowels).join(', ')}</p>
159
+ <p>Consonants: ${Object.keys(s.Phonology.Consonants).join(', ')}</p>
160
+ <h3>Syntax</h3>
161
+ <p>Order: ${s.Syntax.Word_Order.join(', ')}</p>
162
+ <p>${s.Syntax.Imperative["2"]}</p>
163
+ `;
 
 
 
 
 
 
 
 
164
  }
165
  </script>
 
166
  </body>
167
  </html>