Spaces:
Running
Running
mejorar pausa posesion, mejorar local visita - Follow Up Deployment
Browse files- README.md +6 -4
- index.html +664 -19
- prompts.txt +15 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: purple
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: buen-sonido
|
3 |
+
emoji: 馃惓
|
4 |
colorFrom: purple
|
5 |
+
colorTo: red
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,664 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="es">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>App Estad铆sticas F煤tbol</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
.history-item:nth-child(even) {
|
11 |
+
background-color: #f9fafb;
|
12 |
+
}
|
13 |
+
.history-item:hover {
|
14 |
+
background-color: #f3f4f6;
|
15 |
+
}
|
16 |
+
</style>
|
17 |
+
</head>
|
18 |
+
<body class="bg-gray-50 font-sans">
|
19 |
+
<div class="container mx-auto p-4 max-w-md">
|
20 |
+
<h1 class="text-2xl font-bold text-center mb-6 text-gray-800">Estad铆sticas de Partido</h1>
|
21 |
+
|
22 |
+
<!-- Selector de equipos -->
|
23 |
+
<div class="flex justify-between mb-6 bg-white p-4 rounded-lg shadow-sm">
|
24 |
+
<div class="w-2/5">
|
25 |
+
<input type="text" id="team-a-name" placeholder="Equipo A" class="w-full p-2 border-b-2 border-blue-500 focus:outline-none text-center font-medium text-blue-600">
|
26 |
+
</div>
|
27 |
+
<div class="w-1/5 text-center pt-2 text-gray-500">vs</div>
|
28 |
+
<div class="w-2/5">
|
29 |
+
<input type="text" id="team-b-name" placeholder="Equipo B" class="w-full p-2 border-b-2 border-red-500 focus:outline-none text-center font-medium text-red-600">
|
30 |
+
</div>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<!-- Temporizador de posesi贸n al estilo UEFA -->
|
34 |
+
<div class="mb-6 bg-white p-4 rounded-lg shadow-sm">
|
35 |
+
<h3 class="text-center font-medium text-gray-700 mb-4">Posesi贸n del Bal贸n</h3>
|
36 |
+
<div class="flex justify-around items-center mb-4">
|
37 |
+
<div class="text-center">
|
38 |
+
<div id="team-a-timer" class="text-4xl font-bold mb-2 text-gray-300">00:00</div>
|
39 |
+
<div class="text-sm font-medium text-blue-600" id="team-a-name-display">LOCAL</div>
|
40 |
+
</div>
|
41 |
+
<div class="text-center">
|
42 |
+
<div class="text-lg font-bold text-gray-500">TOTAL</div>
|
43 |
+
<div id="total-timer" class="text-2xl font-mono mb-1">00:00</div>
|
44 |
+
<button onclick="resetTotalTimer()" class="bg-gray-200 hover:bg-gray-300 text-gray-700 px-2 py-1 rounded text-xs">
|
45 |
+
<i class="fas fa-redo"></i>
|
46 |
+
</button>
|
47 |
+
</div>
|
48 |
+
<div class="text-center">
|
49 |
+
<div id="team-b-timer" class="text-4xl font-bold mb-2 text-gray-300">00:00</div>
|
50 |
+
<div class="text-sm font-medium text-red-600" id="team-b-name-display">VISITANTE</div>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
<div class="flex justify-around">
|
54 |
+
<button id="team-a-btn" onclick="togglePossession('team-a')" class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-lg text-lg font-bold">
|
55 |
+
<i class="fas fa-play"></i> LOCAL
|
56 |
+
</button>
|
57 |
+
<button id="team-b-btn" onclick="togglePossession('team-b')" class="bg-red-500 hover:bg-red-600 text-white px-6 py-3 rounded-lg text-lg font-bold">
|
58 |
+
VISITANTE <i class="fas fa-play"></i>
|
59 |
+
</button>
|
60 |
+
</div>
|
61 |
+
<div class="flex justify-center mt-4 gap-4">
|
62 |
+
<button onclick="resetPossessionTimer()" class="bg-gray-200 hover:bg-gray-300 text-gray-700 px-4 py-2 rounded">
|
63 |
+
<i class="fas fa-redo"></i> Reiniciar
|
64 |
+
</button>
|
65 |
+
<button id="pause-btn" onclick="togglePossessionPause()" class="bg-yellow-500 hover:bg-yellow-600 text-white px-4 py-2 rounded">
|
66 |
+
<i class="fas fa-pause"></i> Pausar
|
67 |
+
</button>
|
68 |
+
</div>
|
69 |
+
<div class="possession-bar mt-4 relative h-4 w-full bg-gray-200 rounded-full overflow-hidden">
|
70 |
+
<div id="team-a-possession" class="absolute h-full bg-blue-500 transition-all duration-1000 ease-linear" style="left: 0; width: 50%;"></div>
|
71 |
+
<div id="team-b-possession" class="absolute h-full bg-red-500 transition-all duration-1000 ease-linear" style="right: 0; width: 50%;"></div>
|
72 |
+
</div>
|
73 |
+
<div class="flex justify-between mt-2">
|
74 |
+
<span id="team-a-possession-percentage" class="font-bold text-blue-600">50%</span>
|
75 |
+
<span class="text-xs font-medium text-gray-500">POSESI脫N TOTAL</span>
|
76 |
+
<span id="team-b-possession-percentage" class="font-bold text-red-600">50%</span>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
|
80 |
+
<!-- Estad铆sticas -->
|
81 |
+
<div class="grid grid-cols-2 gap-4 mb-6">
|
82 |
+
<!-- Tarjetas amarillas -->
|
83 |
+
<div class="bg-white p-4 rounded-lg shadow-sm">
|
84 |
+
<h3 class="text-center font-medium text-gray-700 mb-2 flex justify-center items-center">
|
85 |
+
<i class="fas fa-square text-yellow-400 mr-2"></i> Tarjetas
|
86 |
+
</h3>
|
87 |
+
<div class="flex justify-between mb-2">
|
88 |
+
<span id="team-a-yellow" class="text-2xl font-bold text-blue-600">0</span>
|
89 |
+
<span id="team-b-yellow" class="text-2xl font-bold text-red-600">0</span>
|
90 |
+
</div>
|
91 |
+
<div class="flex justify-between">
|
92 |
+
<button onclick="changeCard('team-a', 'yellow', 'add')" class="bg-blue-500 hover:bg-blue-600 text-white px-3 py-1 rounded text-sm">
|
93 |
+
<i class="fas fa-plus"></i>
|
94 |
+
</button>
|
95 |
+
<button onclick="changeCard('team-a', 'yellow', 'remove')" class="bg-gray-200 hover:bg-gray-300 text-gray-700 px-3 py-1 rounded text-sm">
|
96 |
+
<i class="fas fa-minus"></i>
|
97 |
+
</button>
|
98 |
+
<button onclick="changeCard('team-b', 'yellow', 'remove')" class="bg-gray-200 hover:bg-gray-300 text-gray-700 px-3 py-1 rounded text-sm">
|
99 |
+
<i class="fas fa-minus"></i>
|
100 |
+
</button>
|
101 |
+
<button onclick="changeCard('team-b', 'yellow', 'add')" class="bg-red-500 hover:bg-red-600 text-white px-3 py-1 rounded text-sm">
|
102 |
+
<i class="fas fa-plus"></i>
|
103 |
+
</button>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
|
107 |
+
<!-- Corners -->
|
108 |
+
<div class="bg-white p-4 rounded-lg shadow-sm">
|
109 |
+
<h3 class="text-center font-medium text-gray-700 mb-2 flex justify-center items-center">
|
110 |
+
<i class="fas fa-flag mr-2 text-green-500"></i> Corners
|
111 |
+
</h3>
|
112 |
+
<div class="flex justify-between mb-2">
|
113 |
+
<span id="team-a-corners" class="text-2xl font-bold text-blue-600">0</span>
|
114 |
+
<span id="team-b-corners" class="text-2xl font-bold text-red-600">0</span>
|
115 |
+
</div>
|
116 |
+
<div class="flex justify-between">
|
117 |
+
<button onclick="changeCorner('team-a', 'add')" class="bg-blue-500 hover:bg-blue-600 text-white px-3 py-1 rounded text-sm">
|
118 |
+
<i class="fas fa-plus"></i>
|
119 |
+
</button>
|
120 |
+
<button onclick="changeCorner('team-a', 'remove')" class="bg-gray-200 hover:bg-gray-300 text-gray-700 px-3 py-1 rounded text-sm">
|
121 |
+
<i class="fas fa-minus"></i>
|
122 |
+
</button>
|
123 |
+
<button onclick="changeCorner('team-b', 'remove')" class="bg-gray-200 hover:bg-gray-300 text-gray-700 px-3 py-1 rounded text-sm">
|
124 |
+
<i class="fas fa-minus"></i>
|
125 |
+
</button>
|
126 |
+
<button onclick="changeCorner('team-b', 'add')" class="bg-red-500 hover:bg-red-600 text-white px-3 py-1 rounded text-sm">
|
127 |
+
<i class="fas fa-plus"></i>
|
128 |
+
</button>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
|
133 |
+
<!-- Historial -->
|
134 |
+
<div class="bg-white p-4 rounded-lg shadow-sm mb-4">
|
135 |
+
<h2 class="text-lg font-semibold text-gray-700 mb-3 flex items-center">
|
136 |
+
<i class="fas fa-history mr-2 text-gray-500"></i> Historial
|
137 |
+
</h2>
|
138 |
+
<div class="max-h-60 overflow-y-auto">
|
139 |
+
<table class="w-full border-collapse">
|
140 |
+
<thead class="bg-gray-100">
|
141 |
+
<tr>
|
142 |
+
<th class="p-2 text-xs text-left text-gray-600">Minuto</th>
|
143 |
+
<th class="p-2 text-xs text-left text-gray-600">Evento</th>
|
144 |
+
<th class="p-2 text-xs text-left text-gray-600">Posesi贸n</th>
|
145 |
+
</tr>
|
146 |
+
</thead>
|
147 |
+
<tbody id="history-list">
|
148 |
+
<!-- Aqu铆 se agregar谩n los elementos del historial din谩micamente -->
|
149 |
+
</tbody>
|
150 |
+
</table>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
+
|
154 |
+
<!-- Bot贸n para a帽adir evento manual -->
|
155 |
+
<div class="flex justify-between mb-4">
|
156 |
+
<input type="number" id="minute-input" placeholder="Minuto" class="w-24 p-2 border rounded" min="0">
|
157 |
+
<select id="event-type" class="p-2 border rounded">
|
158 |
+
<option value="possession">Cambio posesi贸n</option>
|
159 |
+
<option value="yellow">Tarjeta amarilla</option>
|
160 |
+
<option value="corner">Corner</option>
|
161 |
+
</select>
|
162 |
+
<select id="event-team" class="p-2 border rounded">
|
163 |
+
<option value="team-a">Equipo A</option>
|
164 |
+
<option value="team-b">Equipo B</option>
|
165 |
+
</select>
|
166 |
+
<button onclick="addManualEvent()" class="bg-green-500 hover:bg-green-600 text-white px-3 py-1 rounded">
|
167 |
+
<i class="fas fa-plus"></i>
|
168 |
+
</button>
|
169 |
+
</div>
|
170 |
+
|
171 |
+
<!-- Reset -->
|
172 |
+
<button onclick="resetAll()" class="w-full bg-gray-200 hover:bg-gray-300 text-gray-700 py-2 rounded font-medium flex items-center justify-center">
|
173 |
+
<i class="fas fa-redo mr-2"></i> Reiniciar Todo
|
174 |
+
</button>
|
175 |
+
</div>
|
176 |
+
|
177 |
+
<script>
|
178 |
+
// Variables de estado para el temporizador
|
179 |
+
let isPaused = false;
|
180 |
+
let possession = {
|
181 |
+
'team-a': 0,
|
182 |
+
'team-b': 0
|
183 |
+
};
|
184 |
+
let totalTime = 0;
|
185 |
+
let timerActive = false;
|
186 |
+
let currentTeam = null;
|
187 |
+
let startTime = null;
|
188 |
+
let lastUpdateTime = null;
|
189 |
+
let possessionIntervalId = null;
|
190 |
+
let totalIntervalId = null;
|
191 |
+
|
192 |
+
let stats = {
|
193 |
+
'team-a': {
|
194 |
+
'yellow': 0,
|
195 |
+
'corners': 0
|
196 |
+
},
|
197 |
+
'team-b': {
|
198 |
+
'yellow': 0,
|
199 |
+
'corners': 0
|
200 |
+
}
|
201 |
+
};
|
202 |
+
|
203 |
+
let history = [];
|
204 |
+
let lastPossessionChange = {
|
205 |
+
'team-a': 50,
|
206 |
+
'team-b': 50
|
207 |
+
};
|
208 |
+
|
209 |
+
// Actualizar la UI
|
210 |
+
function updateUI() {
|
211 |
+
document.getElementById('team-a-possession-percentage').textContent = `${possession['team-a']}%`;
|
212 |
+
document.getElementById('team-b-possession-percentage').textContent = `${possession['team-b']}%`;
|
213 |
+
document.getElementById('team-a-possession').style.width = `${possession['team-a']}%`;
|
214 |
+
document.getElementById('team-b-possession').style.width = `${possession['team-b']}%`;
|
215 |
+
|
216 |
+
document.getElementById('team-a-yellow').textContent = stats['team-a']['yellow'];
|
217 |
+
document.getElementById('team-b-yellow').textContent = stats['team-b']['yellow'];
|
218 |
+
|
219 |
+
document.getElementById('team-a-corners').textContent = stats['team-a']['corners'];
|
220 |
+
document.getElementById('team-b-corners').textContent = stats['team-b']['corners'];
|
221 |
+
}
|
222 |
+
|
223 |
+
// Cambiar posesi贸n
|
224 |
+
function changePossession(team, action) {
|
225 |
+
const step = 5;
|
226 |
+
let otherTeam = team === 'team-a' ? 'team-b' : 'team-a';
|
227 |
+
|
228 |
+
if (action === 'increase' && possession[team] < 100) {
|
229 |
+
possession[team] += step;
|
230 |
+
possession[otherTeam] -= step;
|
231 |
+
} else if (action === 'reduce' && possession[team] > 0) {
|
232 |
+
possession[team] -= step;
|
233 |
+
possession[otherTeam] += step;
|
234 |
+
}
|
235 |
+
|
236 |
+
// Guardar el estado antes del cambio para el historial
|
237 |
+
lastPossessionChange['team-a'] = possession['team-a'];
|
238 |
+
lastPossessionChange['team-b'] = possession['team-b'];
|
239 |
+
|
240 |
+
addHistoryEntry('Posesi贸n cambiada', 'possession');
|
241 |
+
updateUI();
|
242 |
+
}
|
243 |
+
|
244 |
+
// Reiniciar posesi贸n
|
245 |
+
function resetPossession() {
|
246 |
+
possession['team-a'] = 50;
|
247 |
+
possession['team-b'] = 50;
|
248 |
+
addHistoryEntry('Posesi贸n reiniciada', 'possession');
|
249 |
+
updateUI();
|
250 |
+
}
|
251 |
+
|
252 |
+
// Manejar tarjetas amarillas
|
253 |
+
function changeCard(team, type, action) {
|
254 |
+
if (action === 'add') {
|
255 |
+
stats[team][type]++;
|
256 |
+
} else if (action === 'remove' && stats[team][type] > 0) {
|
257 |
+
stats[team][type]--;
|
258 |
+
}
|
259 |
+
|
260 |
+
const teamName = document.getElementById(`${team}-name`).value || `Equipo ${team.split('-')[1].toUpperCase()}`;
|
261 |
+
addHistoryEntry(`Tarjeta amarilla - ${teamName}`, 'yellow');
|
262 |
+
updateUI();
|
263 |
+
}
|
264 |
+
|
265 |
+
// Manejar corners
|
266 |
+
function changeCorner(team, action) {
|
267 |
+
if (action === 'add') {
|
268 |
+
stats[team]['corners']++;
|
269 |
+
} else if (action === 'remove' && stats[team]['corners'] > 0) {
|
270 |
+
stats[team]['corners']--;
|
271 |
+
}
|
272 |
+
|
273 |
+
const teamName = document.getElementById(`${team}-name`).value || `Equipo ${team.split('-')[1].toUpperCase()}`;
|
274 |
+
addHistoryEntry(`Corner - ${teamName}`, 'corner');
|
275 |
+
updateUI();
|
276 |
+
}
|
277 |
+
|
278 |
+
// A帽adir entrada al historial
|
279 |
+
function addHistoryEntry(eventDescription, eventType) {
|
280 |
+
const now = new Date();
|
281 |
+
const currentMinute = Math.floor(now.getTime() / 60000) % 90; // Simulando minuto de partido
|
282 |
+
|
283 |
+
const entry = {
|
284 |
+
minute: currentMinute,
|
285 |
+
description: eventDescription,
|
286 |
+
type: eventType,
|
287 |
+
possessionA: possession['team-a'],
|
288 |
+
possessionB: possession['team-b'],
|
289 |
+
timestamp: now.toLocaleTimeString()
|
290 |
+
};
|
291 |
+
|
292 |
+
history.unshift(entry); // A帽adir al principio
|
293 |
+
renderHistory();
|
294 |
+
|
295 |
+
// Guardar en localStorage
|
296 |
+
localStorage.setItem('footballStats', JSON.stringify({
|
297 |
+
possession,
|
298 |
+
stats,
|
299 |
+
history,
|
300 |
+
teamNames: {
|
301 |
+
'team-a': document.getElementById('team-a-name').value,
|
302 |
+
'team-b': document.getElementById('team-b-name').value
|
303 |
+
}
|
304 |
+
}));
|
305 |
+
}
|
306 |
+
|
307 |
+
// A帽adir evento manual
|
308 |
+
function addManualEvent() {
|
309 |
+
const minute = document.getElementById('minute-input').value || '0';
|
310 |
+
const eventType = document.getElementById('event-type').value;
|
311 |
+
const team = document.getElementById('event-team').value;
|
312 |
+
const teamName = document.getElementById(`${team}-name`).value || `Equipo ${team.split('-')[1].toUpperCase()}`;
|
313 |
+
|
314 |
+
let description = '';
|
315 |
+
|
316 |
+
switch(eventType) {
|
317 |
+
case 'possession':
|
318 |
+
description = `Posesi贸n cambiada manualmente - ${teamName}`;
|
319 |
+
break;
|
320 |
+
case 'yellow':
|
321 |
+
description = `Tarjeta amarilla manual - ${teamName}`;
|
322 |
+
if (team === 'team-a') stats['team-a']['yellow']++;
|
323 |
+
else stats['team-b']['yellow']++;
|
324 |
+
break;
|
325 |
+
case 'corner':
|
326 |
+
description = `Corner manual - ${teamName}`;
|
327 |
+
if (team === 'team-a') stats['team-a']['corners']++;
|
328 |
+
else stats['team-b']['corners']++;
|
329 |
+
break;
|
330 |
+
}
|
331 |
+
|
332 |
+
const entry = {
|
333 |
+
minute: minute,
|
334 |
+
description: description,
|
335 |
+
type: eventType,
|
336 |
+
possessionA: possession['team-a'],
|
337 |
+
possessionB: possession['team-b'],
|
338 |
+
timestamp: new Date().toLocaleTimeString()
|
339 |
+
};
|
340 |
+
|
341 |
+
history.unshift(entry);
|
342 |
+
renderHistory();
|
343 |
+
updateUI();
|
344 |
+
|
345 |
+
// Limpiar inputs
|
346 |
+
document.getElementById('minute-input').value = '';
|
347 |
+
}
|
348 |
+
|
349 |
+
// Renderizar historial
|
350 |
+
function renderHistory() {
|
351 |
+
const historyList = document.getElementById('history-list');
|
352 |
+
historyList.innerHTML = '';
|
353 |
+
|
354 |
+
history.forEach((entry, index) => {
|
355 |
+
const row = document.createElement('tr');
|
356 |
+
row.className = `history-item border-t ${index % 2 === 0 ? '' : 'bg-gray-50'}`;
|
357 |
+
|
358 |
+
row.innerHTML = `
|
359 |
+
<td class="p-2 text-sm text-gray-600">${entry.minute}'</td>
|
360 |
+
<td class="p-2 text-sm ${getEventColor(entry.type)}">${entry.description}</td>
|
361 |
+
<td class="p-2 text-xs text-gray-500">${entry.possessionA}% - ${entry.possessionB}%</td>
|
362 |
+
`;
|
363 |
+
|
364 |
+
historyList.appendChild(row);
|
365 |
+
});
|
366 |
+
}
|
367 |
+
|
368 |
+
// Obtener color seg煤n tipo de evento
|
369 |
+
function getEventColor(type) {
|
370 |
+
switch(type) {
|
371 |
+
case 'possession': return 'text-blue-500';
|
372 |
+
case 'yellow': return 'text-yellow-500';
|
373 |
+
case 'corner': return 'text-green-500';
|
374 |
+
case 'pause': return 'text-gray-500';
|
375 |
+
case 'resume': return 'text-green-500';
|
376 |
+
default: return 'text-gray-600';
|
377 |
+
}
|
378 |
+
}
|
379 |
+
|
380 |
+
// Reiniciar todo
|
381 |
+
function resetAll() {
|
382 |
+
if (confirm('驴Est谩s seguro de que quieres reiniciar todas las estad铆sticas?')) {
|
383 |
+
possession = {
|
384 |
+
'team-a': 50,
|
385 |
+
'team-b': 50
|
386 |
+
};
|
387 |
+
|
388 |
+
stats = {
|
389 |
+
'team-a': {
|
390 |
+
'yellow': 0,
|
391 |
+
'corners': 0
|
392 |
+
},
|
393 |
+
'team-b': {
|
394 |
+
'yellow': 0,
|
395 |
+
'corners': 0
|
396 |
+
}
|
397 |
+
};
|
398 |
+
|
399 |
+
history = [];
|
400 |
+
|
401 |
+
document.getElementById('team-a-name').value = '';
|
402 |
+
document.getElementById('team-b-name').value = '';
|
403 |
+
|
404 |
+
updateUI();
|
405 |
+
renderHistory();
|
406 |
+
localStorage.removeItem('footballStats');
|
407 |
+
}
|
408 |
+
}
|
409 |
+
|
410 |
+
// Cargar datos guardados
|
411 |
+
function loadSavedData() {
|
412 |
+
const savedData = localStorage.getItem('footballStats');
|
413 |
+
if (savedData) {
|
414 |
+
const data = JSON.parse(savedData);
|
415 |
+
possession = data.possession;
|
416 |
+
stats = data.stats;
|
417 |
+
history = data.history || [];
|
418 |
+
|
419 |
+
if (data.teamNames) {
|
420 |
+
document.getElementById('team-a-name').value = data.teamNames['team-a'] || '';
|
421 |
+
document.getElementById('team-b-name').value = data.teamNames['team-b'] || '';
|
422 |
+
}
|
423 |
+
|
424 |
+
updateUI();
|
425 |
+
renderHistory();
|
426 |
+
}
|
427 |
+
}
|
428 |
+
|
429 |
+
// Guardar nombres de equipos al cambiar
|
430 |
+
document.getElementById('team-a-name').addEventListener('change', saveTeamNames);
|
431 |
+
document.getElementById('team-b-name').addEventListener('change', saveTeamNames);
|
432 |
+
|
433 |
+
function saveTeamNames() {
|
434 |
+
const savedData = localStorage.getItem('footballStats');
|
435 |
+
if (savedData) {
|
436 |
+
const data = JSON.parse(savedData);
|
437 |
+
data.teamNames = {
|
438 |
+
'team-a': document.getElementById('team-a-name').value,
|
439 |
+
'team-b': document.getElementById('team-b-name').value
|
440 |
+
};
|
441 |
+
localStorage.setItem('footballStats', JSON.stringify(data));
|
442 |
+
}
|
443 |
+
}
|
444 |
+
|
445 |
+
// Funciones del temporizador de posesi贸n
|
446 |
+
function togglePossession(team) {
|
447 |
+
const now = new Date();
|
448 |
+
|
449 |
+
// Si est谩 pausado, no hacer nada
|
450 |
+
if (isPaused) return;
|
451 |
+
|
452 |
+
// Si ya est谩 activo para este equipo, detener
|
453 |
+
if (timerActive && currentTeam === team) {
|
454 |
+
stopTimer();
|
455 |
+
return;
|
456 |
+
}
|
457 |
+
|
458 |
+
// Si hay otro temporizador activo, transferir tiempo
|
459 |
+
if (timerActive) {
|
460 |
+
const elapsed = (now - lastUpdateTime) / 1000;
|
461 |
+
possession[currentTeam] += elapsed;
|
462 |
+
updateTimers();
|
463 |
+
}
|
464 |
+
|
465 |
+
// Iniciar nuevo temporizador
|
466 |
+
currentTeam = team;
|
467 |
+
timerActive = true;
|
468 |
+
startTime = now;
|
469 |
+
lastUpdateTime = now;
|
470 |
+
|
471 |
+
// Actualizar botones UI
|
472 |
+
document.getElementById('team-a-btn').disabled = (team === 'team-a');
|
473 |
+
document.getElementById('team-b-btn').disabled = (team === 'team-b');
|
474 |
+
|
475 |
+
// Iniciar intervalos de actualizaci贸n
|
476 |
+
if (!possessionIntervalId) {
|
477 |
+
possessionIntervalId = setInterval(updateTimers, 1000);
|
478 |
+
}
|
479 |
+
// Iniciar total timer solo si no est谩 corriendo
|
480 |
+
if (!totalIntervalId) {
|
481 |
+
totalIntervalId = setInterval(updateTotalTimer, 1000);
|
482 |
+
totalTime = 0; // Reset total timer when first starting possession
|
483 |
+
}
|
484 |
+
addHistoryEntry(`Posesi贸n: ${team === 'team-a' ? 'Local' : 'Visitante'}`, 'possession');
|
485 |
+
}
|
486 |
+
|
487 |
+
// Manejar pausa/reanudaci贸n
|
488 |
+
function togglePossessionPause() {
|
489 |
+
const now = new Date();
|
490 |
+
isPaused = !isPaused;
|
491 |
+
const pauseBtn = document.getElementById('pause-btn');
|
492 |
+
|
493 |
+
if (isPaused) {
|
494 |
+
if (timerActive) {
|
495 |
+
// Save elapsed time before pause
|
496 |
+
const elapsed = (now - lastUpdateTime) / 1000;
|
497 |
+
possession[currentTeam] += elapsed;
|
498 |
+
lastUpdateTime = now;
|
499 |
+
}
|
500 |
+
pauseBtn.innerHTML = '<i class="fas fa-play"></i> Reanudar';
|
501 |
+
pauseBtn.classList.remove('bg-yellow-500', 'hover:bg-yellow-600');
|
502 |
+
pauseBtn.classList.add('bg-green-500', 'hover:bg-green-600');
|
503 |
+
addHistoryEntry('Posesi贸n pausada (falta)', 'pause');
|
504 |
+
} else {
|
505 |
+
if (timerActive) {
|
506 |
+
// Update lastUpdateTime when resuming to avoid counting paused time
|
507 |
+
lastUpdateTime = new Date();
|
508 |
+
}
|
509 |
+
pauseBtn.innerHTML = '<i class="fas fa-pause"></i> Pausar';
|
510 |
+
pauseBtn.classList.remove('bg-green-500', 'hover:bg-green-600');
|
511 |
+
pauseBtn.classList.add('bg-yellow-500', 'hover:bg-yellow-600');
|
512 |
+
addHistoryEntry('Posesi贸n reanudada', 'resume');
|
513 |
+
}
|
514 |
+
}
|
515 |
+
|
516 |
+
function stopTimer(stopTotalTimer = false) {
|
517 |
+
if (!timerActive) return;
|
518 |
+
|
519 |
+
clearInterval(possessionIntervalId);
|
520 |
+
possessionIntervalId = null;
|
521 |
+
timerActive = false;
|
522 |
+
|
523 |
+
// Solo detener el total timer si se especifica
|
524 |
+
if (stopTotalTimer) {
|
525 |
+
clearInterval(totalIntervalId);
|
526 |
+
totalIntervalId = null;
|
527 |
+
}
|
528 |
+
|
529 |
+
const now = new Date();
|
530 |
+
const elapsed = (now - lastUpdateTime) / 1000;
|
531 |
+
possession[currentTeam] += elapsed;
|
532 |
+
|
533 |
+
// Restablecer botones
|
534 |
+
document.getElementById('team-a-btn').disabled = false;
|
535 |
+
document.getElementById('team-b-btn').disabled = false;
|
536 |
+
|
537 |
+
updateTimers();
|
538 |
+
calculatePossessionPercentages();
|
539 |
+
}
|
540 |
+
|
541 |
+
function updateTimers() {
|
542 |
+
const now = new Date();
|
543 |
+
|
544 |
+
if (timerActive && !isPaused) {
|
545 |
+
const elapsed = (now - lastUpdateTime) / 1000;
|
546 |
+
possession[currentTeam] += elapsed;
|
547 |
+
lastUpdateTime = now;
|
548 |
+
|
549 |
+
// Actualizar la barra de posesi贸n en tiempo real
|
550 |
+
calculatePossessionPercentages();
|
551 |
+
|
552 |
+
// Agregar entrada al historial cada 30s de posesi贸n
|
553 |
+
const totalSec = Math.floor(possession[currentTeam]);
|
554 |
+
if (totalSec % 30 === 0 && totalSec > 0) {
|
555 |
+
addHistoryEntry(`Posesi贸n continua ${currentTeam === 'team-a' ? 'Local' : 'Visitante'} (${formatTime(totalSec)})`, 'possession');
|
556 |
+
}
|
557 |
+
}
|
558 |
+
|
559 |
+
// Mostrar todos los tiempos
|
560 |
+
document.getElementById('team-a-timer').textContent = formatTime(possession['team-a']);
|
561 |
+
document.getElementById('team-b-timer').textContent = formatTime(possession['team-b']);
|
562 |
+
|
563 |
+
function updateTotalTimer() {
|
564 |
+
totalTime++;
|
565 |
+
document.getElementById('total-timer').textContent = formatTime(totalTime);
|
566 |
+
}
|
567 |
+
|
568 |
+
// Actualizar porcentajes incluso cuando el temporizador no est谩 activo
|
569 |
+
if (!timerActive || isPaused) {
|
570 |
+
calculatePossessionPercentages();
|
571 |
+
}
|
572 |
+
}
|
573 |
+
|
574 |
+
function resetPossessionTimer() {
|
575 |
+
stopTimer(true); // Also stop total timer
|
576 |
+
|
577 |
+
possession = {
|
578 |
+
'team-a': 0,
|
579 |
+
'team-b': 0
|
580 |
+
};
|
581 |
+
|
582 |
+
currentTeam = null;
|
583 |
+
updateTimers();
|
584 |
+
calculatePossessionPercentages();
|
585 |
+
addHistoryEntry('Posesi贸n reiniciada', 'possession');
|
586 |
+
}
|
587 |
+
|
588 |
+
function resetTotalTimer() {
|
589 |
+
totalTime = 0;
|
590 |
+
document.getElementById('total-timer').textContent = '00:00';
|
591 |
+
addHistoryEntry('Temporizador total reiniciado', 'possession');
|
592 |
+
|
593 |
+
// Keep timer running if it was running
|
594 |
+
if (!totalIntervalId && timerActive) {
|
595 |
+
totalIntervalId = setInterval(updateTotalTimer, 1000);
|
596 |
+
}
|
597 |
+
}
|
598 |
+
|
599 |
+
function calculatePossessionPercentages() {
|
600 |
+
const total = possession['team-a'] + possession['team-b'];
|
601 |
+
|
602 |
+
// Calcular porcentajes
|
603 |
+
let teamAPercent, teamBPercent;
|
604 |
+
|
605 |
+
if (total === 0) {
|
606 |
+
teamAPercent = 50;
|
607 |
+
teamBPercent = 50;
|
608 |
+
} else {
|
609 |
+
teamAPercent = Math.max(0, Math.min(100, (possession['team-a'] / total) * 100));
|
610 |
+
teamBPercent = 100 - teamAPercent;
|
611 |
+
}
|
612 |
+
|
613 |
+
// Actualizar UI con animaci贸n suave
|
614 |
+
document.getElementById('team-a-possession-percentage').textContent = Math.round(teamAPercent) + '%';
|
615 |
+
document.getElementById('team-b-possession-percentage').textContent = Math.round(teamBPercent) + '%';
|
616 |
+
|
617 |
+
const teamABar = document.getElementById('team-a-possession');
|
618 |
+
const teamBBar = document.getElementById('team-b-possession');
|
619 |
+
|
620 |
+
teamABar.style.width = `${teamAPercent}%`;
|
621 |
+
teamBBar.style.width = `${teamBPercent}%`;
|
622 |
+
|
623 |
+
// Asegurar que las barras no se solapen
|
624 |
+
if (teamAPercent > 99.5) {
|
625 |
+
teamABar.style.width = '100%';
|
626 |
+
teamBBar.style.width = '0%';
|
627 |
+
} else if (teamBPercent > 99.5) {
|
628 |
+
teamBBar.style.width = '100%';
|
629 |
+
teamABar.style.width = '0%';
|
630 |
+
}
|
631 |
+
}
|
632 |
+
|
633 |
+
function formatTime(seconds) {
|
634 |
+
const mins = Math.floor(seconds / 60);
|
635 |
+
const secs = Math.floor(seconds % 60);
|
636 |
+
return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
|
637 |
+
}
|
638 |
+
|
639 |
+
// Actualizar la UI
|
640 |
+
function updateUI() {
|
641 |
+
updateTimers();
|
642 |
+
calculatePossessionPercentages();
|
643 |
+
|
644 |
+
document.getElementById('team-a-yellow').textContent = stats['team-a']['yellow'];
|
645 |
+
document.getElementById('team-b-yellow').textContent = stats['team-b']['yellow'];
|
646 |
+
|
647 |
+
document.getElementById('team-a-corners').textContent = stats['team-a']['corners'];
|
648 |
+
document.getElementById('team-b-corners').textContent = stats['team-b']['corners'];
|
649 |
+
|
650 |
+
// Mostrar nombres de equipos
|
651 |
+
const teamAName = document.getElementById('team-a-name').value || 'LOCAL';
|
652 |
+
const teamBName = document.getElementById('team-b-name').value || 'VISITANTE';
|
653 |
+
document.getElementById('team-a-name-display').textContent = teamAName;
|
654 |
+
document.getElementById('team-b-name-display').textContent = teamBName;
|
655 |
+
}
|
656 |
+
|
657 |
+
// Inicializar
|
658 |
+
document.addEventListener('DOMContentLoaded', function() {
|
659 |
+
loadSavedData();
|
660 |
+
updateUI();
|
661 |
+
});
|
662 |
+
</script>
|
663 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 馃К <a href="https://enzostvs-deepsite.hf.space?remix=JairoSC/buen-sonido" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
664 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Genera una aplicacion minimalista para uso en smartphone, para medir la posecion del balon entre dos equipos, ademas tarjetas amaraillas por equipo, corners. mantener historial de todas las estadisticas incluyendo la barra de posecion la cual se disputa en medicion dividida al 100%
|
2 |
+
la medicion de la posecion es por medio de un reloj digital tipo ajedrez basico como lo ocupa la uefa
|
3 |
+
mejora la division segun el tiempo de posecion de cada equipo se muestre en barra posesion total
|
4 |
+
mejorar posesion del balo entre cada equipo, la barra de estadistica debe ser en movimiento segun el tiempo de cada equipo
|
5 |
+
agregar boton de pausa ante una falta detener la posesion
|
6 |
+
el tiempo total debe continuar, solo pausar los tiempos de posesion
|
7 |
+
Tiempo total agregar reset y hacer que sea continuo
|
8 |
+
tiempo total, automatizar para el inicio del partido, no detener hasta que se indique, iniciar al tocar "local" o " visitante"
|
9 |
+
total time iniciar press local or vist
|
10 |
+
mejorar tiempo total, no se incia que sucede?
|
11 |
+
tiempo total boton inicio, reinicio, ajuste avanzado
|
12 |
+
no pausar tiempo total, solo pausar posesiones
|
13 |
+
independizar, separar, tiempo total mantener activo mientras se pausa la posecion, este tiempo total indica la hora del partido.
|
14 |
+
reconstruir tiempo, posesion con pausa y disputa balon en 100%, boton local visita
|
15 |
+
mejorar pausa posesion, mejorar local visita
|