|
|
<!DOCTYPE html> |
|
|
<html lang="th"> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<title>เข้าร่วมกลุ่ม - Group Maker</title> |
|
|
<script src="https://cdn.tailwindcss.com"></script> |
|
|
<script src="https://unpkg.com/feather-icons"></script> |
|
|
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> |
|
|
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet"> |
|
|
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script> |
|
|
<style> |
|
|
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap'); |
|
|
|
|
|
body { |
|
|
font-family: 'Prompt', sans-serif; |
|
|
} |
|
|
|
|
|
.progress-bar { |
|
|
transition: width 0.5s ease; |
|
|
} |
|
|
|
|
|
.group-color-A { |
|
|
background-color: #ef4444; |
|
|
} |
|
|
|
|
|
.group-color-B { |
|
|
background-color: #3b82f6; |
|
|
} |
|
|
|
|
|
.group-color-C { |
|
|
background-color: #10b981; |
|
|
} |
|
|
|
|
|
.group-color-D { |
|
|
background-color: #f59e0b; |
|
|
} |
|
|
|
|
|
.group-color-E { |
|
|
background-color: #8b5cf6; |
|
|
} |
|
|
|
|
|
.pulse { |
|
|
animation: pulse 2s infinite; |
|
|
} |
|
|
|
|
|
@keyframes pulse { |
|
|
0% { |
|
|
transform: scale(1); |
|
|
} |
|
|
50% { |
|
|
transform: scale(1.05); |
|
|
} |
|
|
100% { |
|
|
transform: scale(1); |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</head> |
|
|
<body class="bg-gray-50"> |
|
|
|
|
|
<nav class="bg-white shadow-sm"> |
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> |
|
|
<div class="flex justify-between h-16"> |
|
|
<div class="flex"> |
|
|
<div class="flex-shrink-0 flex items-center"> |
|
|
<i data-feather="users" class="text-indigo-600 h-8 w-8"></i> |
|
|
<span class="ml-2 text-xl font-bold text-gray-900">Group Maker</span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="hidden sm:ml-6 sm:flex sm:items-center"> |
|
|
<a href="index.html" class="px-3 py-2 rounded-md text-sm font-medium text-gray-700 hover:text-indigo-600 hover:bg-gray-100">หน้าหลัก</a> |
|
|
</div> |
|
|
<div class="-mr-2 flex items-center sm:hidden"> |
|
|
<button type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500"> |
|
|
<i data-feather="menu" class="block h-6 w-6"></i> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</nav> |
|
|
|
|
|
|
|
|
<div class="max-w-md mx-auto py-12 px-4 sm:px-6 lg:px-8"> |
|
|
|
|
|
<div id="qr-section" class="bg-white p-6 rounded-lg shadow-md text-center" data-aos="fade-up"> |
|
|
<div class="flex justify-center"> |
|
|
<i data-feather="maximize-2" class="h-12 w-12 text-indigo-600"></i> |
|
|
</div> |
|
|
<h2 class="mt-4 text-xl font-bold text-gray-900">สแกน QR Code</h2> |
|
|
<p class="mt-2 text-gray-600">สแกน QR Code จากแอดมินเพื่อเข้าร่วมกิจกรรม</p> |
|
|
|
|
|
<div class="mt-6"> |
|
|
<button onclick="showJoinForm()" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"> |
|
|
<i data-feather="camera" class="mr-2"></i> สแกน QR Code |
|
|
</button> |
|
|
<p class="mt-2 text-sm text-gray-500">หรือกรอกรหัสกิจกรรมด้วยตนเอง</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div id="join-form-section" class="bg-white p-6 rounded-lg shadow-md mt-6 hidden" data-aos="fade-up"> |
|
|
<div class="flex justify-center"> |
|
|
<i data-feather="user-plus" class="h-12 w-12 text-indigo-600"></i> |
|
|
</div> |
|
|
<h2 class="mt-4 text-xl font-bold text-gray-900">เข้าร่วมกิจกรรม</h2> |
|
|
|
|
|
<div class="mt-6 space-y-4"> |
|
|
<div> |
|
|
<label for="session-id" class="block text-sm font-medium text-gray-700">รหัสกิจกรรม</label> |
|
|
<input type="text" id="session-id" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500"> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
<label for="user-name" class="block text-sm font-medium text-gray-700">ชื่อของคุณ</label> |
|
|
<input type="text" id="user-name" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500" placeholder="ชื่อเล่นหรือชื่อจริง"> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
<label for="user-id" class="block text-sm font-medium text-gray-700">รหัสประจำตัว (ไม่จำเป็น)</label> |
|
|
<input type="text" id="user-id" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500" placeholder="เช่น รหัสนักเรียน, รหัสพนักงาน"> |
|
|
</div> |
|
|
|
|
|
<div class="pt-2"> |
|
|
<button onclick="joinSession()" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"> |
|
|
<i data-feather="log-in" class="mr-2"></i> เข้าร่วมกิจกรรม |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div id="waiting-room" class="bg-white p-6 rounded-lg shadow-md mt-6 hidden" data-aos="fade-up"> |
|
|
<div class="flex justify-center"> |
|
|
<i data-feather="clock" class="h-12 w-12 text-indigo-600"></i> |
|
|
</div> |
|
|
<h2 class="mt-4 text-xl font-bold text-gray-900">กำลังรอผลการจัดกลุ่ม</h2> |
|
|
<p class="mt-2 text-gray-600">กิจกรรม: <span id="activity-name" class="font-medium">กิจกรรมทีมบิลด์ดิ้ง</span></p> |
|
|
|
|
|
<div class="mt-6"> |
|
|
<div class="flex justify-between text-sm text-gray-600"> |
|
|
<span>ผู้เข้าร่วมแล้ว</span> |
|
|
<span><span id="current-participants">12</span>/<span id="max-participants">30</span></span> |
|
|
</div> |
|
|
<div class="mt-1 w-full bg-gray-200 rounded-full h-2.5"> |
|
|
<div id="progress-bar" class="progress-bar bg-indigo-600 h-2.5 rounded-full" style="width: 40%"></div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="mt-6"> |
|
|
<div class="bg-indigo-50 p-4 rounded-md"> |
|
|
<div class="flex"> |
|
|
<div class="flex-shrink-0"> |
|
|
<i data-feather="info" class="h-5 w-5 text-indigo-600"></i> |
|
|
</div> |
|
|
<div class="ml-3"> |
|
|
<p class="text-sm text-indigo-700"> |
|
|
กรุณารอจนกว่าแอดมินจะเริ่มการจัดกลุ่ม ผลลัพธ์จะแสดงที่นี่โดยอัตโนมัติ |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div id="results-section" class="bg-white p-6 rounded-lg shadow-md mt-6 hidden" data-aos="fade-up"> |
|
|
<div class="flex justify-center"> |
|
|
<i data-feather="award" class="h-12 w-12 text-indigo-600"></i> |
|
|
</div> |
|
|
<h2 class="mt-4 text-xl font-bold text-gray-900">ผลการจัดกลุ่ม</h2> |
|
|
<p class="mt-2 text-gray-600">กิจกรรม: <span class="font-medium">กิจกรรมทีมบิลด์ดิ้ง</span></p> |
|
|
|
|
|
<div class="mt-6"> |
|
|
<div class="pulse bg-indigo-100 text-indigo-800 text-lg font-bold py-3 px-4 rounded-lg text-center"> |
|
|
คุณอยู่ใน <span id="user-group" class="group-color-A px-2 py-1 rounded">กลุ่ม A</span> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="mt-6 space-y-4"> |
|
|
<div class="group-card group-color-A p-4 rounded-lg shadow-sm"> |
|
|
<h3 class="font-bold text-white">กลุ่ม A</h3> |
|
|
<ul class="mt-2 space-y-1"> |
|
|
<li class="text-white">สมชาย ใจดี</li> |
|
|
<li class="text-white">คุณเอง</li> |
|
|
<li class="text-white">สุภาพร สวยงาม</li> |
|
|
</ul> |
|
|
</div> |
|
|
|
|
|
<div class="group-card group-color-B p-4 rounded-lg shadow-sm"> |
|
|
<h3 class="font-bold text-white">กลุ่ม B</h3> |
|
|
<ul class="mt-2 space-y-1"> |
|
|
<li class="text-white">วิเชษฐ์ เก่งมาก</li> |
|
|
<li class="text-white">อรุณี สดใส</li> |
|
|
<li class="text-white">ประเสริฐ ชัยชนะ</li> |
|
|
</ul> |
|
|
</div> |
|
|
|
|
|
<div class="group-card group-color-C p-4 rounded-lg shadow-sm"> |
|
|
<h3 class="font-bold text-white">กลุ่ม C</h3> |
|
|
<ul class="mt-2 space-y-1"> |
|
|
<li class="text-white">สมหมาย ใจเย็น</li> |
|
|
<li class="text-white">สุดารัตน์ น่ารัก</li> |
|
|
<li class="text-white">อนุชา กล้าหาญ</li> |
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="mt-6"> |
|
|
<button class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"> |
|
|
<i data-feather="save" class="mr-2"></i> บันทึกผลการจัดกลุ่ม |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<script> |
|
|
AOS.init(); |
|
|
feather.replace(); |
|
|
|
|
|
function showJoinForm() { |
|
|
document.getElementById('qr-section').classList.add('hidden'); |
|
|
document.getElementById('join-form-section').classList.remove('hidden'); |
|
|
} |
|
|
|
|
|
function joinSession() { |
|
|
const sessionId = document.getElementById('session-id').value; |
|
|
const userName = document.getElementById('user-name').value; |
|
|
|
|
|
if (!sessionId || !userName) { |
|
|
alert('กรุณากรอกรหัสกิจกรรมและชื่อของคุณ'); |
|
|
return; |
|
|
} |
|
|
|
|
|
|
|
|
document.getElementById('join-form-section').classList.add('hidden'); |
|
|
document.getElementById('waiting-room').classList.remove('hidden'); |
|
|
|
|
|
|
|
|
let participants = 12; |
|
|
const maxParticipants = 30; |
|
|
const interval = setInterval(() => { |
|
|
participants += Math.floor(Math.random() * 3); |
|
|
if (participants > maxParticipants) { |
|
|
participants = maxParticipants; |
|
|
clearInterval(interval); |
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
document.getElementById('waiting-room').classList.add('hidden'); |
|
|
document.getElementById('results-section').classList.remove('hidden'); |
|
|
|
|
|
|
|
|
const audio = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-positive-interface-beep-221.mp3'); |
|
|
audio.play(); |
|
|
}, 5000); |
|
|
} |
|
|
|
|
|
document.getElementById('current-participants').textContent = participants; |
|
|
const progressPercent = (participants / maxParticipants) * 100; |
|
|
document.getElementById('progress-bar').style.width = `${progressPercent}%`; |
|
|
}, 1000); |
|
|
} |
|
|
</script> |
|
|
</body> |
|
|
</html> |
|
|
|