File size: 8,839 Bytes
415c2ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GoalGenius Analyzer</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        .progress-bar {
            transition: width 0.5s ease-in-out;
        }
    </style>
</head>
<body class="bg-gray-100">
    <div class="container mx-auto px-4 py-8">
        <header class="text-center mb-12">
            <h1 class="text-4xl font-bold text-blue-800 mb-2">GoalGenius Analyzer ⚽</h1>
            <p class="text-gray-600">Advanced football match analysis powered by AI</p>
        </header>

        <div class="bg-white rounded-xl shadow-lg p-6 mb-8">
            <h2 class="text-2xl font-semibold mb-4">Upload Match Video</h2>
            <div class="border-2 border-dashed border-gray-300 rounded-lg p-8 text-center">
                <i class="fas fa-video text-4xl text-blue-500 mb-4"></i>
                <p class="mb-4">Drag and drop your A5 match video here</p>
                <input type="file" accept="video/*" class="hidden" id="video-upload">
                <button onclick="document.getElementById('video-upload').click()" 
                        class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg transition">
                    Select Video
                </button>
            </div>
        </div>

        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
            <!-- Team Statistics Card -->
            <div class="bg-white rounded-xl shadow-lg p-6">
                <h2 class="text-2xl font-semibold mb-4">Team Statistics</h2>
                <div class="space-y-4">
                    <div>
                        <div class="flex justify-between mb-1">
                            <span>Ball Possession</span>
                            <span id="possession-value">0%</span>
                        </div>
                        <div class="w-full bg-gray-200 rounded-full h-2.5">
                            <div id="possession-bar" class="progress-bar bg-blue-600 h-2.5 rounded-full" style="width: 0%"></div>
                        </div>
                    </div>
                    <div class="grid grid-cols-2 gap-4">
                        <div class="bg-blue-50 p-4 rounded-lg">
                            <p class="text-gray-500">Successful Passes</p>
                            <p id="success-passes" class="text-3xl font-bold text-blue-600">0</p>
                        </div>
                        <div class="bg-red-50 p-4 rounded-lg">
                            <p class="text-gray-500">Failed Passes</p>
                            <p id="failed-passes" class="text-3xl font-bold text-red-600">0</p>
                        </div>
                    </div>
                    <div class="grid grid-cols-2 gap-4">
                        <div class="bg-green-50 p-4 rounded-lg">
                            <p class="text-gray-500">Goals Scored</p>
                            <p id="goals-scored" class="text-3xl font-bold text-green-600">0</p>
                        </div>
                        <div class="bg-yellow-50 p-4 rounded-lg">
                            <p class="text-gray-500">Goals Conceded</p>
                            <p id="goals-conceded" class="text-3xl font-bold text-yellow-600">0</p>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Player Statistics Card -->
            <div class="bg-white rounded-xl shadow-lg p-6">
                <h2 class="text-2xl font-semibold mb-4">Player Statistics</h2>
                <div class="overflow-x-auto">
                    <table class="min-w-full">
                        <thead>
                            <tr class="border-b">
                                <th class="text-left py-2">Player</th>
                                <th class="text-center py-2">Minutes</th>
                                <th class="text-center py-2">Passes</th>
                                <th class="text-center py-2">Shots</th>
                            </tr>
                        </thead>
                        <tbody id="players-table">
                            <!-- Will be populated by JavaScript -->
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="bg-white rounded-xl shadow-lg p-6 mt-6">
            <h2 class="text-2xl font-semibold mb-4">Match Analysis</h2>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                <div class="bg-purple-50 p-4 rounded-lg">
                    <p class="text-gray-500">Positive Transitions</p>
                    <p id="positive-trans" class="text-3xl font-bold text-purple-600">0</p>
                </div>
                <div class="bg-orange-50 p-4 rounded-lg">
                    <p class="text-gray-500">Negative Transitions</p>
                    <p id="negative-trans" class="text-3xl font-bold text-orange-600">0</p>
                </div>
                <div class="bg-pink-50 p-4 rounded-lg">
                    <p class="text-gray-500">Shot Ratio</p>
                    <p id="shot-ratio" class="text-3xl font-bold text-pink-600">0:0</p>
                </div>
            </div>
        </div>

        <div class="text-center mt-8">
            <button id="analyze-btn" 
                    class="bg-green-600 hover:bg-green-700 text-white px-8 py-3 rounded-lg text-lg font-semibold transition disabled:bg-gray-400"
                    disabled>
                <i class="fas fa-play mr-2"></i>Start Analysis
            </button>
        </div>
    </div>

    <script>
        // Placeholder for analysis functionality
        document.getElementById('video-upload').addEventListener('change', function(e) {
            if (e.target.files.length > 0) {
                document.getElementById('analyze-btn').disabled = false;
                // Here you would handle the video file
            }
        });

        document.getElementById('analyze-btn').addEventListener('click', function() {
            // Simulate analysis with demo data
            document.getElementById('possession-value').textContent = '65%';
            document.getElementById('possession-bar').style.width = '65%';
            document.getElementById('success-passes').textContent = '124';
            document.getElementById('failed-passes').textContent = '38';
            document.getElementById('goals-scored').textContent = '4';
            document.getElementById('goals-conceded').textContent = '2';
            document.getElementById('positive-trans').textContent = '26';
            document.getElementById('negative-trans').textContent = '14';
            document.getElementById('shot-ratio').textContent = '15:8';

            // Simulate player data
            const playersTable = document.getElementById('players-table');
            playersTable.innerHTML = `
                <tr class="border-b">
                    <td class="py-2">Player 1</td>
                    <td class="text-center py-2">45</td>
                    <td class="text-center py-2">32/5</td>
                    <td class="text-center py-2">3</td>
                </tr>
                <tr class="border-b">
                    <td class="py-2">Player 2</td>
                    <td class="text-center py-2">45</td>
                    <td class="text-center py-2">28/7</td>
                    <td class="text-center py-2">2</td>
                </tr>
                <tr class="border-b">
                    <td class="py-2">Player 3</td>
                    <td class="text-center py-2">90</td>
                    <td class="text-center py-2">45/3</td>
                    <td class="text-center py-2">5</td>
                </tr>
                <tr class="border-b">
                    <td class="py-2">Player 4</td>
                    <td class="text-center py-2">90</td>
                    <td class="text-center py-2">38/8</td>
                    <td class="text-center py-2">4</td>
                </tr>
                <tr>
                    <td class="py-2">Player 5</td>
                    <td class="text-center py-2">45</td>
                    <td class="text-center py-2">20/4</td>
                    <td class="text-center py-2">1</td>
                </tr>
            `;

            this.disabled = true;
            this.innerHTML = '<i class="fas fa-check mr-2"></i>Analysis Complete';
            this.classList.remove('bg-green-600', 'hover:bg-green-700');
            this.classList.add('bg-gray-600');
        });
    </script>
</body>
</html>