kritsanan commited on
Commit
718c240
·
verified ·
1 Parent(s): 123fa34

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +555 -339
index.html CHANGED
@@ -2,8 +2,8 @@
2
  <html lang="th">
3
  <head>
4
  <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
6
- <title>Mobile War Room: ธนอนันต์ (เขต 6)</title>
7
 
8
  <!-- Tailwind CSS -->
9
  <script src="https://cdn.tailwindcss.com"></script>
@@ -23,437 +23,653 @@
23
  <!-- Font: Noto Sans Thai -->
24
  <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;600;800&display=swap" rel="stylesheet">
25
 
26
- <!-- Icons -->
27
- <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
 
 
 
28
 
29
  <style>
30
  body {
31
  font-family: 'Noto Sans Thai', sans-serif;
32
- background-color: #F3F4F6;
33
  color: #1F2937;
34
- padding-bottom: 80px; /* Space for bottom nav */
35
- overscroll-behavior-y: none; /* Prevent pull-to-refresh on mobile if desired */
36
  }
37
 
38
- /* Hide scrollbar for clean UI */
39
- ::-webkit-scrollbar {
40
- width: 0px;
41
- background: transparent;
 
 
 
 
42
  }
43
 
44
- .tab-content {
45
- display: none;
46
- animation: fadeIn 0.3s ease-in-out;
47
- }
48
-
49
- .tab-content.active {
50
- display: block;
51
- }
52
-
53
- @keyframes fadeIn {
54
- from { opacity: 0; transform: translateY(10px); }
55
- to { opacity: 1; transform: translateY(0); }
56
  }
57
 
58
- .nav-item.active {
59
- color: #6A0DAD;
60
- font-weight: bold;
 
 
 
 
61
  }
62
 
63
- .nav-item.active i {
64
- transform: scale(1.2);
65
- transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
66
- }
67
-
68
- .card {
69
- background: white;
70
- border-radius: 1rem;
71
- box-shadow: 0 2px 5px rgba(0,0,0,0.05);
72
- padding: 1rem;
73
- margin-bottom: 1rem;
74
  }
75
 
76
- .ai-tool-header {
77
- cursor: pointer;
78
- user-select: none;
 
 
 
 
79
  }
80
 
81
- /* Custom Loader */
82
  .loader {
83
- border: 3px solid #f3f3f3;
84
- border-top: 3px solid #6A0DAD;
85
  border-radius: 50%;
86
- width: 20px;
87
- height: 20px;
88
  animation: spin 1s linear infinite;
 
 
 
 
 
 
89
  }
90
- @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
 
 
 
 
91
  </style>
92
  </head>
93
- <body>
94
-
95
- <!-- Top Bar -->
96
- <header class="fixed top-0 left-0 right-0 bg-gradient-to-r from-purple-800 to-indigo-900 text-white z-50 shadow-md rounded-b-xl">
97
- <div class="flex justify-between items-center px-4 py-3">
98
- <div class="flex items-center gap-3">
99
- <div class="w-10 h-10 bg-white rounded-full flex items-center justify-center text-purple-800 font-bold border-2 border-yellow-400">
100
- ธ.
101
- </div>
102
- <div>
103
- <h1 class="text-lg font-bold leading-tight">ธนอนันต์ เมนะสวัสดิ์</h1>
104
- <p class="text-xs text-purple-200">อุดรธานี เขต 6 | พรรคกล้าธรรม</p>
105
- </div>
106
- </div>
107
- <div class="bg-yellow-400 text-purple-900 text-xs font-bold px-2 py-1 rounded">
108
- D-90
109
  </div>
 
 
 
 
 
 
110
  </div>
111
  </header>
112
 
113
- <!-- Spacer for Top Bar -->
114
- <div class="h-20"></div>
115
 
116
- <!-- MAIN CONTENT -->
117
- <main class="px-4">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
 
119
- <!-- TAB 1: DASHBOARD (HOME) -->
120
- <div id="tab-home" class="tab-content active">
121
- <!-- Quick Stats -->
122
- <div class="grid grid-cols-2 gap-3 mb-4">
123
- <div class="card bg-purple-50 border-l-4 border-purple-600 !mb-0">
124
- <p class="text-xs text-gray-500 uppercase">เป้าหมาย</p>
125
- <p class="text-2xl font-bold text-purple-800">42k</p>
126
- </div>
127
- <div class="card bg-yellow-50 border-l-4 border-yellow-500 !mb-0">
128
- <p class="text-xs text-gray-500 uppercase">New Gen</p>
129
- <p class="text-2xl font-bold text-yellow-600">35%</p>
130
  </div>
 
131
  </div>
132
 
133
- <!-- Roadmap -->
134
- <div class="card">
135
- <h3 class="font-bold text-gray-800 mb-3 flex items-center gap-2">
136
- <i class="fas fa-map-signs text-purple-600"></i> Roadmap 90 วัน
137
- </h3>
138
- <div class="relative pl-4 border-l-2 border-gray-200 space-y-6">
139
- <div class="relative">
140
- <div class="absolute -left-[21px] top-1 w-3 h-3 bg-gray-400 rounded-full border-2 border-white"></div>
141
- <h4 class="text-sm font-bold text-gray-700">เดือนที่ 1: ปลุกยักษ์</h4>
142
- <p class="text-xs text-gray-500">เปิดตัวเพจ, ยิง Ads, ตั้งศูนย์ประสานงาน</p>
 
 
 
 
 
143
  </div>
144
- <div class="relative">
145
- <div class="absolute -left-[21px] top-1 w-3 h-3 bg-purple-500 rounded-full border-2 border-white"></div>
146
- <h4 class="text-sm font-bold text-purple-700">เดือนที่ 2: กล้าชน</h4>
147
- <p class="text-xs text-gray-500">ปราศรัยย่อย 20 จุด, TikTok Challenge</p>
 
 
 
 
 
 
 
148
  </div>
149
- <div class="relative">
150
- <div class="absolute -left-[21px] top-1 w-3 h-3 bg-red-500 rounded-full border-2 border-white animate-pulse"></div>
151
- <h4 class="text-sm font-bold text-red-600">เดือนที่ 3: ปิดกล่อง</h4>
152
- <p class="text-xs text-gray-500">ปราศรัยใหญ่, คลิปไวรัลโค้งสุดท้าย</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  </div>
154
  </div>
155
  </div>
156
-
157
- <!-- Recent Activity / News Feed Mockup -->
158
- <div class="card">
159
- <h3 class="font-bold text-gray-800 mb-3">📢 อัปเดตล่าสุด</h3>
160
- <div class="space-y-3">
161
- <div class="flex gap-3 items-center border-b pb-2 last:border-0">
162
- <div class="w-8 h-8 rounded bg-blue-100 text-blue-600 flex items-center justify-center text-xs"><i class="fab fa-facebook-f"></i></div>
163
- <div class="flex-1">
164
- <p class="text-xs font-semibold">โพสต์: "ลงพื้นที่หนองหาน..."</p>
165
- <p class="text-[10px] text-gray-400">2 ชม. ที่แล้ว • 1.2k Likes</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  </div>
 
 
 
167
  </div>
168
- <div class="flex gap-3 items-center border-b pb-2 last:border-0">
169
- <div class="w-8 h-8 rounded bg-black text-white flex items-center justify-center text-xs"><i class="fab fa-tiktok"></i></div>
170
- <div class="flex-1">
171
- <p class="text-xs font-semibold">คลิป: "แก้ท่อแตกไว..."</p>
172
- <p class="text-[10px] text-gray-400">5 ชม. ที่แล้ว • 5.4k Views</p>
 
 
 
 
 
 
173
  </div>
 
 
 
174
  </div>
 
175
  </div>
176
  </div>
177
- </div>
178
 
179
- <!-- TAB 2: WAR ROOM (STRATEGY) -->
180
- <div id="tab-warroom" class="tab-content">
181
- <h2 class="text-xl font-bold text-gray-800 mb-4 px-1">📊 ยุทธศาสตร์ดิจิทัล</h2>
182
-
183
- <!-- Voice Share Chart -->
184
- <div class="card">
185
- <h4 class="text-sm font-bold text-gray-600 mb-2 text-center">ส่วนแบ่ง Voice Share</h4>
186
- <div style="height: 200px;">
187
- <canvas id="mobileSocialChart"></canvas>
 
188
  </div>
 
189
  </div>
190
 
191
- <!-- Platform Strategy Carousel-like -->
192
- <div class="space-y-3">
193
- <div class="bg-black text-white p-4 rounded-xl flex items-center gap-4 shadow-lg">
194
- <i class="fab fa-tiktok text-3xl"></i>
195
- <div>
196
- <h5 class="font-bold">TikTok: The Real Udon</h5>
197
- <p class="text-xs text-gray-300">คลิปสั้น 30 วิ, ภาษาอีสาน, #ธนอนันต์จัดให้</p>
198
- </div>
199
- </div>
200
- <div class="bg-green-600 text-white p-4 rounded-xl flex items-center gap-4 shadow-lg">
201
- <i class="fab fa-line text-3xl"></i>
202
- <div>
203
- <h5 class="font-bold">Line OA: Connect</h5>
204
- <p class="text-xs text-green-100">แจ้งข่าวชาวบ้าน, CRM หัวคะแนน</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  </div>
206
  </div>
207
- <div class="bg-blue-600 text-white p-4 rounded-xl flex items-center gap-4 shadow-lg">
208
- <i class="fab fa-facebook text-3xl"></i>
209
- <div>
210
- <h5 class="font-bold">Facebook: Official</h5>
211
- <p class="text-xs text-blue-100">Live งานบุญ, โชว์ผลงาน ก่อน/หลัง</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  </div>
 
213
  </div>
214
- </div>
215
 
216
- <!-- Competitor Radar -->
217
- <div class="card mt-4">
218
- <h4 class="text-sm font-bold text-gray-600 mb-2 text-center">เทียบฟอร์มคู่แข่ง (SWOT)</h4>
219
- <div style="height: 250px;">
220
- <canvas id="mobileRadarChart"></canvas>
221
- </div>
222
  </div>
223
- </div>
224
-
225
- <!-- TAB 3: AI ASSISTANT (TOOLS) -->
226
- <div id="tab-ai" class="tab-content">
227
- <div class="flex items-center justify-between mb-4 px-1">
228
- <h2 class="text-xl font-bold text-gray-800">🤖 AI Partner</h2>
229
- <span class="text-[10px] bg-purple-100 text-purple-700 px-2 py-1 rounded-full border border-purple-200">Gemini Inside</span>
 
 
230
  </div>
231
-
232
- <!-- Tool 1: Caption -->
233
- <div class="card group">
234
- <div class="ai-tool-header flex justify-between items-center" onclick="toggleTool('tool-caption')">
235
- <div class="flex items-center gap-3">
236
- <div class="w-8 h-8 rounded bg-gradient-to-br from-pink-500 to-orange-400 text-white flex items-center justify-center"><i class="fas fa-pen-nib"></i></div>
237
- <h3 class="font-bold text-gray-700">เขียนแคปชั่น</h3>
238
  </div>
239
- <i class="fas fa-chevron-down text-gray-400 transition-transform group-open:rotate-180"></i>
240
  </div>
241
- <div id="tool-caption" class="hidden mt-4 pt-4 border-t">
242
- <input type="text" id="mCaptionTopic" class="w-full text-sm border-gray-300 border rounded-lg p-2 bg-gray-50 mb-2" placeholder="หัวข้อ (เช่น น้ำท่วม)...">
243
- <select id="mCaptionPlatform" class="w-full text-sm border-gray-300 border rounded-lg p-2 bg-gray-50 mb-3">
244
- <option value="TikTok">TikTok (วัยรุ่น)</option>
245
- <option value="Facebook">Facebook (ทางการ)</option>
246
- <option value="Line">Line (ชาวบ้าน)</option>
247
- </select>
248
- <button id="btnMCaption" class="w-full bg-purple-600 text-white rounded-lg py-2 text-sm font-bold shadow hover:bg-purple-700 transition">✨ สร้างทันที</button>
249
- <div id="outMCaption" class="mt-3 p-3 bg-purple-50 rounded-lg text-xs text-gray-700 hidden"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  </div>
251
  </div>
252
-
253
- <!-- Tool 2: Crisis -->
254
- <div class="card group">
255
- <div class="ai-tool-header flex justify-between items-center" onclick="toggleTool('tool-crisis')">
256
- <div class="flex items-center gap-3">
257
- <div class="w-8 h-8 rounded bg-gradient-to-br from-red-600 to-red-400 text-white flex items-center justify-center"><i class="fas fa-shield-alt"></i></div>
258
- <h3 class="font-bold text-gray-700">แก้เกม/ดราม่า</h3>
259
- </div>
260
- <i class="fas fa-chevron-down text-gray-400"></i>
 
 
 
 
 
 
 
261
  </div>
262
- <div id="tool-crisis" class="hidden mt-4 pt-4 border-t">
263
- <textarea id="mCrisisInput" rows="2" class="w-full text-sm border-gray-300 border rounded-lg p-2 bg-gray-50 mb-3" placeholder="เกิดเรื่องอะไรขึ้น?"></textarea>
264
- <button id="btnMCrisis" class="w-full bg-gray-800 text-white rounded-lg py-2 text-sm font-bold shadow hover:bg-gray-900 transition">🛡️ ขอแผนรับมือ</button>
265
- <div id="outMCrisis" class="mt-3 p-3 bg-gray-100 rounded-lg text-xs text-gray-700 hidden"></div>
 
 
 
 
 
 
266
  </div>
267
- </div>
268
-
269
- <!-- Tool 3: Policy Translator -->
270
- <div class="card group">
271
- <div class="ai-tool-header flex justify-between items-center" onclick="toggleTool('tool-policy')">
272
- <div class="flex items-center gap-3">
273
- <div class="w-8 h-8 rounded bg-gradient-to-br from-yellow-500 to-yellow-300 text-white flex items-center justify-center"><i class="fas fa-language"></i></div>
274
- <h3 class="font-bold text-gray-700">แปลนโยบาย</h3>
275
- </div>
276
- <i class="fas fa-chevron-down text-gray-400"></i>
277
- </div>
278
- <div id="tool-policy" class="hidden mt-4 pt-4 border-t">
279
- <textarea id="mPolicyInput" rows="2" class="w-full text-sm border-gray-300 border rounded-lg p-2 bg-gray-50 mb-2" placeholder="นโยบายภาษาราชการ..."></textarea>
280
- <select id="mPolicyTarget" class="w-full text-sm border-gray-300 border rounded-lg p-2 bg-gray-50 mb-3">
281
- <option value="ผู้เฒ่าผู้แก่">คนเฒ่าคนแก่ (อีสาน)</option>
282
- <option value="วัยรุ่น">วัยรุ่น (สั้นๆ)</option>
283
- </select>
284
- <button id="btnMPolicy" class="w-full bg-yellow-500 text-white rounded-lg py-2 text-sm font-bold shadow hover:bg-yellow-600 transition">🗣️ แปลงภาษา</button>
285
- <div id="outMPolicy" class="mt-3 p-3 bg-yellow-50 rounded-lg text-xs text-gray-800 hidden border border-yellow-200"></div>
286
  </div>
287
  </div>
 
288
 
289
- </div>
 
 
 
 
290
 
291
  </main>
292
 
293
- <!-- Bottom Navigation -->
294
- <nav class="fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 pb-safe pt-2 px-6 flex justify-between items-center z-50 h-[70px]">
295
- <button onclick="switchTab('tab-home')" class="nav-item active flex flex-col items-center gap-1 text-gray-400 w-16">
296
- <i class="fas fa-home text-xl"></i>
297
- <span class="text-[10px]">หน้าหลัก</span>
298
- </button>
299
- <button onclick="switchTab('tab-warroom')" class="nav-item flex flex-col items-center gap-1 text-gray-400 w-16">
300
- <i class="fas fa-chess-knight text-xl"></i>
301
- <span class="text-[10px]">กลยุทธ์</span>
302
- </button>
303
- <button onclick="switchTab('tab-ai')" class="nav-item flex flex-col items-center gap-1 text-gray-400 w-16">
304
- <div class="bg-gradient-to-tr from-purple-600 to-indigo-600 w-10 h-10 rounded-full flex items-center justify-center text-white shadow-lg -mt-6 border-4 border-gray-100">
305
- <i class="fas fa-robot text-lg"></i>
306
- </div>
307
- <span class="text-[10px] mt-1 text-purple-700 font-bold">AI Helper</span>
308
- </button>
309
- <button onclick="alert('Coming Soon: ข้อมูลคู่แข่งและพื้นที่')" class="nav-item flex flex-col items-center gap-1 text-gray-400 w-16">
310
- <i class="fas fa-map-marked-alt text-xl"></i>
311
- <span class="text-[10px]">พื้นที่</span>
312
- </button>
313
- </nav>
314
-
315
- <!-- JAVASCRIPT -->
316
  <script type="module">
317
  import { GoogleGenerativeAI } from "@google/generative-ai";
318
 
319
- // --- API KEY ---
320
- const apiKey = "AIzaSyBlvdz3wUNm2PtiuYnN2al9L7krngami-E";
321
  const genAI = new GoogleGenerativeAI(apiKey);
322
  const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash-preview-09-2025" });
323
 
324
- // --- UI UTILS ---
325
- window.switchTab = function(tabId) {
326
- // Hide all tabs
327
- document.querySelectorAll('.tab-content').forEach(el => el.classList.remove('active'));
328
- // Show target tab
329
- document.getElementById(tabId).classList.add('active');
330
-
331
- // Update Nav Icons
332
- document.querySelectorAll('.nav-item').forEach(el => {
333
- el.classList.remove('active', 'text-purple-800');
334
- el.classList.add('text-gray-400');
335
- });
336
- // Find the button that triggered this (rough approximation based on onclick)
337
- const activeBtn = Array.from(document.querySelectorAll('.nav-item')).find(btn => btn.getAttribute('onclick').includes(tabId));
338
- if(activeBtn) {
339
- activeBtn.classList.remove('text-gray-400');
340
- activeBtn.classList.add('active', 'text-purple-800');
341
  }
342
  }
343
 
344
- window.toggleTool = function(toolId) {
345
- const el = document.getElementById(toolId);
346
- el.classList.toggle('hidden');
347
- }
348
-
349
- async function runAI(btnId, outId, prompt, loadingText="กำลังคิด...") {
350
- const btn = document.getElementById(btnId);
351
- const out = document.getElementById(outId);
352
- const originalText = btn.innerHTML;
353
 
354
- btn.disabled = true;
355
- btn.innerHTML = `<span class="loader inline-block border-white/50 border-t-white" style="width:14px;height:14px;"></span> ${loadingText}`;
356
- out.classList.remove('hidden');
357
- out.innerText = "Waiting for AI...";
358
 
359
  try {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  const result = await model.generateContent(prompt);
361
- out.innerHTML = result.response.text().replace(/\n/g, '<br>');
 
362
  } catch (error) {
363
- out.innerText = "Error: " + error.message;
364
  } finally {
365
- btn.disabled = false;
366
- btn.innerHTML = originalText;
367
  }
368
- }
369
-
370
- // --- AI FEATURES ---
371
 
372
- // 1. Caption
373
- document.getElementById('btnMCaption').addEventListener('click', () => {
374
- const topic = document.getElementById('mCaptionTopic').value;
375
- const platform = document.getElementById('mCaptionPlatform').value;
376
- if(!topic) return alert('ใส่หัวข้อก่อนครับ');
377
 
378
- const prompt = `Write a political campaign caption for ${platform}.
379
- Candidate: Thanon Anant (Kla Tham Party, Udon Thani).
380
- Topic: ${topic}.
381
- Style: Sincere, Local (Thai Isan if appropriate), Action-oriented.
382
- Include hashtags.`;
383
-
384
- runAI('btnMCaption', 'outMCaption', prompt);
 
 
 
 
 
 
 
 
 
385
  });
386
 
387
- // 2. Crisis
388
- document.getElementById('btnMCrisis').addEventListener('click', () => {
389
- const input = document.getElementById('mCrisisInput').value;
390
- if(!input) return alert('เกิดเรื่องอะไรครับ?');
 
391
 
392
- const prompt = `Crisis Management Strategy for Candidate Thanon Anant.
393
- Incident: ${input}.
394
- Provide 3 bullet points on how to respond immediately to protect vote base.`;
 
 
395
 
396
- runAI('btnMCrisis', 'outMCrisis', prompt, "กำลังวางแผน...");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
397
  });
398
 
399
- // 3. Policy
400
- document.getElementById('btnMPolicy').addEventListener('click', () => {
401
- const input = document.getElementById('mPolicyInput').value;
402
- const target = document.getElementById('mPolicyTarget').value;
403
- if(!input) return alert('ใส่นโยบายครับ');
404
 
405
- const prompt = `Translate this formal policy into simple Thai spoken language for ${target}: "${input}".
406
- Make it catchy and emotional.`;
407
-
408
- runAI('btnMPolicy', 'outMPolicy', prompt, "กำลังแปล...");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  });
410
 
411
- // --- CHARTS (Init when page loads) ---
412
- // We delay slightly to ensure DOM is ready or Tab is rendered (though Chart.js works in hidden tabs usually)
413
- setTimeout(() => {
414
- // Social Chart
415
- new Chart(document.getElementById('mobileSocialChart'), {
416
- type: 'doughnut',
417
- data: {
418
- labels: ['TikTok', 'FB', 'Line', 'Other'],
419
- datasets: [{
420
- data: [45, 30, 20, 5],
421
- backgroundColor: ['#000000', '#1877F2', '#00B900', '#FF0000'],
422
- borderWidth: 0
423
- }]
424
- },
425
- options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { position: 'right', labels: { boxWidth: 10, font: { size: 10 } } } } }
426
- });
427
-
428
- // Radar Chart
429
- new Chart(document.getElementById('mobileRadarChart'), {
430
- type: 'radar',
431
- data: {
432
- labels: ['ความนิยม', 'นโยบาย', 'กระแส', 'ทีมงาน', 'งบ'],
433
- datasets: [{
434
- label: 'เรา (ธนอนันต์)',
435
- data: [75, 95, 70, 85, 90],
436
- borderColor: '#6A0DAD',
437
- backgroundColor: 'rgba(106, 13, 173, 0.2)',
438
- pointRadius: 2
439
- }, {
440
- label: 'คู่แข่ง',
441
- data: [90, 70, 85, 80, 80],
442
- borderColor: '#FF0000',
443
- backgroundColor: 'rgba(255, 0, 0, 0.05)',
444
- borderDash: [5, 5],
445
- pointRadius: 0
446
- }]
447
- },
448
- options: {
449
- responsive: true,
450
- maintainAspectRatio: false,
451
- scales: { r: { suggestedMin: 0, ticks: { display: false } } },
452
- plugins: { legend: { position: 'bottom' } }
453
- }
454
- });
455
- }, 500);
456
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  </script>
458
  </body>
459
  </html>
 
2
  <html lang="th">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ยุทธศาสตร์เลือกตั้ง 2569: ธนอนันต์ เมนะสวัสดิ์ (อุดรฯ เขต 6)</title>
7
 
8
  <!-- Tailwind CSS -->
9
  <script src="https://cdn.tailwindcss.com"></script>
 
23
  <!-- Font: Noto Sans Thai -->
24
  <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;600;800&display=swap" rel="stylesheet">
25
 
26
+ <!-- Palette: Kla Tham Party Theme (Purple/Gold/Bold)
27
+ Primary: #6A0DAD (Purple)
28
+ Secondary: #FFD700 (Gold)
29
+ Accent: #FF4500 (Orange Red - Action)
30
+ -->
31
 
32
  <style>
33
  body {
34
  font-family: 'Noto Sans Thai', sans-serif;
35
+ background-color: #F8F7FF; /* Light Purple Tint */
36
  color: #1F2937;
 
 
37
  }
38
 
39
+ .chart-container {
40
+ position: relative;
41
+ width: 100%;
42
+ max-width: 600px;
43
+ margin-left: auto;
44
+ margin-right: auto;
45
+ height: 350px;
46
+ max-height: 400px;
47
  }
48
 
49
+ @media (min-width: 768px) {
50
+ .chart-container {
51
+ height: 400px;
52
+ }
 
 
 
 
 
 
 
 
53
  }
54
 
55
+ .info-card {
56
+ background-color: white;
57
+ border-radius: 0.75rem;
58
+ box-shadow: 0 4px 6px -1px rgba(106, 13, 173, 0.1), 0 2px 4px -1px rgba(106, 13, 173, 0.06);
59
+ padding: 1.5rem;
60
+ transition: transform 0.2s;
61
+ border-top: 4px solid transparent;
62
  }
63
 
64
+ .info-card:hover {
65
+ transform: translateY(-2px);
66
+ border-top-color: #6A0DAD;
67
+ box-shadow: 0 10px 15px -3px rgba(106, 13, 173, 0.15), 0 4px 6px -2px rgba(106, 13, 173, 0.1);
 
 
 
 
 
 
 
68
  }
69
 
70
+ .timeline-dot {
71
+ width: 16px;
72
+ height: 16px;
73
+ background-color: #6A0DAD;
74
+ border-radius: 50%;
75
+ border: 3px solid #fff;
76
+ box-shadow: 0 0 0 2px #6A0DAD;
77
  }
78
 
 
79
  .loader {
80
+ border: 4px solid #f3f3f3;
81
+ border-top: 4px solid #6A0DAD;
82
  border-radius: 50%;
83
+ width: 24px;
84
+ height: 24px;
85
  animation: spin 1s linear infinite;
86
+ display: inline-block;
87
+ }
88
+
89
+ @keyframes spin {
90
+ 0% { transform: rotate(0deg); }
91
+ 100% { transform: rotate(360deg); }
92
  }
93
+
94
+ /* Platform Icons */
95
+ .icon-tiktok { color: #000000; }
96
+ .icon-line { color: #00B900; }
97
+ .icon-fb { color: #1877F2; }
98
  </style>
99
  </head>
100
+ <body class="bg-gray-100">
101
+
102
+ <!-- Header Section -->
103
+ <header class="bg-gradient-to-r from-purple-800 via-purple-700 to-indigo-900 text-white py-12 px-4 shadow-xl">
104
+ <div class="max-w-6xl mx-auto text-center">
105
+ <div class="inline-block bg-white text-purple-900 px-4 py-1 rounded-full text-sm font-bold mb-4 tracking-wide shadow-md">
106
+ ROADMAP TO VICTORY 2026 (2569)
 
 
 
 
 
 
 
 
 
107
  </div>
108
+ <h1 class="text-4xl md:text-6xl font-extrabold mb-2 tracking-tight">ธนอนันต์ เมนะสวัสดิ์</h1>
109
+ <h2 class="text-2xl md:text-3xl font-light opacity-90">พรรคกล้าธรรม | อุดรธานี เขต 6</h2>
110
+ <p class="mt-6 text-lg max-w-3xl mx-auto text-purple-100">
111
+ "สานต่อตำนาน เมนะสวัสดิ์ - กล้าทำจริง เพื่อพี่น้องอุดรฯ" <br>
112
+ ยุทธศาสตร์ผสมผสานฐานเสียงดั้งเดิม + พลังโซเชียลมีเดียยุคใหม่
113
+ </p>
114
  </div>
115
  </header>
116
 
117
+ <main class="max-w-7xl mx-auto p-4 md:p-8 space-y-12">
 
118
 
119
+ <!-- Intro Stats Row -->
120
+ <section class="grid grid-cols-1 md:grid-cols-4 gap-6">
121
+ <div class="info-card border-l-8 border-purple-600 text-center">
122
+ <div class="text-gray-500 font-bold uppercase text-xs tracking-wider">เป้าหมายคะแนน</div>
123
+ <div class="text-4xl font-extrabold text-purple-700 mt-2">42,000+</div>
124
+ <div class="text-gray-600 text-sm mt-1">คะแนนเสียง</div>
125
+ </div>
126
+ <div class="info-card border-l-8 border-yellow-500 text-center">
127
+ <div class="text-gray-500 font-bold uppercase text-xs tracking-wider">กลุ่มเป้าหมายหลัก</div>
128
+ <div class="text-4xl font-extrabold text-yellow-600 mt-2">New Gen</div>
129
+ <div class="text-gray-600 text-sm mt-1">อายุ 18-35 ปี (35%)</div>
130
+ </div>
131
+ <div class="info-card border-l-8 border-indigo-500 text-center">
132
+ <div class="text-gray-500 font-bold uppercase text-xs tracking-wider">ฐานเสียงเดิม</div>
133
+ <div class="text-4xl font-extrabold text-indigo-600 mt-2">Family</div>
134
+ <div class="text-gray-600 text-sm mt-1">ตระกูลเมนะสวัสดิ์</div>
135
+ </div>
136
+ <div class="info-card border-l-8 border-pink-500 text-center">
137
+ <div class="text-gray-500 font-bold uppercase text-xs tracking-wider">งบดิจิทัล</div>
138
+ <div class="text-4xl font-extrabold text-pink-600 mt-2">40%</div>
139
+ <div class="text-gray-600 text-sm mt-1">ของงบทั้งหมด</div>
140
+ </div>
141
+ </section>
142
 
143
+ <!-- Digital War Room Strategy -->
144
+ <section id="digital-war-room" class="bg-white rounded-2xl shadow-xl overflow-hidden border border-purple-100">
145
+ <div class="bg-gray-900 text-white p-6 border-b-4 border-purple-500 flex justify-between items-center flex-wrap gap-4">
146
+ <div>
147
+ <h3 class="text-2xl font-bold flex items-center gap-2">
148
+ 📱 Digital War Room 2026
149
+ </h3>
150
+ <p class="text-gray-400 text-sm mt-1">ยุทธศาสตร์เจาะลึกโซเชียลมีเดียรายแพลตฟอร์ม สำหรับ "ธนอนันต์"</p>
 
 
 
151
  </div>
152
+ <span class="bg-purple-600 px-3 py-1 rounded text-xs font-bold animate-pulse">LIVE MONITORING</span>
153
  </div>
154
 
155
+ <div class="p-6 md:p-8 grid grid-cols-1 lg:grid-cols-2 gap-8">
156
+ <!-- Left: Platform Strategy -->
157
+ <div class="space-y-6">
158
+ <h4 class="font-bold text-gray-800 text-lg border-b pb-2">🎯 กลยุทธ์แยกแพลตฟอร์ม (Platform Specifics)</h4>
159
+ <!-- TikTok -->
160
+ <div class="flex gap-4 items-start p-4 bg-gray-50 rounded-xl hover:bg-gray-100 transition">
161
+ <div class="bg-black text-white p-3 rounded-lg text-2xl">🎵</div>
162
+ <div>
163
+ <h5 class="font-bold text-gray-900">TikTok: "The Real Udon"</h5>
164
+ <p class="text-sm text-gray-600 mt-1">
165
+ <strong>Target:</strong> First Voters & วัยทำงาน<br>
166
+ <strong>Concept:</strong> "เข้าถึงง่าย ไม่ถือตัว"<br>
167
+ <strong>Action:</strong> คลิปสั้น 30 วิฯ โชว์แก้ปัญหาหน้างานจริง (เช่น ท่อแตก ถนนพัง ไปดูทันที) ใช้ภาษาอีสาน 100% ดันแฮชแท็ก #ธนอนันต์จัดให้ #กล้าธรรมอุดร
168
+ </p>
169
+ </div>
170
  </div>
171
+ <!-- Line OA -->
172
+ <div class="flex gap-4 items-start p-4 bg-gray-50 rounded-xl hover:bg-gray-100 transition">
173
+ <div class="bg-green-500 text-white p-3 rounded-lg text-2xl">💬</div>
174
+ <div>
175
+ <h5 class="font-bold text-gray-900">Line OA: "Menasawat Connect"</h5>
176
+ <p class="text-sm text-gray-600 mt-1">
177
+ <strong>Target:</strong> หัวคะแนนธรรมชาติ & ผู้นำชุมชน<br>
178
+ <strong>Concept:</strong> "สายตรง แก้ไว"<br>
179
+ <strong>Action:</strong> ระบบ CRM แจ้งข่าวนโยบายพรรคกล้าธรรม แบ่งกลุ่มบรอดแคสต์ (ชาวนา/ค้าขาย/ข้าราชการ) ส่งสวัสดีตอนเช้าพร้อมรูปภารกิจจริง
180
+ </p>
181
+ </div>
182
  </div>
183
+ <!-- Facebook -->
184
+ <div class="flex gap-4 items-start p-4 bg-gray-50 rounded-xl hover:bg-gray-100 transition">
185
+ <div class="bg-blue-600 text-white p-3 rounded-lg text-2xl">f</div>
186
+ <div>
187
+ <h5 class="font-bold text-gray-900">Facebook Page: "Official Voice"</h5>
188
+ <p class="text-sm text-gray-600 mt-1">
189
+ <strong>Target:</strong> ฐานเสียงเดิม & ผู้ใหญ่บ้าน<br>
190
+ <strong>Concept:</strong> "งานหนัก งานจริง"<br>
191
+ <strong>Action:</strong> Live Stream งานบุญประเพณี โชว์วิสัยทัศน์ยาวๆ และอัลบั้มรูป "ก่อนทำ-หลังทำ" เน้นผลงานพรรคกล้าธรรม
192
+ </p>
193
+ </div>
194
+ </div>
195
+ </div>
196
+ <!-- Right: Chart & Timeline -->
197
+ <div class="space-y-6">
198
+ <h4 class="font-bold text-gray-800 text-lg border-b pb-2">📊 ส่วนแบ่งการสื่อสาร (Voice Share Targets)</h4>
199
+ <div class="chart-container" style="height: 250px;">
200
+ <canvas id="socialChart"></canvas>
201
+ </div>
202
+ <div class="bg-purple-50 p-4 rounded-xl border border-purple-200 mt-4">
203
+ <h5 class="font-bold text-purple-800 text-sm mb-2">💡 Insight ปี 2569:</h5>
204
+ <p class="text-xs text-purple-700">
205
+ "การเลือกตั้งปี 69 AI จะมีบทบาทสูงในการสร้างเฟคนิวส์ (Deepfake) ทีมงานต้องมีหน่วย 'Fact Check' ที่ตอบโต้ได้ภายใน 1 ชม. ผ่าน Line OA และ TikTok Reply"
206
+ </p>
207
  </div>
208
  </div>
209
  </div>
210
+ </section>
211
+
212
+ <!-- AI Strategic Partner Section 1 -->
213
+ <section class="bg-gradient-to-br from-indigo-900 to-purple-800 rounded-2xl p-8 text-white shadow-xl relative overflow-hidden">
214
+ <div class="absolute top-0 right-0 -mr-16 -mt-16 w-64 h-64 rounded-full bg-white opacity-5"></div>
215
+ <div class="mb-8 border-b border-purple-400 pb-4 relative z-10">
216
+ <h3 class="text-3xl font-bold text-white flex items-center gap-3">
217
+ 🤖 AI Strategic Partner <span class="text-sm bg-yellow-500 text-black px-2 py-1 rounded font-bold">GEMINI INTEGRATED</span>
218
+ </h3>
219
+ <p class="text-purple-200 mt-2">
220
+ ผู้ช่วยวางแผนสำหรับ "ธนอนันต์" โดยเฉพาะ: เขียนแคปชั่นและแก้เกมการเมือง
221
+ </p>
222
+ </div>
223
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-8 relative z-10">
224
+ <!-- Feature 1: Social Media Caption Creator -->
225
+ <div class="bg-white text-gray-800 rounded-xl p-6 shadow-lg">
226
+ <h4 class="text-xl font-bold text-purple-800 mb-4 flex items-center">
227
+ ✍️ ผู้ช่วยเขียนแคปชั่น (Caption Generator)
228
+ </h4>
229
+ <div class="space-y-4">
230
+ <div>
231
+ <label class="block text-sm font-semibold text-gray-700 mb-1">หัวข้อคอนเทนต์ (Topic)</label>
232
+ <input type="text" id="captionTopic" class="w-full border-gray-300 border rounded-md p-2 bg-gray-50" placeholder="เช่น ลงพื้นที่น้ำท่วม, งานบุญบั้งไฟ...">
233
+ </div>
234
+ <div>
235
+ <label class="block text-sm font-semibold text-gray-700 mb-1">แพลตฟอร์ม (Platform)</label>
236
+ <select id="captionPlatform" class="w-full border-gray-300 border rounded-md p-2 bg-gray-50">
237
+ <option value="TikTok">TikTok (สั้น สนุก กันเอง)</option>
238
+ <option value="Facebook">Facebook (ทางการ น่าเชื่อถือ)</option>
239
+ <option value="Line Official">Line OA (ใส่ใจ แจ้งข่าว)</option>
240
+ </select>
241
  </div>
242
+ <button id="btnGenerateCaption" class="w-full bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-700 hover:to-indigo-700 text-white font-bold py-2 px-4 rounded-md transition flex justify-center items-center gap-2">
243
+ <span>✨ สร้างแคปชั่นสไตล์ "กล้าธรรม"</span>
244
+ </button>
245
  </div>
246
+ <div id="captionOutput" class="mt-4 p-4 bg-purple-50 rounded-md border border-purple-200 min-h-[100px] text-sm text-gray-700 whitespace-pre-wrap hidden"></div>
247
+ </div>
248
+ <!-- Feature 2: Crisis Strategy -->
249
+ <div class="bg-white text-gray-800 rounded-xl p-6 shadow-lg">
250
+ <h4 class="text-xl font-bold text-purple-800 mb-4 flex items-center">
251
+ 🛡️ ที่ปรึกษาแก้เกม (Crisis Advisor)
252
+ </h4>
253
+ <div class="space-y-4">
254
+ <div>
255
+ <label class="block text-sm font-semibold text-gray-700 mb-1">ประเด็นโจมตี/ดราม่า</label>
256
+ <textarea id="crisisInput" rows="3" class="w-full border-gray-300 border rounded-md p-2 bg-gray-50" placeholder="เช่น โดนกล่าวหาว่าซื้อเสียง, นโยบายพรรคทำไม่ได้จริง..."></textarea>
257
  </div>
258
+ <button id="btnGenerateStrategy" class="w-full bg-gray-800 hover:bg-gray-900 text-white font-bold py-2 px-4 rounded-md transition flex justify-center items-center gap-2">
259
+ <span>✨ ขอคำแนะนำแก้เกม</span>
260
+ </button>
261
  </div>
262
+ <div id="strategyOutput" class="mt-4 p-4 bg-gray-50 rounded-md border border-gray-200 min-h-[100px] text-sm text-gray-700 whitespace-pre-wrap hidden"></div>
263
  </div>
264
  </div>
265
+ </section>
266
 
267
+ <!-- New Section: AI Debate & Policy Lab -->
268
+ <section class="bg-gray-800 rounded-2xl p-8 text-white shadow-xl relative border-t-4 border-yellow-500">
269
+ <div class="mb-8 relative z-10 flex justify-between items-center">
270
+ <div>
271
+ <h3 class="text-3xl font-bold text-yellow-400 flex items-center gap-3">
272
+ 🗳️ AI Debate & Policy Lab
273
+ </h3>
274
+ <p class="text-gray-300 mt-2">
275
+ ห้องปฏิบัติการนโยบายและฝึกซ้อมดีเบต: เตรียมพร้อมรับมือทุกคำถามและเข้าถึงทุกกลุ่มเป้าหมาย
276
+ </p>
277
  </div>
278
+ <div class="hidden md:block text-5xl opacity-20">🎙️</div>
279
  </div>
280
 
281
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
282
+
283
+ <!-- Feature 3: Debate Simulator -->
284
+ <div class="bg-gray-700 rounded-xl p-6 border border-gray-600">
285
+ <h4 class="text-xl font-bold text-white mb-4 flex items-center">
286
+ 🗣️ ห้องซ้อมดีเบต (Debate Simulator)
287
+ </h4>
288
+ <p class="text-xs text-gray-400 mb-4">AI จะสวมบทเป็นฝ่ายค้านเพื่อตั้งคำถามเจาะใจดำคุณ</p>
289
+
290
+ <div class="space-y-4">
291
+ <select id="debateTopic" class="w-full bg-gray-800 border border-gray-600 rounded p-2 text-white">
292
+ <option value="ราคาพืชผลการเกษตร">ราคาพืชผลการเกษตร</option>
293
+ <option value="ปัญหาที่ดิน ส.ป.ก.">ปัญหาที่ดิน ส.ป.ก.</option>
294
+ <option value="ยาเสพติดในชุมชน">ยาเสพติดในชุมชน</option>
295
+ <option value="การพัฒนาแหล่งน้ำ">การพัฒนาแหล่งน้ำ</option>
296
+ </select>
297
+ <button id="btnStartDebate" class="w-full bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded transition">
298
+ 👊 เริ่มการท้าดวล (ให้ AI ตั้งคำถาม)
299
+ </button>
300
+
301
+ <div id="debateQuestionSection" class="hidden animate-in fade-in slide-in-from-top-4 duration-300">
302
+ <div class="p-3 bg-red-900/50 border-l-4 border-red-500 text-red-100 italic mb-2" id="debateQuestionText">
303
+ <!-- Question goes here -->
304
+ </div>
305
+ <textarea id="debateAnswer" rows="3" class="w-full bg-gray-800 border border-gray-600 rounded p-2 text-white" placeholder="พิมพ์คำตอบของคุณที่นี่..."></textarea>
306
+ <button id="btnGradeAnswer" class="mt-2 w-full bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-4 rounded transition">
307
+ ✅ ตรวจคำตอบ
308
+ </button>
309
+ </div>
310
+
311
+ <div id="debateFeedback" class="hidden p-4 bg-gray-900 rounded border border-gray-700 text-sm whitespace-pre-wrap text-gray-300"></div>
312
  </div>
313
  </div>
314
+
315
+ <!-- Feature 4: Policy Localizer -->
316
+ <div class="bg-gray-700 rounded-xl p-6 border border-gray-600">
317
+ <h4 class="text-xl font-bold text-white mb-4 flex items-center">
318
+ 📢 เครื่องแปลนโยบายฉบับชาวบ้าน (Policy Localizer)
319
+ </h4>
320
+ <p class="text-xs text-gray-400 mb-4">แปลงภาษาราชการยากๆ ให้เป็นภาษาพูดที่กินใจตามกลุ่มเป้าหมาย</p>
321
+
322
+ <div class="space-y-4">
323
+ <div>
324
+ <label class="text-sm text-gray-300">ใส่นโยบาย (ภาษาราชการ/ทางการ)</label>
325
+ <textarea id="policyInput" rows="2" class="w-full bg-gray-800 border border-gray-600 rounded p-2 text-white" placeholder="เช่น จัดตั้งกองทุนพัฒนาหมู่บ้านละ 2 ล้านบาท เพื่อส่งเสริมวิสาหกิจชุมชน..."></textarea>
326
+ </div>
327
+ <div>
328
+ <label class="text-sm text-gray-300">แปลงสารให้ใครฟัง?</label>
329
+ <select id="policyTarget" class="w-full bg-gray-800 border border-gray-600 rounded p-2 text-white">
330
+ <option value="ผู้เฒ่าผู้แก่ (ภาษาอีสาน จริงใจ)">ผู้เฒ่าผู้แก่ (ภาษาอีสาน)</option>
331
+ <option value="วัยรุ่น (สั้น กระชับ ทันสมัย)">วัยรุ่น First Voter</option>
332
+ <option value="พ่อค้าแม่ค้า (เน้นกำไร ปากท้อง)">พ่อค้าแม่ค้า</option>
333
+ </select>
334
+ </div>
335
+ <button id="btnTranslatePolicy" class="w-full bg-yellow-600 hover:bg-yellow-700 text-white font-bold py-2 px-4 rounded transition">
336
+ ✨ แปลงเป็นภาษาโดนใจ
337
+ </button>
338
  </div>
339
+ <div id="policyOutput" class="hidden mt-4 p-4 bg-gray-900 rounded border border-gray-700 text-sm whitespace-pre-wrap text-yellow-100 font-medium"></div>
340
  </div>
 
341
 
 
 
 
 
 
 
342
  </div>
343
+ </section>
344
+
345
+ <!-- Competitor Analysis -->
346
+ <section>
347
+ <div class="mb-6 border-b-2 border-purple-200 pb-4">
348
+ <h3 class="text-3xl font-bold text-gray-800">⚡ วิเคราะห์จุดแข็ง-จุดอ่อน (SWOT)</h3>
349
+ <p class="text-gray-600 mt-2">
350
+ เปรียบเทียบศักยภาพ "ธนอนันต์ (กล้าธรรม)" vs "เจ้าของพื้นที่เดิม" vs "กระแสพรรคประชาชน"
351
+ </p>
352
  </div>
353
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
354
+ <div class="info-card">
355
+ <h4 class="text-xl font-bold text-gray-700 mb-4 text-center">สมรภูมิความนิยม (Radar Chart)</h4>
356
+ <div class="chart-container">
357
+ <canvas id="radarChart"></canvas>
 
 
358
  </div>
 
359
  </div>
360
+ <div class="info-card flex flex-col justify-center bg-purple-50">
361
+ <h4 class="text-xl font-bold text-purple-800 mb-4">จุดยุทธศาสตร์ของ ธนอนันต์:</h4>
362
+ <ul class="space-y-4">
363
+ <li class="flex items-start">
364
+ <span class="text-2xl mr-3">🏛️</span>
365
+ <div>
366
+ <strong class="text-gray-900">ฐานเสียงตระกูล (Legacy):</strong>
367
+ <span class="text-gray-600 text-sm block">ชื่อชั้น "เมนะสวัสดิ์" ยังขลังในกลุ่มผู้สูงอายุ ต้องรักษาไว้ห้ามหลุด</span>
368
+ </div>
369
+ </li>
370
+ <li class="flex items-start">
371
+ <span class="text-2xl mr-3">🚜</span>
372
+ <div>
373
+ <strong class="text-gray-900">นโยบายกล้าธรรม (Policy):</strong>
374
+ <span class="text-gray-600 text-sm block">ชูจุดขาย "เปลี่ยนที่ ส.ป.ก. เป็นโฉนด" และ "น้ำแก้จน" ซึ่งโดนใจคนพื้นที่อุดรฯ เขต 6 มากที่สุด</span>
375
+ </div>
376
+ </li>
377
+ <li class="flex items-start">
378
+ <span class="text-2xl mr-3">📲</span>
379
+ <div>
380
+ <strong class="text-gray-900">Digital Gap (ช่องว่าง):</strong>
381
+ <span class="text-gray-600 text-sm block">คู่แข่งแชมป์เก่ายังอ่อนเรื่อง TikTok นี่คือโอกาสเจาะกลุ่ม Young Voter 18-25 ปี</span>
382
+ </div>
383
+ </li>
384
+ </ul>
385
  </div>
386
  </div>
387
+ </section>
388
+
389
+ <!-- Timeline Roadmap -->
390
+ <section class="bg-white p-6 rounded-2xl shadow-lg border-t-4 border-purple-600">
391
+ <h3 class="text-2xl font-bold text-gray-800 mb-6">📅 ปฏิทินปฏิบัติการ 90 วันก่อนเลือกตั้ง (2569)</h3>
392
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
393
+ <!-- Phase 1 -->
394
+ <div class="relative pl-6 border-l-4 border-gray-200">
395
+ <div class="absolute -left-[10px] top-0 timeline-dot bg-gray-300"></div>
396
+ <h4 class="font-bold text-lg text-gray-700">เดือนที่ 1: "ปลุกยักษ์"</h4>
397
+ <span class="text-xs font-semibold bg-gray-200 text-gray-600 px-2 py-1 rounded">Awareness</span>
398
+ <ul class="mt-3 text-sm text-gray-600 space-y-2 list-disc list-inside">
399
+ <li>เปิดตัวเพจ "ธนอนันต์ อุดรยุคใหม่"</li>
400
+ <li>ยิง Ads แนะนำตัวเจาะรายตำบล</li>
401
+ <li>เปิดศูนย์ประสานงานพรรคกล้าธรรม</li>
402
+ </ul>
403
  </div>
404
+ <!-- Phase 2 -->
405
+ <div class="relative pl-6 border-l-4 border-purple-300">
406
+ <div class="absolute -left-[10px] top-0 timeline-dot bg-purple-400"></div>
407
+ <h4 class="font-bold text-lg text-purple-800">เดือนที่ 2: "กล้าชน"</h4>
408
+ <span class="text-xs font-semibold bg-purple-100 text-purple-600 px-2 py-1 rounded">Engagement</span>
409
+ <ul class="mt-3 text-sm text-gray-600 space-y-2 list-disc list-inside">
410
+ <li>เปิดเวทีปราศรัยย่อย 20 จุด</li>
411
+ <li>Challenge TikTok "ปัญหาบ้านเฮา"</li>
412
+ <li>ระดม อสม. เคาะประตูบ้าน</li>
413
+ </ul>
414
  </div>
415
+ <!-- Phase 3 -->
416
+ <div class="relative pl-6 border-l-4 border-purple-600">
417
+ <div class="absolute -left-[10px] top-0 timeline-dot bg-purple-700 animate-pulse"></div>
418
+ <h4 class="font-bold text-lg text-purple-900">เดือนที่ 3: "ปิดกล่อง"</h4>
419
+ <span class="text-xs font-semibold bg-purple-600 text-white px-2 py-1 rounded">Conversion</span>
420
+ <ul class="mt-3 text-sm text-gray-600 space-y-2 list-disc list-inside">
421
+ <li>ปราศรัยใหญ่ นำโดยหัวหน้าพรรค</li>
422
+ <li>ปล่อยคลิปไวรัลโค้งสุดท้าย</li>
423
+ <li>SMS/Line ย้ำเบอร์เช้าวันเลือกตั้ง</li>
424
+ </ul>
 
 
 
 
 
 
 
 
 
425
  </div>
426
  </div>
427
+ </section>
428
 
429
+ <!-- Footer -->
430
+ <footer class="text-center py-8 text-gray-500 text-sm mt-8 border-t">
431
+ <p>© 2026 Kla Tham Party Strategic Center (Udon Thani D6). All Rights Reserved.</p>
432
+ <p>ระบบจำลองยุทธศาสตร์การเลือกตั้ง | Powered by Google Gemini</p>
433
+ </footer>
434
 
435
  </main>
436
 
437
+ <!-- JS Logic -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
438
  <script type="module">
439
  import { GoogleGenerativeAI } from "@google/generative-ai";
440
 
441
+ // --- GEMINI API SETUP ---
442
+ const apiKey = "AIzaSyBlvdz3wUNm2PtiuYnN2al9L7krngami-E";
443
  const genAI = new GoogleGenerativeAI(apiKey);
444
  const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash-preview-09-2025" });
445
 
446
+ function setLoading(btnId, outputId, isLoading, loadingText = "AI กำลังคิด...") {
447
+ const btn = document.getElementById(btnId);
448
+ const output = document.getElementById(outputId);
449
+ if (isLoading) {
450
+ btn.disabled = true;
451
+ btn.classList.add('opacity-70', 'cursor-not-allowed');
452
+ if (!btn.dataset.originalText) btn.dataset.originalText = btn.innerHTML;
453
+ btn.innerHTML = `<span class="loader border-white/50 border-t-white mr-2" style="width:16px;height:16px;"></span> ${loadingText}`;
454
+ if(output) {
455
+ output.classList.remove('hidden');
456
+ // Only set text if output is empty or needs reset, otherwise keep structure
457
+ if(output.innerText === "") output.textContent = '... กำลังประมวลผล ...';
458
+ }
459
+ } else {
460
+ btn.disabled = false;
461
+ btn.classList.remove('opacity-70', 'cursor-not-allowed');
462
+ btn.innerHTML = btn.dataset.originalText;
463
  }
464
  }
465
 
466
+ // Feature 1: Social Caption Generator
467
+ document.getElementById('btnGenerateCaption').addEventListener('click', async () => {
468
+ const topic = document.getElementById('captionTopic').value;
469
+ const platform = document.getElementById('captionPlatform').value;
470
+ const outputDiv = document.getElementById('captionOutput');
 
 
 
 
471
 
472
+ if (!topic.trim()) { alert("กรุณาใส่หัวข้อคอนเทนต์ครับ"); return; }
473
+ setLoading('btnGenerateCaption', 'captionOutput', true);
 
 
474
 
475
  try {
476
+ const prompt = `
477
+ คุณคือทีมสื่อสารของ 'ธนอนันต์ เมนะสวัสดิ์' ผู้สมัคร ส.ส. อุดรธานี เขต 6 พรรคกล้าธรรม
478
+ Identity: ลูกหลานคนอุดร, จริงใจ, กล้าทำจริง (สไตล์พรรคกล้าธรรม), เข้าถึงง่าย
479
+
480
+ เขียน Caption สำหรับแพลตฟอร์ม: ${platform}
481
+ หัวข้อ: "${topic}"
482
+
483
+ ข้อกำหนด:
484
+ - ถ้าเป็น TikTok: ขอสั้นๆ กระชับ ภาษาอีสานวัยรุ่น ติดแฮชแท็กฮิต
485
+ - ถ้าเป็น Facebook: ขอแบบเล่าเรื่อง เห็นภาพความทุ่มเท ภาษาทางการกึ่งกันเอง
486
+ - ถ้าเป็น Line OA: ขอแบบสั้นๆ เหมือนทักทายญาติพี่น้อง แจ้งข่าวสารชัดเจน
487
+ - ต้องมีคำว่า "กล้าธรรม" หรือ "ธนอนันต์" ในข้อความ
488
+ `;
489
+
490
  const result = await model.generateContent(prompt);
491
+ const response = await result.response;
492
+ outputDiv.innerHTML = `<strong>📲 Draft Caption (${platform}):</strong><br><br>${response.text().replace(/\n/g, '<br>')}`;
493
  } catch (error) {
494
+ outputDiv.textContent = "AI Error: " + error.message;
495
  } finally {
496
+ setLoading('btnGenerateCaption', 'captionOutput', false);
 
497
  }
498
+ });
 
 
499
 
500
+ // Feature 2: Crisis Strategy
501
+ document.getElementById('btnGenerateStrategy').addEventListener('click', async () => {
502
+ const situation = document.getElementById('crisisInput').value;
503
+ const outputDiv = document.getElementById('strategyOutput');
 
504
 
505
+ if (!situation.trim()) { alert("ระบุสถานการณ์ก่อนครับ"); return; }
506
+ setLoading('btnGenerateStrategy', 'strategyOutput', true);
507
+
508
+ try {
509
+ const prompt = `
510
+ สถานการณ์ด่วน! ผู้สมัคร 'ธนอนันต์ พรรคกล้าธรรม' เจอเรื่อง: "${situation}"
511
+ ขอแผนรับมือ 3 ขั้นตอนด่วน (Immediate Action, Message, Follow-up)
512
+ สไตล์: กล้าชนแต่ไม่ก้าวร้าว, ใช้ความจริงสู้, รักษาฐานเสียง
513
+ `;
514
+ const result = await model.generateContent(prompt);
515
+ outputDiv.innerHTML = `<strong>🛡️ แผนแก้เกมด่วน:</strong><br><br>${result.response.text().replace(/\n/g, '<br>')}`;
516
+ } catch (error) {
517
+ outputDiv.textContent = "Error: " + error.message;
518
+ } finally {
519
+ setLoading('btnGenerateStrategy', 'strategyOutput', false);
520
+ }
521
  });
522
 
523
+ // Feature 3: Debate Simulator - Step 1: Generate Question
524
+ document.getElementById('btnStartDebate').addEventListener('click', async () => {
525
+ const topic = document.getElementById('debateTopic').value;
526
+ const questionDiv = document.getElementById('debateQuestionText');
527
+ const section = document.getElementById('debateQuestionSection');
528
 
529
+ // Reset previous state
530
+ section.classList.remove('hidden');
531
+ questionDiv.innerHTML = "กำลังคิดคำถามโหดๆ...";
532
+ document.getElementById('debateAnswer').value = "";
533
+ document.getElementById('debateFeedback').classList.add('hidden');
534
 
535
+ setLoading('btnStartDebate', null, true, "กำลังลับฝีปาก...");
536
+
537
+ try {
538
+ const prompt = `
539
+ Act as a tough political debate moderator or an aggressive opponent.
540
+ Target: Thanon Anant (Kla Tham Party candidate in Udon Thani).
541
+ Topic: ${topic}.
542
+
543
+ Generate ONE tough, provocative question in Thai (ภาษาไทย).
544
+ The question should attack the party's weak points or challenge the feasibility of the policy.
545
+ Make it short and sharp (max 2 sentences).
546
+ `;
547
+ const result = await model.generateContent(prompt);
548
+ questionDiv.innerText = result.response.text();
549
+ } catch (error) {
550
+ questionDiv.innerText = "Error generating question.";
551
+ } finally {
552
+ setLoading('btnStartDebate', null, false);
553
+ }
554
  });
555
 
556
+ // Feature 3: Debate Simulator - Step 2: Grade Answer
557
+ document.getElementById('btnGradeAnswer').addEventListener('click', async () => {
558
+ const question = document.getElementById('debateQuestionText').innerText;
559
+ const answer = document.getElementById('debateAnswer').value;
560
+ const feedbackDiv = document.getElementById('debateFeedback');
561
 
562
+ if (!answer.trim()) { alert("ตอบคำถามก่อนครับท่าน!"); return; }
563
+ setLoading('btnGradeAnswer', 'debateFeedback', true, "กรรมการกำลังให้คะแนน...");
564
+
565
+ try {
566
+ const prompt = `
567
+ Context: Political Debate Training for Thanon Anant (Kla Tham Party).
568
+ Question: "${question}"
569
+ Candidate's Answer: "${answer}"
570
+
571
+ Please evaluate this answer in Thai:
572
+ 1. Score (out of 10).
573
+ 2. Strengths (จุดดี).
574
+ 3. Weaknesses (จุดด้อย).
575
+ 4. Suggested Improvement (แนะนำวิธีตอบให้คมขึ้น/ดีขึ้น).
576
+ `;
577
+ const result = await model.generateContent(prompt);
578
+ feedbackDiv.innerHTML = `<strong>📝 ผลการประเมิน:</strong><br><br>${result.response.text().replace(/\n/g, '<br>')}`;
579
+ } catch (error) {
580
+ feedbackDiv.textContent = "Error: " + error.message;
581
+ } finally {
582
+ setLoading('btnGradeAnswer', 'debateFeedback', false);
583
+ }
584
  });
585
 
586
+ // Feature 4: Policy Localizer
587
+ document.getElementById('btnTranslatePolicy').addEventListener('click', async () => {
588
+ const policy = document.getElementById('policyInput').value;
589
+ const target = document.getElementById('policyTarget').value;
590
+ const outputDiv = document.getElementById('policyOutput');
591
+
592
+ if (!policy.trim()) { alert("ใส่นโยบายมาก่อนครับ"); return; }
593
+ setLoading('btnTranslatePolicy', 'policyOutput', true);
594
+
595
+ try {
596
+ const prompt = `
597
+ คุณคือผู้เชี่ยวชาญด้านการสื่อสารการเมืองท้องถิ่นอุดรธานี
598
+ จงแปลงนโยบายภาษาราชการนี้: "${policy}"
599
+
600
+ ให้เป็นภาษาพูดที่โดนใจกลุ่มเป้าหมาย: "${target}"
601
+
602
+ Guideline:
603
+ - ถ้าเป็นผู้เฒ่าผู้แก่: ใช้ภาษาอีสาน คำผญา เปรียบเปรยให้เห็นภาพ
604
+ - ถ้าเป็นวัยรุ่น: ใช้ภาษาทันสมัย สั้นๆ เหมือน Twitter/TikTok
605
+ - ถ้าเป็นพ่อค้าแม่ค้า: เน้นตัวเลข กำไร ความคุ้มค่า
606
+
607
+ ขอผลลัพธ์สั้นๆ (ไม่เกิน 3 บรรทัด) แต่ทรงพลัง
608
+ `;
609
+ const result = await model.generateContent(prompt);
610
+ outputDiv.innerHTML = `"${result.response.text()}"`;
611
+ } catch (error) {
612
+ outputDiv.textContent = "Error: " + error.message;
613
+ } finally {
614
+ setLoading('btnTranslatePolicy', 'policyOutput', false);
615
+ }
616
+ });
617
+
618
+ </script>
 
 
 
 
 
 
 
 
 
 
 
 
619
 
620
+ <!-- CHART JS -->
621
+ <script>
622
+ const commonTooltip = {
623
+ callbacks: {
624
+ title: function(tooltipItems) { return tooltipItems[0].chart.data.labels[tooltipItems[0].dataIndex]; }
625
+ }
626
+ };
627
+
628
+ // 1. Social Media Share of Voice
629
+ const ctxSocial = document.getElementById('socialChart').getContext('2d');
630
+ new Chart(ctxSocial, {
631
+ type: 'doughnut',
632
+ data: {
633
+ labels: ['TikTok (Gen Z/Y)', 'Facebook (Gen X/Boomer)', 'Line OA (Community Leaders)', 'YouTube/Others'],
634
+ datasets: [{
635
+ data: [45, 30, 20, 5],
636
+ backgroundColor: ['#000000', '#1877F2', '#00B900', '#FF0000'],
637
+ borderWidth: 2
638
+ }]
639
+ },
640
+ options: {
641
+ responsive: true,
642
+ maintainAspectRatio: false,
643
+ plugins: { legend: { position: 'right' } }
644
+ }
645
+ });
646
+
647
+ // 2. Competitor Radar
648
+ const ctxRadar = document.getElementById('radarChart').getContext('2d');
649
+ new Chart(ctxRadar, {
650
+ type: 'radar',
651
+ data: {
652
+ labels: ['ความนิยมส่วนตัว', 'นโยบาย (ที่ดิน/น้ำ)', 'กระแสพรรค', 'ทีมงานพื้นที่', 'งบ/ทรัพยากร'],
653
+ datasets: [{
654
+ label: 'ธนอนันต์ (กล้าธรรม)',
655
+ data: [75, 95, 70, 85, 90],
656
+ borderColor: '#6A0DAD',
657
+ backgroundColor: 'rgba(106, 13, 173, 0.2)',
658
+ pointBackgroundColor: '#6A0DAD'
659
+ }, {
660
+ label: 'คู่แข่ง (เพื่อไทยเดิม)',
661
+ data: [90, 70, 85, 80, 80],
662
+ borderColor: '#FF0000',
663
+ backgroundColor: 'rgba(255, 0, 0, 0.1)',
664
+ borderDash: [5, 5]
665
+ }]
666
+ },
667
+ options: {
668
+ responsive: true,
669
+ maintainAspectRatio: false,
670
+ scales: { r: { suggestedMin: 0, suggestedMax: 100 } }
671
+ }
672
+ });
673
  </script>
674
  </body>
675
  </html>