-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformulas.html
More file actions
309 lines (283 loc) · 10 KB
/
Copy pathformulas.html
File metadata and controls
309 lines (283 loc) · 10 KB
1
2
3
4
5
6
7
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<!DOCTYPE html>
<html lang="th">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AISA Formula Cheat Sheet — สูตรทั้งหมด 11 หมวด</title>
<link rel="icon" type="image/svg+xml" href="assets/favicon.svg?v=2">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Cormorant+Garamond:wght@500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/deck-enhance.css">
<style>
:root {
--bg: #ebe6d9;
--card-front: #fbf8f0;
--card-back: #1a1f36;
--ink: #1a1f36;
--ink-soft: #5a5f75;
--ink-faded: #8a8d9e;
--accent: #b8860b;
--accent-deep: #8b6508;
--seal: #8b0000;
--divider: #c9c3b0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
background: var(--bg);
color: var(--ink);
font-family: 'IBM Plex Sans Thai', sans-serif;
min-height: 100vh;
}
body {
background-image:
radial-gradient(circle at 20% 30%, rgba(184, 134, 11, 0.04) 0%, transparent 40%),
radial-gradient(circle at 80% 70%, rgba(139, 0, 0, 0.03) 0%, transparent 40%);
}
body::before {
content: ''; position: fixed; inset: 0; pointer-events: none; opacity: 0.35;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
mix-blend-mode: multiply;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 40px 24px 60px;
position: relative;
}
.back-link {
display: inline-flex; align-items: center; gap: 6px;
font-family: 'IBM Plex Mono', monospace;
font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
color: var(--ink-faded); text-decoration: none; margin-bottom: 24px;
transition: color 0.2s;
}
.back-link:hover { color: var(--accent-deep); }
header {
text-align: center; margin-bottom: 32px; padding-bottom: 24px;
border-bottom: 1px solid var(--divider); position: relative;
}
header::after {
content: '❦'; position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%);
background: var(--bg); padding: 0 16px; color: var(--accent); font-size: 18px;
}
.eyebrow {
font-family: 'IBM Plex Mono', monospace;
font-size: 11px; font-weight: 500;
letter-spacing: 0.28em; text-transform: uppercase;
color: var(--accent-deep); margin-bottom: 12px;
}
h1 {
font-family: 'IBM Plex Sans Thai', sans-serif;
font-weight: 600;
font-size: clamp(28px, 4vw, 36px);
margin-bottom: 6px;
}
.subtitle {
color: var(--ink-soft); font-size: 14px;
max-width: 560px; margin: 0 auto; line-height: 1.6;
}
.toolbar {
display: flex; justify-content: center; gap: 8px; margin-bottom: 24px;
flex-wrap: wrap;
}
.toolbar input {
flex: 1; max-width: 360px;
padding: 10px 16px;
font-family: inherit; font-size: 13px;
color: var(--ink); background: var(--card-front);
border: 1px solid var(--divider); border-radius: 999px;
outline: none; transition: border-color 0.2s;
}
.toolbar input:focus { border-color: var(--accent); }
.toolbar button {
font-family: inherit; font-size: 13px; font-weight: 500;
padding: 10px 18px; background: transparent; color: var(--ink-soft);
border: 1px solid var(--divider); border-radius: 999px; cursor: pointer;
transition: all 0.2s;
}
.toolbar button:hover { border-color: var(--accent); color: var(--ink); }
.toolbar button.active { background: var(--ink); color: var(--card-front); border-color: var(--ink); }
.deck-section {
margin-bottom: 40px;
}
.deck-section h2 {
font-family: 'IBM Plex Sans Thai', sans-serif;
font-size: 18px; font-weight: 600;
padding: 8px 14px;
background: var(--card-back);
color: var(--card-front);
border-radius: 4px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
}
.deck-section h2 .num {
color: var(--accent);
font-family: 'Cormorant Garamond', serif;
font-size: 24px;
font-weight: 600;
}
.deck-section h2 .en {
font-family: 'Cormorant Garamond', serif;
font-style: italic;
color: var(--accent);
font-size: 14px;
font-weight: 500;
margin-left: 8px;
}
.formula-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 14px;
}
.formula-card {
background: var(--card-front);
border: 1px solid rgba(26, 31, 54, 0.08);
border-radius: 4px;
padding: 16px 18px;
box-shadow: 0 4px 12px rgba(26, 31, 54, 0.04);
transition: transform 0.2s, box-shadow 0.2s;
}
.formula-card:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(26, 31, 54, 0.08);
}
.fc-meta {
font-family: 'IBM Plex Mono', monospace;
font-size: 9px;
letter-spacing: 0.22em;
text-transform: uppercase;
color: var(--ink-faded);
margin-bottom: 6px;
}
.fc-meta .num {
color: var(--accent-deep);
font-weight: 600;
}
.fc-q {
font-size: 13px;
font-weight: 600;
color: var(--ink);
margin-bottom: 8px;
line-height: 1.4;
}
.fc-a {
font-size: 12px;
color: var(--ink-soft);
line-height: 1.6;
}
.fc-a strong { color: var(--accent-deep); font-weight: 600; }
.fc-a .highlight-box {
display: inline-block;
margin-top: 6px;
padding: 6px 10px;
border: 1px solid rgba(184, 134, 11, 0.4);
border-radius: 2px;
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
letter-spacing: 0.05em;
color: var(--accent);
line-height: 1.6;
}
.empty {
text-align: center;
padding: 80px 20px;
color: var(--ink-faded);
font-size: 14px;
}
/* Print */
@media print {
body::before, .toolbar, .back-link, .dx-toolbar { display: none !important; }
body { background: white; }
.formula-card { break-inside: avoid; box-shadow: none; }
.deck-section { break-after: page; }
}
@media (max-width: 640px) {
.container { padding: 24px 16px 40px; }
.formula-grid { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<div class="container">
<a href="index.html" class="back-link">← กลับหน้าหลัก</a>
<header>
<div class="eyebrow">AISA · Formula Cheat Sheet</div>
<h1>สูตรและตัวเลขสำคัญ</h1>
<p class="subtitle">รวมสูตร + worked example + เกณฑ์ตัวเลขทั้ง 11 หมวด<br>เหมาะสำหรับทบทวนก่อนสอบ 30 นาที · พิมพ์ได้</p>
</header>
<div class="toolbar">
<input type="search" id="search" placeholder="ค้นหาสูตร...">
<button class="filter-btn active" data-filter="all">ทุกหมวด</button>
<button class="filter-btn" data-filter="weak">จุดอ่อน</button>
<button onclick="window.print()">🖨️ พิมพ์</button>
</div>
<div id="content"></div>
</div>
<script>
let DATA = null;
fetch('assets/all-cards.json').then(r => r.json()).then(data => {
DATA = data;
render();
}).catch(() => {
document.getElementById('content').innerHTML = '<div class="empty">โหลดข้อมูลไม่สำเร็จ — ลองรีเฟรช</div>';
});
function render(filter = 'all', query = '') {
if (!DATA) return;
const root = document.getElementById('content');
root.innerHTML = '';
const q = query.trim().toLowerCase();
Object.entries(DATA.decks).forEach(([deckId, info]) => {
// skip if filter "weak" and score >= 55
if (filter === 'weak' && info.score >= 55) return;
const formulaCards = info.cards.filter(c => c.category === 'formula');
const visible = q
? formulaCards.filter(c =>
c.question.toLowerCase().includes(q) ||
c.answer.toLowerCase().includes(q) ||
c.categoryLabel.toLowerCase().includes(q))
: formulaCards;
if (visible.length === 0) return;
const section = document.createElement('section');
section.className = 'deck-section';
section.innerHTML = `
<h2>
<span><span class="num">${deckId.split('-')[0]}</span> · ${info.titleTH}<span class="en">${info.title}</span></span>
<span style="font-size: 11px; font-weight: 400; color: rgba(251,248,240,0.5); font-family: 'IBM Plex Mono', monospace;">${visible.length} formulas</span>
</h2>
<div class="formula-grid"></div>
`;
const grid = section.querySelector('.formula-grid');
visible.forEach(c => {
const card = document.createElement('div');
card.className = 'formula-card';
card.innerHTML = `
<div class="fc-meta"><span class="num">${c.number}</span> · ${c.categoryLabel}</div>
<div class="fc-q">${c.question}</div>
<div class="fc-a">${c.answer}</div>
`;
grid.appendChild(card);
});
root.appendChild(section);
});
if (root.children.length === 0) {
root.innerHTML = '<div class="empty">ไม่พบสูตรที่ตรงกับการค้นหา</div>';
}
}
document.getElementById('search').addEventListener('input', e => {
const f = document.querySelector('.filter-btn.active').dataset.filter;
render(f, e.target.value);
});
document.querySelectorAll('.filter-btn').forEach(btn => {
btn.addEventListener('click', () => {
document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
render(btn.dataset.filter, document.getElementById('search').value);
});
});
</script>
<script src="assets/deck-enhance.js" defer></script>
</body>
</html>