File size: 4,951 Bytes
4a07d46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Engineer's Day Quiz Leaderboard</title>
    <script src="https://cdn.tailwindcss.com"></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>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <style>
        .gradient-bg {
            background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
        }
        .top-score {
            background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
        }
    </style>
</head>
<body class="min-h-screen bg-gray-100">
    <!-- Header -->
    <div class="gradient-bg text-white py-12 px-4">
        <div class="max-w-6xl mx-auto text-center">
            <h1 class="text-3xl md:text-5xl font-bold mb-4">Quiz Leaderboard</h1>
            <p class="text-lg md:text-xl">Top participants in the Engineer's Day Quiz</p>
        </div>
    </div>

    <!-- Leaderboard -->
    <div class="max-w-4xl mx-auto my-12 bg-white rounded-xl shadow-md overflow-hidden p-6">
        <div class="flex justify-between items-center mb-8">
            <h2 class="text-2xl font-bold text-gray-800">Top Scores</h2>
            <a href="index.html" class="text-blue-600 hover:text-blue-800 flex items-center">
                <i data-feather="arrow-left" class="mr-1"></i> Back to Quiz
            </a>
        </div>

        <div class="overflow-x-auto">
            <table class="min-w-full divide-y divide-gray-200">
                <thead class="bg-gray-50">
                    <tr>
                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Rank</th>
                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">College</th>
                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Department</th>
                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Score</th>
                    </tr>
                </thead>
                <tbody class="bg-white divide-y divide-gray-200" id="leaderboardBody">
                    <!-- Leaderboard data will be inserted here by JavaScript -->
                </tbody>
            </table>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            AOS.init();
            feather.replace();

            // Sample leaderboard data (in a real app, this would come from a database)
            const leaderboardData = [
                { name: "Rahul Sharma", college: "IIT Bombay", department: "Computer", score: 10 },
                { name: "Priya Patel", college: "NIT Surat", department: "Electrical", score: 9 },
                { name: "Amit Kumar", college: "BITS Pilani", department: "Mechanical", score: 9 },
                { name: "Neha Gupta", college: "DTU Delhi", department: "Electronics", score: 8 },
                { name: "Suresh Reddy", college: "IIIT Hyderabad", department: "Computer", score: 8 },
                { name: "Ananya Singh", college: "VJTI Mumbai", department: "Civil", score: 7 },
                { name: "Vikram Joshi", college: "COEP Pune", department: "Mechanical", score: 7 },
                { name: "Divya Nair", college: "PES Bangalore", department: "Computer", score: 6 },
                { name: "Arjun Malhotra", college: "Manipal Institute", department: "Electrical", score: 6 },
                { name: "Pooja Mehta", college: "SRM University", department: "Electronics", score: 5 }
            ];

            // Populate leaderboard
            const leaderboardBody = document.getElementById('leaderboardBody');
            leaderboardData.forEach((participant, index) => {
                const row = document.createElement('tr');
                row.className = index < 3 ? 'top-score text-white' : 'hover:bg-gray-50';
                
                row.innerHTML = `
                    <td class="px-6 py-4 whitespace-nowrap font-medium">${index + 1}</td>
                    <td class="px-6 py-4 whitespace-nowrap">${participant.name}</td>
                    <td class="px-6 py-4 whitespace-nowrap">${participant.college}</td>
                    <td class="px-6 py-4 whitespace-nowrap">${participant.department}</td>
                    <td class="px-6 py-4 whitespace-nowrap font-bold">${participant.score}/10</td>
                `;
                leaderboardBody.appendChild(row);
            });
        });
    </script>
</body>
</html>