Pnkj01 commited on
Commit
cbc430d
·
verified ·
1 Parent(s): 6664f49

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +677 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Pig
3
- emoji: 🏃
4
- colorFrom: blue
5
- colorTo: red
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: pig
3
+ emoji: 🐳
4
+ colorFrom: yellow
5
+ colorTo: purple
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,677 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Free Fire Headshot Trainer</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
+ @keyframes targetPulse {
11
+ 0% { transform: scale(1); opacity: 0.8; }
12
+ 50% { transform: scale(1.1); opacity: 1; }
13
+ 100% { transform: scale(1); opacity: 0.8; }
14
+ }
15
+
16
+ .target {
17
+ animation: targetPulse 2s infinite;
18
+ transition: all 0.3s ease;
19
+ }
20
+
21
+ .hit-effect {
22
+ position: absolute;
23
+ width: 100px;
24
+ height: 100px;
25
+ background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,0,0,0) 70%);
26
+ border-radius: 50%;
27
+ pointer-events: none;
28
+ transform: translate(-50%, -50%);
29
+ opacity: 0;
30
+ }
31
+
32
+ .headshot {
33
+ background: radial-gradient(circle, rgba(255,215,0,0.7) 0%, rgba(255,215,0,0) 70%);
34
+ }
35
+
36
+ .body-shot {
37
+ background: radial-gradient(circle, rgba(255,0,0,0.7) 0%, rgba(255,0,0,0) 70%);
38
+ }
39
+
40
+ #game-area {
41
+ touch-action: manipulation;
42
+ }
43
+
44
+ .damage-indicator {
45
+ position: absolute;
46
+ color: white;
47
+ font-weight: bold;
48
+ text-shadow: 1px 1px 2px black;
49
+ pointer-events: none;
50
+ transform: translate(-50%, -50%);
51
+ animation: floatUp 1s forwards;
52
+ }
53
+
54
+ @keyframes floatUp {
55
+ 0% { transform: translate(-50%, -50%); opacity: 1; }
56
+ 100% { transform: translate(-50%, -150%); opacity: 0; }
57
+ }
58
+
59
+ .crosshair {
60
+ position: fixed;
61
+ top: 50%;
62
+ left: 50%;
63
+ transform: translate(-50%, -50%);
64
+ width: 30px;
65
+ height: 30px;
66
+ pointer-events: none;
67
+ z-index: 1000;
68
+ }
69
+ </style>
70
+ </head>
71
+ <body class="bg-gray-900 text-white overflow-hidden">
72
+ <div class="crosshair">
73
+ <div class="relative w-full h-full">
74
+ <div class="absolute top-0 left-1/2 w-0.5 h-3 bg-red-500 transform -translate-x-1/2"></div>
75
+ <div class="absolute bottom-0 left-1/2 w-0.5 h-3 bg-red-500 transform -translate-x-1/2"></div>
76
+ <div class="absolute left-0 top-1/2 w-3 h-0.5 bg-red-500 transform -translate-y-1/2"></div>
77
+ <div class="absolute right-0 top-1/2 w-3 h-0.5 bg-red-500 transform -translate-y-1/2"></div>
78
+ <div class="absolute top-1/2 left-1/2 w-1.5 h-1.5 bg-red-500 rounded-full transform -translate-x-1/2 -translate-y-1/2"></div>
79
+ </div>
80
+ </div>
81
+
82
+ <div class="container mx-auto px-4 py-6">
83
+ <div class="flex justify-between items-center mb-4">
84
+ <h1 class="text-2xl font-bold text-yellow-400">
85
+ <i class="fas fa-crosshairs mr-2"></i> Free Fire Headshot Trainer
86
+ </h1>
87
+ <div class="flex items-center space-x-4">
88
+ <div class="bg-gray-800 px-3 py-1 rounded-lg">
89
+ <span class="text-yellow-400 font-bold" id="score">0</span>
90
+ <span class="text-gray-400">/</span>
91
+ <span class="text-gray-300" id="shots">0</span>
92
+ </div>
93
+ <div class="bg-gray-800 px-3 py-1 rounded-lg">
94
+ <span class="text-green-400 font-bold" id="accuracy">0%</span>
95
+ </div>
96
+ </div>
97
+ </div>
98
+
99
+ <div class="flex mb-4 space-x-2">
100
+ <button id="start-btn" class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded-lg font-bold">
101
+ <i class="fas fa-play mr-2"></i> Start
102
+ </button>
103
+ <button id="reset-btn" class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg font-bold">
104
+ <i class="fas fa-redo mr-2"></i> Reset
105
+ </button>
106
+ <button id="settings-btn" class="bg-gray-600 hover:bg-gray-700 px-4 py-2 rounded-lg font-bold">
107
+ <i class="fas fa-cog mr-2"></i> Settings
108
+ </button>
109
+ </div>
110
+
111
+ <div class="bg-gray-800 p-4 rounded-lg mb-4">
112
+ <h2 class="text-lg font-bold mb-2 text-yellow-400">
113
+ <i class="fas fa-info-circle mr-2"></i> Headshot Tips
114
+ </h2>
115
+ <ul class="list-disc pl-5 text-sm space-y-1">
116
+ <li>Aim slightly above the head to account for recoil</li>
117
+ <li>Use single shots or short bursts for better accuracy</li>
118
+ <li>Practice controlling weapon recoil patterns</li>
119
+ <li>Headshots deal 2.5x more damage than body shots</li>
120
+ <li>Move your crosshair in straight lines between targets</li>
121
+ </ul>
122
+ </div>
123
+
124
+ <div id="game-area" class="relative bg-gray-800 border-2 border-gray-700 rounded-lg overflow-hidden" style="height: 60vh;">
125
+ <div id="targets-container" class="relative w-full h-full"></div>
126
+ <div id="results" class="absolute inset-0 bg-black bg-opacity-80 flex flex-col items-center justify-center hidden">
127
+ <h2 class="text-3xl font-bold mb-4 text-yellow-400">Training Results</h2>
128
+ <div class="grid grid-cols-2 gap-4 mb-6">
129
+ <div class="bg-gray-700 p-4 rounded-lg">
130
+ <p class="text-gray-400">Total Shots</p>
131
+ <p class="text-2xl font-bold" id="final-shots">0</p>
132
+ </div>
133
+ <div class="bg-gray-700 p-4 rounded-lg">
134
+ <p class="text-gray-400">Headshots</p>
135
+ <p class="text-2xl font-bold text-yellow-400" id="final-headshots">0</p>
136
+ </div>
137
+ <div class="bg-gray-700 p-4 rounded-lg">
138
+ <p class="text-gray-400">Accuracy</p>
139
+ <p class="text-2xl font-bold text-green-400" id="final-accuracy">0%</p>
140
+ </div>
141
+ <div class="bg-gray-700 p-4 rounded-lg">
142
+ <p class="text-gray-400">Score</p>
143
+ <p class="text-2xl font-bold" id="final-score">0</p>
144
+ </div>
145
+ </div>
146
+ <button id="close-results" class="bg-blue-600 hover:bg-blue-700 px-6 py-3 rounded-lg font-bold text-lg">
147
+ <i class="fas fa-redo mr-2"></i> Try Again
148
+ </button>
149
+ </div>
150
+ </div>
151
+
152
+ <div class="mt-4 bg-gray-800 p-4 rounded-lg">
153
+ <h2 class="text-lg font-bold mb-2 text-yellow-400">
154
+ <i class="fas fa-trophy mr-2"></i> Progress
155
+ </h2>
156
+ <div class="flex items-center space-x-2 mb-2">
157
+ <div class="w-full bg-gray-700 rounded-full h-4">
158
+ <div id="progress-bar" class="bg-yellow-500 h-4 rounded-full" style="width: 0%"></div>
159
+ </div>
160
+ <span id="progress-text" class="text-sm font-bold">0%</span>
161
+ </div>
162
+ <p class="text-sm text-gray-400">Complete training sessions to improve your headshot ratio in Free Fire.</p>
163
+ </div>
164
+ </div>
165
+
166
+ <!-- Settings Modal -->
167
+ <div id="settings-modal" class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center hidden z-50">
168
+ <div class="bg-gray-800 rounded-lg p-6 w-full max-w-md">
169
+ <h2 class="text-2xl font-bold mb-4 text-yellow-400">
170
+ <i class="fas fa-cog mr-2"></i> Training Settings
171
+ </h2>
172
+
173
+ <div class="space-y-4">
174
+ <div>
175
+ <label class="block text-gray-300 mb-2">Target Count</label>
176
+ <input type="range" id="target-count" min="5" max="30" value="15" class="w-full">
177
+ <div class="flex justify-between text-sm text-gray-400">
178
+ <span>5</span>
179
+ <span id="target-count-value">15</span>
180
+ <span>30</span>
181
+ </div>
182
+ </div>
183
+
184
+ <div>
185
+ <label class="block text-gray-300 mb-2">Target Speed</label>
186
+ <input type="range" id="target-speed" min="1" max="5" value="3" class="w-full">
187
+ <div class="flex justify-between text-sm text-gray-400">
188
+ <span>Slow</span>
189
+ <span id="target-speed-value">Medium</span>
190
+ <span>Fast</span>
191
+ </div>
192
+ </div>
193
+
194
+ <div>
195
+ <label class="block text-gray-300 mb-2">Target Size</label>
196
+ <input type="range" id="target-size" min="1" max="3" value="2" class="w-full">
197
+ <div class="flex justify-between text-sm text-gray-400">
198
+ <span>Small</span>
199
+ <span id="target-size-value">Medium</span>
200
+ <span>Large</span>
201
+ </div>
202
+ </div>
203
+
204
+ <div class="flex items-center">
205
+ <input type="checkbox" id="headshot-only" class="mr-2">
206
+ <label for="headshot-only" class="text-gray-300">Headshots Only Mode</label>
207
+ </div>
208
+
209
+ <div class="flex items-center">
210
+ <input type="checkbox" id="moving-targets" class="mr-2" checked>
211
+ <label for="moving-targets" class="text-gray-300">Moving Targets</label>
212
+ </div>
213
+ </div>
214
+
215
+ <div class="mt-6 flex justify-end space-x-3">
216
+ <button id="cancel-settings" class="bg-gray-600 hover:bg-gray-700 px-4 py-2 rounded-lg">
217
+ Cancel
218
+ </button>
219
+ <button id="save-settings" class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded-lg font-bold">
220
+ Save Settings
221
+ </button>
222
+ </div>
223
+ </div>
224
+ </div>
225
+
226
+ <script>
227
+ // Game state
228
+ const state = {
229
+ score: 0,
230
+ shots: 0,
231
+ headshots: 0,
232
+ gameActive: false,
233
+ targets: [],
234
+ settings: {
235
+ targetCount: 15,
236
+ targetSpeed: 3,
237
+ targetSize: 2,
238
+ headshotOnly: false,
239
+ movingTargets: true
240
+ }
241
+ };
242
+
243
+ // DOM elements
244
+ const gameArea = document.getElementById('game-area');
245
+ const targetsContainer = document.getElementById('targets-container');
246
+ const startBtn = document.getElementById('start-btn');
247
+ const resetBtn = document.getElementById('reset-btn');
248
+ const settingsBtn = document.getElementById('settings-btn');
249
+ const scoreDisplay = document.getElementById('score');
250
+ const shotsDisplay = document.getElementById('shots');
251
+ const accuracyDisplay = document.getElementById('accuracy');
252
+ const progressBar = document.getElementById('progress-bar');
253
+ const progressText = document.getElementById('progress-text');
254
+ const resultsScreen = document.getElementById('results');
255
+ const finalShots = document.getElementById('final-shots');
256
+ const finalHeadshots = document.getElementById('final-headshots');
257
+ const finalAccuracy = document.getElementById('final-accuracy');
258
+ const finalScore = document.getElementById('final-score');
259
+ const closeResults = document.getElementById('close-results');
260
+ const settingsModal = document.getElementById('settings-modal');
261
+ const targetCountInput = document.getElementById('target-count');
262
+ const targetSpeedInput = document.getElementById('target-speed');
263
+ const targetSizeInput = document.getElementById('target-size');
264
+ const headshotOnlyInput = document.getElementById('headshot-only');
265
+ const movingTargetsInput = document.getElementById('moving-targets');
266
+ const targetCountValue = document.getElementById('target-count-value');
267
+ const targetSpeedValue = document.getElementById('target-speed-value');
268
+ const targetSizeValue = document.getElementById('target-size-value');
269
+ const saveSettingsBtn = document.getElementById('save-settings');
270
+ const cancelSettingsBtn = document.getElementById('cancel-settings');
271
+
272
+ // Initialize
273
+ function init() {
274
+ startBtn.addEventListener('click', startGame);
275
+ resetBtn.addEventListener('click', resetGame);
276
+ settingsBtn.addEventListener('click', showSettings);
277
+ closeResults.addEventListener('click', resetGame);
278
+ gameArea.addEventListener('click', handleShot);
279
+
280
+ // Settings controls
281
+ targetCountInput.addEventListener('input', updateSettingsDisplay);
282
+ targetSpeedInput.addEventListener('input', updateSettingsDisplay);
283
+ targetSizeInput.addEventListener('input', updateSettingsDisplay);
284
+ saveSettingsBtn.addEventListener('click', saveSettings);
285
+ cancelSettingsBtn.addEventListener('click', hideSettings);
286
+
287
+ updateSettingsDisplay();
288
+ }
289
+
290
+ // Update settings display
291
+ function updateSettingsDisplay() {
292
+ targetCountValue.textContent = targetCountInput.value;
293
+
294
+ const speedValue = parseInt(targetSpeedInput.value);
295
+ targetSpeedValue.textContent =
296
+ speedValue === 1 ? 'Slow' :
297
+ speedValue === 2 ? 'Medium Slow' :
298
+ speedValue === 3 ? 'Medium' :
299
+ speedValue === 4 ? 'Fast' : 'Very Fast';
300
+
301
+ const sizeValue = parseInt(targetSizeInput.value);
302
+ targetSizeValue.textContent =
303
+ sizeValue === 1 ? 'Small' :
304
+ sizeValue === 2 ? 'Medium' : 'Large';
305
+ }
306
+
307
+ // Show settings modal
308
+ function showSettings() {
309
+ targetCountInput.value = state.settings.targetCount;
310
+ targetSpeedInput.value = state.settings.targetSpeed;
311
+ targetSizeInput.value = state.settings.targetSize;
312
+ headshotOnlyInput.checked = state.settings.headshotOnly;
313
+ movingTargetsInput.checked = state.settings.movingTargets;
314
+ updateSettingsDisplay();
315
+ settingsModal.classList.remove('hidden');
316
+ }
317
+
318
+ // Hide settings modal
319
+ function hideSettings() {
320
+ settingsModal.classList.add('hidden');
321
+ }
322
+
323
+ // Save settings
324
+ function saveSettings() {
325
+ state.settings = {
326
+ targetCount: parseInt(targetCountInput.value),
327
+ targetSpeed: parseInt(targetSpeedInput.value),
328
+ targetSize: parseInt(targetSizeInput.value),
329
+ headshotOnly: headshotOnlyInput.checked,
330
+ movingTargets: movingTargetsInput.checked
331
+ };
332
+ hideSettings();
333
+ }
334
+
335
+ // Start game
336
+ function startGame() {
337
+ if (state.gameActive) return;
338
+
339
+ state.gameActive = true;
340
+ state.score = 0;
341
+ state.shots = 0;
342
+ state.headshots = 0;
343
+
344
+ updateUI();
345
+ createTargets();
346
+
347
+ startBtn.innerHTML = '<i class="fas fa-pause mr-2"></i> Pause';
348
+ startBtn.classList.remove('bg-green-600', 'hover:bg-green-700');
349
+ startBtn.classList.add('bg-yellow-600', 'hover:bg-yellow-700');
350
+ startBtn.removeEventListener('click', startGame);
351
+ startBtn.addEventListener('click', pauseGame);
352
+ }
353
+
354
+ // Pause game
355
+ function pauseGame() {
356
+ state.gameActive = false;
357
+ clearAllTargets();
358
+
359
+ startBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Resume';
360
+ startBtn.classList.remove('bg-yellow-600', 'hover:bg-yellow-700');
361
+ startBtn.classList.add('bg-green-600', 'hover:bg-green-700');
362
+ startBtn.removeEventListener('click', pauseGame);
363
+ startBtn.addEventListener('click', startGame);
364
+ }
365
+
366
+ // Reset game
367
+ function resetGame() {
368
+ state.gameActive = false;
369
+ state.score = 0;
370
+ state.shots = 0;
371
+ state.headshots = 0;
372
+
373
+ clearAllTargets();
374
+ resultsScreen.classList.add('hidden');
375
+
376
+ updateUI();
377
+
378
+ startBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Start';
379
+ startBtn.classList.remove('bg-yellow-600', 'hover:bg-yellow-700');
380
+ startBtn.classList.add('bg-green-600', 'hover:bg-green-700');
381
+ startBtn.removeEventListener('click', pauseGame);
382
+ startBtn.addEventListener('click', startGame);
383
+ }
384
+
385
+ // Create targets
386
+ function createTargets() {
387
+ if (!state.gameActive) return;
388
+
389
+ targetsContainer.innerHTML = '';
390
+ state.targets = [];
391
+
392
+ const targetCount = state.settings.targetCount;
393
+ const gameAreaRect = gameArea.getBoundingClientRect();
394
+
395
+ for (let i = 0; i < targetCount; i++) {
396
+ createTarget(gameAreaRect);
397
+ }
398
+ }
399
+
400
+ // Create a single target
401
+ function createTarget(gameAreaRect) {
402
+ const target = document.createElement('div');
403
+ target.className = 'target absolute cursor-pointer rounded-full bg-red-600 flex items-center justify-center';
404
+
405
+ // Set size based on settings
406
+ const size = state.settings.targetSize;
407
+ const targetSize = size === 1 ? 40 : size === 2 ? 60 : 80;
408
+ const headSize = size === 1 ? 12 : size === 2 ? 16 : 20;
409
+
410
+ target.style.width = `${targetSize}px`;
411
+ target.style.height = `${targetSize}px`;
412
+
413
+ // Create head (for headshot area)
414
+ const head = document.createElement('div');
415
+ head.className = 'absolute bg-blue-700 rounded-full';
416
+ head.style.width = `${headSize}px`;
417
+ head.style.height = `${headSize}px`;
418
+ head.style.top = '15%';
419
+ head.style.left = '50%';
420
+ head.style.transform = 'translateX(-50%)';
421
+
422
+ target.appendChild(head);
423
+
424
+ // Random position within game area (with padding)
425
+ const padding = 30;
426
+ const maxX = gameAreaRect.width - targetSize - padding;
427
+ const maxY = gameAreaRect.height - targetSize - padding;
428
+
429
+ let x = padding + Math.random() * maxX;
430
+ let y = padding + Math.random() * maxY;
431
+
432
+ target.style.left = `${x}px`;
433
+ target.style.top = `${y}px`;
434
+
435
+ // Add movement if enabled
436
+ if (state.settings.movingTargets) {
437
+ const speed = state.settings.targetSpeed * 0.5;
438
+ let xDirection = Math.random() > 0.5 ? 1 : -1;
439
+ let yDirection = Math.random() > 0.5 ? 1 : -1;
440
+
441
+ const moveTarget = () => {
442
+ if (!state.gameActive) return;
443
+
444
+ x += xDirection * speed;
445
+ y += yDirection * speed;
446
+
447
+ // Bounce off edges
448
+ if (x <= padding || x >= maxX) {
449
+ xDirection *= -1;
450
+ x = Math.max(padding, Math.min(x, maxX));
451
+ }
452
+
453
+ if (y <= padding || y >= maxY) {
454
+ yDirection *= -1;
455
+ y = Math.max(padding, Math.min(y, maxY));
456
+ }
457
+
458
+ target.style.left = `${x}px`;
459
+ target.style.top = `${y}px`;
460
+
461
+ requestAnimationFrame(moveTarget);
462
+ };
463
+
464
+ moveTarget();
465
+ }
466
+
467
+ // Add click handler
468
+ target.addEventListener('click', (e) => {
469
+ if (!state.gameActive) return;
470
+ e.stopPropagation();
471
+ handleTargetClick(target, e);
472
+ });
473
+
474
+ targetsContainer.appendChild(target);
475
+ state.targets.push(target);
476
+ }
477
+
478
+ // Handle target click
479
+ function handleTargetClick(target, e) {
480
+ if (!state.gameActive) return;
481
+
482
+ const rect = target.getBoundingClientRect();
483
+ const head = target.querySelector('div');
484
+ const headRect = head.getBoundingClientRect();
485
+
486
+ // Calculate click position relative to target
487
+ const clickX = e.clientX - rect.left;
488
+ const clickY = e.clientY - rect.top;
489
+
490
+ // Check if headshot (click within head area)
491
+ const isHeadshot =
492
+ clickX >= headRect.left - rect.left &&
493
+ clickX <= headRect.right - rect.left &&
494
+ clickY >= headRect.top - rect.top &&
495
+ clickY <= headRect.bottom - rect.top;
496
+
497
+ if (state.settings.headshotOnly && !isHeadshot) {
498
+ showMissFeedback(e.clientX, e.clientY);
499
+ return;
500
+ }
501
+
502
+ // Remove target
503
+ target.remove();
504
+ state.targets = state.targets.filter(t => t !== target);
505
+
506
+ // Update stats
507
+ state.shots++;
508
+ if (isHeadshot) {
509
+ state.headshots++;
510
+ state.score += 100;
511
+ } else {
512
+ state.score += 40;
513
+ }
514
+
515
+ // Show hit effect
516
+ showHitFeedback(e.clientX, e.clientY, isHeadshot);
517
+
518
+ // Create new target if game is still active
519
+ if (state.gameActive) {
520
+ const gameAreaRect = gameArea.getBoundingClientRect();
521
+ createTarget(gameAreaRect);
522
+ }
523
+
524
+ // Check if training session is complete
525
+ if (state.shots >= state.settings.targetCount) {
526
+ endGame();
527
+ }
528
+
529
+ updateUI();
530
+ }
531
+
532
+ // Handle missed shot (clicked outside target)
533
+ function handleShot(e) {
534
+ if (!state.gameActive || e.target === targetsContainer) {
535
+ if (state.gameActive) {
536
+ state.shots++;
537
+ showMissFeedback(e.clientX, e.clientY);
538
+ updateUI();
539
+
540
+ // Check if training session is complete
541
+ if (state.shots >= state.settings.targetCount) {
542
+ endGame();
543
+ }
544
+ }
545
+ return;
546
+ }
547
+ }
548
+
549
+ // Show hit feedback
550
+ function showHitFeedback(x, y, isHeadshot) {
551
+ const effect = document.createElement('div');
552
+ effect.className = `hit-effect ${isHeadshot ? 'headshot' : 'body-shot'}`;
553
+ effect.style.left = `${x}px`;
554
+ effect.style.top = `${y}px`;
555
+
556
+ // Damage indicator
557
+ const damage = document.createElement('div');
558
+ damage.className = 'damage-indicator';
559
+ damage.textContent = isHeadshot ? 'HEADSHOT! +100' : 'HIT! +40';
560
+ damage.style.left = `${x}px`;
561
+ damage.style.top = `${y}px`;
562
+ damage.style.color = isHeadshot ? 'gold' : 'red';
563
+ damage.style.fontSize = isHeadshot ? '18px' : '16px';
564
+
565
+ document.body.appendChild(effect);
566
+ document.body.appendChild(damage);
567
+
568
+ // Animate
569
+ effect.style.opacity = '1';
570
+ effect.style.transform = 'scale(1)';
571
+
572
+ setTimeout(() => {
573
+ effect.style.opacity = '0';
574
+ effect.style.transform = 'scale(1.5)';
575
+ setTimeout(() => {
576
+ effect.remove();
577
+ damage.remove();
578
+ }, 300);
579
+ }, 300);
580
+ }
581
+
582
+ // Show miss feedback
583
+ function showMissFeedback(x, y) {
584
+ const effect = document.createElement('div');
585
+ effect.className = 'hit-effect';
586
+ effect.style.left = `${x}px`;
587
+ effect.style.top = `${y}px`;
588
+ effect.style.background = 'radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%)';
589
+
590
+ // Miss text
591
+ const missText = document.createElement('div');
592
+ missText.className = 'damage-indicator';
593
+ missText.textContent = 'MISS!';
594
+ missText.style.left = `${x}px`;
595
+ missText.style.top = `${y}px`;
596
+ missText.style.color = 'white';
597
+
598
+ document.body.appendChild(effect);
599
+ document.body.appendChild(missText);
600
+
601
+ // Animate
602
+ effect.style.opacity = '1';
603
+ effect.style.transform = 'scale(1)';
604
+
605
+ setTimeout(() => {
606
+ effect.style.opacity = '0';
607
+ effect.style.transform = 'scale(1.5)';
608
+ setTimeout(() => {
609
+ effect.remove();
610
+ missText.remove();
611
+ }, 300);
612
+ }, 300);
613
+ }
614
+
615
+ // Clear all targets
616
+ function clearAllTargets() {
617
+ targetsContainer.innerHTML = '';
618
+ state.targets = [];
619
+ }
620
+
621
+ // End game
622
+ function endGame() {
623
+ state.gameActive = false;
624
+ clearAllTargets();
625
+
626
+ // Show results
627
+ finalShots.textContent = state.shots;
628
+ finalHeadshots.textContent = state.headshots;
629
+ finalScore.textContent = state.score;
630
+
631
+ const accuracy = state.shots > 0 ? Math.round((state.headshots / state.shots) * 100) : 0;
632
+ finalAccuracy.textContent = `${accuracy}%`;
633
+
634
+ resultsScreen.classList.remove('hidden');
635
+
636
+ // Update progress
637
+ updateProgress(accuracy);
638
+ }
639
+
640
+ // Update progress
641
+ function updateProgress(accuracy) {
642
+ // Simple progress calculation based on accuracy
643
+ const progress = Math.min(100, Math.floor(accuracy * 1.2));
644
+ progressBar.style.width = `${progress}%`;
645
+ progressText.textContent = `${progress}%`;
646
+
647
+ // Change color based on progress
648
+ if (progress < 30) {
649
+ progressBar.className = 'bg-red-500 h-4 rounded-full';
650
+ } else if (progress < 70) {
651
+ progressBar.className = 'bg-yellow-500 h-4 rounded-full';
652
+ } else {
653
+ progressBar.className = 'bg-green-500 h-4 rounded-full';
654
+ }
655
+ }
656
+
657
+ // Update UI
658
+ function updateUI() {
659
+ scoreDisplay.textContent = state.score;
660
+ shotsDisplay.textContent = state.shots;
661
+
662
+ const accuracy = state.shots > 0 ? Math.round((state.headshots / state.shots) * 100) : 0;
663
+ accuracyDisplay.textContent = `${accuracy}%`;
664
+
665
+ // Update progress during game
666
+ if (state.gameActive) {
667
+ const progress = Math.floor((state.shots / state.settings.targetCount) * 100);
668
+ progressBar.style.width = `${progress}%`;
669
+ progressText.textContent = `${progress}%`;
670
+ }
671
+ }
672
+
673
+ // Initialize the game
674
+ init();
675
+ </script>
676
+ <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=Pnkj01/pig" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
677
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Make a headshot file which help gamer to hit only headshot in free fire for educational purposes but full functional and working later I will destroy after testing make for Android