kritsanan commited on
Commit
4d5f225
·
verified ·
1 Parent(s): 03991c0

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +155 -511
index.html CHANGED
@@ -23,16 +23,10 @@
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
 
@@ -46,12 +40,6 @@
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;
@@ -64,16 +52,6 @@
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 {
@@ -90,586 +68,252 @@
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 = "AIzaSyB8VwyTzgru8TrD13z2HaU1354UBpBKhtw";
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>
 
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
  <style>
27
  body {
28
  font-family: 'Noto Sans Thai', sans-serif;
29
+ background-color: #F8F7FF;
30
  color: #1F2937;
31
  }
32
 
 
40
  max-height: 400px;
41
  }
42
 
 
 
 
 
 
 
43
  .info-card {
44
  background-color: white;
45
  border-radius: 0.75rem;
 
52
  .info-card:hover {
53
  transform: translateY(-2px);
54
  border-top-color: #6A0DAD;
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
  .loader {
 
68
  0% { transform: rotate(0deg); }
69
  100% { transform: rotate(360deg); }
70
  }
 
 
 
 
 
71
  </style>
72
  </head>
73
  <body class="bg-gray-100">
74
 
75
  <!-- Header Section -->
76
+ <header class="bg-gradient-to-r from-purple-800 via-purple-700 to-indigo-900 text-white py-12 px-4 shadow-xl text-center">
77
+ <div class="max-w-6xl mx-auto">
78
+ <div class="inline-block bg-white text-purple-900 px-4 py-1 rounded-full text-sm font-bold mb-4 shadow-md">
79
  ROADMAP TO VICTORY 2026 (2569)
80
  </div>
81
+ <h1 class="text-4xl md:text-6xl font-extrabold mb-2">ธนอนันต์ เมนะสวัสดิ์</h1>
82
  <h2 class="text-2xl md:text-3xl font-light opacity-90">พรรคกล้าธรรม | อุดรธานี เขต 6</h2>
 
 
 
 
83
  </div>
84
  </header>
85
 
86
+ <main class="max-w-7xl mx-auto p-4 md:p-8 space-y-8">
87
 
88
+ <!-- Intro Stats -->
89
  <section class="grid grid-cols-1 md:grid-cols-4 gap-6">
90
  <div class="info-card border-l-8 border-purple-600 text-center">
91
+ <div class="text-gray-500 font-bold uppercase text-xs">เป้าหมายคะแนน</div>
92
  <div class="text-4xl font-extrabold text-purple-700 mt-2">42,000+</div>
 
93
  </div>
94
  <div class="info-card border-l-8 border-yellow-500 text-center">
95
+ <div class="text-gray-500 font-bold uppercase text-xs">กลุ่มเป้าหมายหลัก</div>
96
  <div class="text-4xl font-extrabold text-yellow-600 mt-2">New Gen</div>
 
97
  </div>
98
  <div class="info-card border-l-8 border-indigo-500 text-center">
99
+ <div class="text-gray-500 font-bold uppercase text-xs">ฐานเสียงเดิม</div>
100
  <div class="text-4xl font-extrabold text-indigo-600 mt-2">Family</div>
 
101
  </div>
102
+ <div class="info-card border-l-8 border-pink-500 text-center">
103
+ <div class="text-gray-500 font-bold uppercase text-xs">งบดิจิทัล</div>
104
  <div class="text-4xl font-extrabold text-pink-600 mt-2">40%</div>
 
105
  </div>
106
  </section>
107
 
108
+ <!-- ECT Compliance Section -->
109
+ <section class="bg-red-50 border-2 border-red-200 rounded-2xl p-6 shadow-sm">
110
+ <h3 class="text-xl font-bold text-red-700 flex items-center gap-2 mb-4">
111
+ ⚖️ ศูนย์เฝ้าระวังระเบียบ กกต. (ECT Compliance Monitor)
112
+ </h3>
113
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4 text-sm">
114
+ <div class="bg-white p-3 rounded-lg border border-red-100">
115
+ <h4 class="font-bold text-red-600 mb-1">🚫 มาตรา 73 (ข้อห้ามหาเสียง)</h4>
116
+ <ul class="list-disc list-inside text-gray-600 space-y-1">
117
+ <li>ห้ามสัญญาว่าจะให้เงิน/ทรัพย์สิน</li>
118
+ <li>ห้ามจัดเลี้ยงหรือรับจัดเลี้ยง</li>
119
+ <li>ห้ามใส่ร้ายด้วยความเท็จ</li>
120
+ </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  </div>
122
+ <div class="bg-white p-3 rounded-lg border border-red-100">
123
+ <h4 class="font-bold text-red-600 mb-1">📱 ระเบียบโซเชียลมิเดีย</h4>
124
+ <ul class="list-disc list-inside text-gray-600 space-y-1">
125
+ <li>แจ้งบัญชีโซเชียลต่อ กกต. ก่อนโพสต์</li>
126
+ <li>บันทึกค่า Ads เป็นงบเลือกตั้ง</li>
127
+ <li>ห้ามใช้ AI บิดเบือนภาพเพื่อโจมตี</li>
128
+ </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  </div>
130
+ <div class="bg-white p-3 rounded-lg border border-red-100">
131
+ <h4 class="font-bold text-red-600 mb-1">🛡️ การป้องกันส่วนบุคคล</h4>
132
+ <ul class="list-disc list-inside text-gray-600 space-y-1">
133
+ <li>ห้ามพาดพิงสถาบันพระมหากษัตริย์</li>
134
+ <li>ห้ามโพสต์หาเสียงหลัง 18:00 น. ก่อนวันเลือกตั้ง</li>
135
+ <li>ห้ามเผยแพร่ผล Poll 7 วันสุดท้าย</li>
136
+ </ul>
 
 
 
 
 
 
 
 
137
  </div>
138
  </div>
139
  </section>
140
 
141
+ <!-- AI Tools Section -->
142
+ <section class="bg-gradient-to-br from-indigo-900 to-purple-800 rounded-2xl p-8 text-white shadow-xl">
143
+ <h3 class="text-3xl font-bold mb-8 border-b border-purple-400 pb-4">🤖 AI Strategic Partner</h3>
 
 
 
 
 
 
 
 
 
 
 
144
  <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
145
+ <!-- Caption Gen -->
146
+ <div class="bg-white text-gray-800 rounded-xl p-6 border-t-8 border-red-500">
147
+ <h4 class="text-xl font-bold text-purple-800 mb-1">✍️ ผู้ช่วยเขียนแคปชั่น</h4>
148
+ <p class="text-xs text-red-500 mb-4 font-bold flex items-center gap-1">
149
+ <span class="w-2 h-2 bg-red-500 rounded-full animate-ping"></span>
150
+ ระบบตรวจสอบระเบียบ กกต. ทำงานอยู่
151
+ </p>
152
+ <input type="text" id="captionTopic" class="w-full border p-2 rounded mb-4" placeholder="หัวข้อคอนเทนต์ หรือ นโยบายที่จะสื่อสาร...">
153
+ <select id="captionPlatform" class="w-full border p-2 rounded mb-4">
154
+ <option value="TikTok">TikTok (เน้นสั้น/ภาษาอีสาน)</option>
155
+ <option value="Facebook">Facebook (เน้นข้อมูล/ผลงาน)</option>
156
+ <option value="Line OA">Line OA (เน้นความใกล้ชิด)</option>
157
+ </select>
158
+ <button id="btnGenerateCaption" class="w-full bg-purple-600 hover:bg-purple-700 text-white font-bold py-3 rounded-lg transition-all">
159
+ สร้างแคปชั่นแบบปลอดภัย (ECT Safe)
160
+ </button>
161
+ <div id="captionOutputArea" class="hidden mt-4">
162
+ <div id="captionOutput" class="p-4 bg-gray-50 rounded-lg border border-gray-200 text-sm whitespace-pre-line"></div>
163
+ <div class="mt-2 p-2 bg-red-50 border border-red-200 rounded text-[10px] text-red-700 font-bold italic">
164
+ ⚠️ คำเตือน: ตรวจสอบบัญชีโซเชียลที่ใช้โพสต์ว่า "แจ้ง กกต. แล้ว" และเก็บภาพหน้าจอไว้รายงานค่าใช้จ่าย
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  </div>
 
 
 
166
  </div>
 
167
  </div>
168
 
169
+ <!-- Crisis Advisor -->
170
+ <div class="bg-white text-gray-800 rounded-xl p-6">
171
+ <h4 class="text-xl font-bold text-purple-800 mb-4">🛡️ ที่ปรึกษาแก้เกมดราม่า</h4>
172
+ <textarea id="crisisInput" rows="3" class="w-full border p-2 rounded mb-4" placeholder="ระบุสถานการณ์หรือข้อกล่าวหาจากคู่แข่ง..."></textarea>
173
+ <button id="btnGenerateStrategy" class="w-full bg-gray-800 hover:bg-black text-white font-bold py-3 rounded-lg transition-all">วิเคราะห์แนวทางแก้เกม</button>
174
+ <div id="strategyOutput" class="mt-4 p-4 bg-gray-50 rounded-lg hidden text-sm border-l-4 border-gray-400"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  </div>
176
  </div>
177
  </section>
178
 
179
+ <!-- Digital War Room Charts -->
180
+ <section class="bg-white rounded-2xl shadow-xl p-8 border border-purple-100">
181
+ <h3 class="text-2xl font-bold mb-6 text-gray-800 border-b pb-2">📊 Digital Landscape: อุดรฯ เขต 6</h3>
182
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-8 items-center">
183
+ <div class="chart-container">
184
+ <canvas id="socialChart"></canvas>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  </div>
186
+ <div class="space-y-4">
187
+ <div class="p-4 bg-purple-50 rounded-xl border border-purple-100">
188
+ <h5 class="font-bold text-purple-800">🎯 First Voters & New Gen</h5>
189
+ <p class="text-sm text-gray-600 mt-1">กลุ่ม TikTok อายุ 18-35 ปี คือกุญแจสำคัญในการทำลายฐานเสียงเดิม</p>
190
+ </div>
191
+ <div class="p-4 bg-blue-50 rounded-xl border border-blue-100">
192
+ <h5 class="font-bold text-blue-800">💬 Local Communities</h5>
193
+ <p class="text-sm text-gray-600 mt-1">เน้นการทำคอนเทนต์ "บ้านเฮา" โดยใช้ภาษาอีสานและวิถีชีวิตจริง</p>
194
+ </div>
 
195
  </div>
196
  </div>
197
  </section>
198
 
 
 
 
 
 
 
199
  </main>
200
 
 
201
  <script type="module">
202
  import { GoogleGenerativeAI } from "@google/generative-ai";
203
 
204
+ const apiKey = "AIzaSyB8VwyTzgru8TrD13z2HaU1354UBpBKhtw"; // API Key will be injected at runtime
 
205
  const genAI = new GoogleGenerativeAI(apiKey);
206
  const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash-preview-09-2025" });
207
 
208
+ // --- ENHANCED ECT COMPLIANCE SYSTEM PROMPT ---
209
+ const complianceInstruction = `
210
+ [SYSTEM ROLE]: คุณคือ "ผู้เชี่ยวชาญด้านยุทธศาสตร์ดิจิทัล" ประจำทีมคุณธนอนันต์ เมนะสวัสดิ์ (พรรคกล้าธรรม อุดรธานี เขต 6)
211
+
212
+ [ECT COMPLIANCE GUARDRAILS - กฎเหล็ก กกต.]:
213
+ 1. (มาตรา 73) ห้ามเขียนข้อความเชิงสัญญาว่าจะให้เงิน ทรัพย์สิน หรือประโยชน์อื่นใดทั้งทางตรงและทางอ้อม
214
+ 2. (นโยบาย) หากพูดถึงนโยบาย ให้ใช้คำว่า "นโยบายที่เราจะทำจริง" หรือ "วิสัยทัศน์เพื่อชาวเขต 6" แทนการรับปากส่วนตัว
215
+ 3. (ความเท็จ) ห้ามโจมตีบุคคลอื่นด้วยข้อมูลที่อาจเป็นเท็จ หรือใช้ภาษาที่รุนแรงใส่ร้าย
216
+ 4. (สถาบันฯ) ห้ามพาดพิงสถาบันพระมหากษัตริย์ไม่ว่ากรณีใดๆ
217
+ 5. (ภาษา) ใช้ภาษาอีสานผสมผสานอย่างลงตัว ดูจริงใจ เป็นกันเอง แต่สุภาพและมีความเป็นมืออาชีพ
218
+ 6. (ระเบียบโซเชียล) หากเป็นโพสต์ที่มีค่าใช้จ่าย ให้เน้นว่าเป็นการนำเสนอนโยบายเพื่อประโยชน์ส่วนรวม
219
+ `;
220
+
221
+ function setLoading(btnId, outputAreaId, isLoading) {
222
  const btn = document.getElementById(btnId);
223
+ const area = document.getElementById(outputAreaId);
224
  if (isLoading) {
225
  btn.disabled = true;
226
+ btn.innerHTML = '<span class="loader"></span> กำลังประมวลผล...';
227
+ if(area) area.classList.remove('hidden');
 
 
 
 
 
 
228
  } else {
229
  btn.disabled = false;
230
+ btn.innerHTML = btnId === 'btnGenerateCaption' ? 'สร้างแคปชั่นแบบปลอดภัย (ECT Safe)' : 'วิเคราะห์แนวทางแก้เกม';
 
231
  }
232
  }
233
 
234
+ // --- Feature: Caption Generator (With Compliance) ---
235
  document.getElementById('btnGenerateCaption').addEventListener('click', async () => {
236
  const topic = document.getElementById('captionTopic').value;
237
  const platform = document.getElementById('captionPlatform').value;
238
+ if(!topic) return;
239
 
240
+ setLoading('btnGenerateCaption', 'captionOutputArea', true);
241
+ const output = document.getElementById('captionOutput');
242
+ output.innerHTML = "กำลังตรวจสอบกฎ กกต. และสร้างเนื้อหา...";
243
 
244
  try {
245
  const prompt = `
246
+ ${complianceInstruction}
247
+ หัวข้อคอนเทนต์: "${topic}"
248
+ แพลตฟอร์ม: "${platform}"
249
 
250
+ TASK: เขียนแคปชั่นที่น่าสนใจ ดึงดูดชาวอุดรธานี เขต 6 ให้เข้าถึงนโยบายและวิสัยทัศน์ของคุณธนอนันต์
251
+ - หากเป็น TikTok ให้เน้น Hook 3 วินาทีแรก และคำคมอีสาน
252
+ - หากเป็น Facebook ให้เน้นรายละเอียดที่จับต้องได้
253
+ - ทุกคำต้องผ่านกฎการหาเสียง กกต. 100%
 
 
 
 
254
  `;
255
 
256
  const result = await model.generateContent(prompt);
257
+ output.innerHTML = result.response.text().trim();
258
+ } catch (err) {
259
+ output.innerHTML = "ขออภัย เกิดข้อผิดพลาดในระบบ AI กรุณาลองใหม่";
 
260
  } finally {
261
+ setLoading('btnGenerateCaption', null, false);
262
  }
263
  });
264
 
265
+ // --- Feature: Crisis Advisor ---
266
  document.getElementById('btnGenerateStrategy').addEventListener('click', async () => {
267
  const situation = document.getElementById('crisisInput').value;
268
+ if(!situation) return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
 
270
+ setLoading('btnGenerateStrategy', 'strategyOutput', true);
271
+ const output = document.getElementById('strategyOutput');
272
+ output.innerHTML = "กำลังวิเคราะห์สถานการณ์...";
 
 
 
 
 
273
 
274
  try {
275
  const prompt = `
276
+ ${complianceInstruction}
277
+ สถานการณ์: "${situation}"
 
278
 
279
+ TASK: แนะนำวิธีรับมือในเชิงยุทธศาสตร์การสื่อสาร (Crisis Management)
280
+ - ต้องไม่ใช่วิธีที่ผิดกฎหมายเลือกตั้ง
281
+ - เน้นการชี้แจงด้วยข้อเท็จจริง
282
+ - รักษาภาพลักษณ์ความ "กล้าธรรม" ของคุณธนอนันต์
 
283
  `;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  const result = await model.generateContent(prompt);
286
+ output.innerHTML = result.response.text().replace(/\n/g, '<br>');
287
+ } catch (err) {
288
+ output.innerHTML = "ไม่สามารถวิเคราะห์ได้ในขณะนี้";
289
  } finally {
290
+ setLoading('btnGenerateStrategy', null, false);
291
  }
292
  });
293
 
294
+ // Initialize Charts
295
+ window.onload = () => {
296
+ const ctxSocial = document.getElementById('socialChart').getContext('2d');
297
+ new Chart(ctxSocial, {
298
+ type: 'doughnut',
299
+ data: {
300
+ labels: ['TikTok (New Gen)', 'Facebook (Mass)', 'Line OA (Direct)', 'อื่นๆ'],
301
+ datasets: [{
302
+ data: [50, 25, 20, 5],
303
+ backgroundColor: ['#000000', '#1877F2', '#00B900', '#9333EA'],
304
+ borderWidth: 0
305
+ }]
306
+ },
307
+ options: {
308
+ responsive: true,
309
+ maintainAspectRatio: false,
310
+ plugins: {
311
+ legend: { position: 'bottom' },
312
+ title: { display: true, text: 'สัดส่วนเป้าหมายช่องทางดิจิทัล' }
313
+ }
314
+ }
315
+ });
316
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  </script>
318
  </body>
319
  </html>