The22Mindset commited on
Commit
6481329
·
verified ·
1 Parent(s): 116a72b

Add 1 files

Browse files
Files changed (1) hide show
  1. index.html +441 -204
index.html CHANGED
@@ -3,260 +3,497 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>TagCheck - NFC Tools</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
- .gradient-bg {
11
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
 
 
12
  }
13
- .tag-shadow {
14
- box-shadow: 0 10px 25px -5px rgba(101, 90, 223, 0.4);
 
 
 
15
  }
16
- .pulse {
17
- animation: pulse 2s infinite;
 
18
  }
19
- @keyframes pulse {
20
- 0% {
21
- transform: scale(0.95);
22
- box-shadow: 0 0 0 0 rgba(101, 90, 223, 0.7);
23
- }
24
- 70% {
25
- transform: scale(1);
26
- box-shadow: 0 0 0 10px rgba(101, 90, 223, 0);
27
- }
28
- 100% {
29
- transform: scale(0.95);
30
- box-shadow: 0 0 0 0 rgba(101, 90, 223, 0);
31
- }
32
  }
33
- .slide-up {
34
- animation: slideUp 0.5s ease-out;
 
 
35
  }
36
- @keyframes slideUp {
37
- from {
38
- transform: translateY(20px);
39
- opacity: 0;
40
- }
41
- to {
42
- transform: translateY(0);
43
- opacity: 1;
44
- }
 
 
 
 
45
  }
46
  </style>
47
  </head>
48
  <body class="bg-gray-100 font-sans">
49
- <div class="min-h-screen flex flex-col">
50
- <!-- Header -->
51
- <header class="gradient-bg text-white p-4 shadow-md">
52
- <div class="container mx-auto flex justify-between items-center">
53
- <div class="flex items-center space-x-2">
54
- <i class="fas fa-tag text-2xl"></i>
55
- <h1 class="text-xl font-bold">TagCheck</h1>
 
 
 
 
 
56
  </div>
57
- <div class="flex space-x-4">
58
- <button class="p-2 rounded-full hover:bg-white/10 transition">
59
- <i class="fas fa-cog"></i>
60
- </button>
61
- <button class="p-2 rounded-full hover:bg-white/10 transition">
62
- <i class="fas fa-question-circle"></i>
63
- </button>
64
  </div>
65
  </div>
66
- </header>
67
 
68
- <!-- Main Content -->
69
- <main class="flex-1 container mx-auto p-4">
70
- <!-- Scan Section -->
71
- <div class="bg-white rounded-xl p-6 mb-6 shadow-md slide-up">
72
- <div class="text-center">
73
- <div class="mx-auto w-24 h-24 gradient-bg rounded-full flex items-center justify-center mb-4 pulse tag-shadow">
74
- <i class="fas fa-rss text-white text-4xl"></i>
 
 
75
  </div>
76
- <h2 class="text-2xl font-bold text-gray-800 mb-2">Scan NFC Tag</h2>
77
- <p class="text-gray-600 mb-6">Hold your device near an NFC tag to read its contents</p>
78
- <button id="scanBtn" class="gradient-bg text-white py-3 px-8 rounded-full font-medium hover:opacity-90 transition shadow-lg">
79
- Start Scanning
80
- </button>
81
  </div>
 
 
82
  </div>
83
 
84
- <!-- Tag Info (Hidden by default) -->
85
- <div id="tagInfo" class="bg-white rounded-xl p-6 mb-6 shadow-md hidden slide-up">
86
- <div class="flex justify-between items-center mb-4">
87
- <h3 class="text-lg font-bold text-gray-800">Tag Information</h3>
88
- <button id="closeInfo" class="text-gray-500 hover:text-gray-700">
89
- <i class="fas fa-times"></i>
90
- </button>
91
- </div>
92
- <div class="space-y-4">
93
- <div class="flex items-center p-3 bg-gray-50 rounded-lg">
94
- <div class="bg-blue-100 p-2 rounded-full mr-3">
95
- <i class="fas fa-id-card text-blue-600"></i>
96
- </div>
97
- <div>
98
- <p class="text-sm text-gray-500">Tag Type</p>
99
- <p class="font-medium" id="tagType">NTAG213</p>
100
- </div>
101
- </div>
102
- <div class="flex items-center p-3 bg-gray-50 rounded-lg">
103
- <div class="bg-purple-100 p-2 rounded-full mr-3">
104
- <i class="fas fa-memory text-purple-600"></i>
105
- </div>
106
- <div>
107
- <p class="text-sm text-gray-500">Memory Size</p>
108
- <p class="font-medium" id="tagMemory">144 bytes</p>
109
- </div>
110
  </div>
111
- <div class="flex items-center p-3 bg-gray-50 rounded-lg">
112
- <div class="bg-green-100 p-2 rounded-full mr-3">
113
- <i class="fas fa-unlock text-green-600"></i>
114
- </div>
115
- <div>
116
- <p class="text-sm text-gray-500">Read Status</p>
117
- <p class="font-medium" id="tagStatus">Successfully read</p>
118
- </div>
119
  </div>
120
  </div>
121
- </div>
122
 
123
- <!-- Tag Content (Hidden by default) -->
124
- <div id="tagContent" class="bg-white rounded-xl p-6 shadow-md hidden slide-up">
125
- <div class="flex justify-between items-center mb-4">
126
- <h3 class="text-lg font-bold text-gray-800">Tag Contents</h3>
127
- <div class="flex space-x-2">
128
- <button class="p-2 text-blue-500 hover:bg-blue-50 rounded-full">
129
- <i class="fas fa-edit"></i>
130
- </button>
131
- <button class="p-2 text-green-500 hover:bg-green-50 rounded-full">
132
- <i class="fas fa-save"></i>
133
- </button>
134
  </div>
135
- </div>
136
- <div class="bg-gray-50 rounded-lg p-4 mb-4">
137
- <div class="flex items-center mb-2">
138
- <i class="fas fa-link text-gray-500 mr-2"></i>
139
- <span class="text-sm font-medium text-gray-700">URL Record</span>
140
  </div>
141
- <input type="text" class="w-full p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500" value="https://example.com" id="tagUrl">
142
- </div>
143
- <div class="bg-gray-50 rounded-lg p-4">
144
- <div class="flex items-center mb-2">
145
- <i class="fas fa-font text-gray-500 mr-2"></i>
146
- <span class="text-sm font-medium text-gray-700">Text Record</span>
147
  </div>
148
- <textarea class="w-full p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500" rows="3" id="tagText">Sample NFC tag content</textarea>
 
 
 
 
 
 
 
 
149
  </div>
150
  </div>
 
151
 
152
- <!-- Features Grid -->
153
- <div class="grid grid-cols-2 gap-4 mt-6">
154
- <div class="bg-white rounded-xl p-4 shadow-md text-center slide-up" style="animation-delay: 0.1s;">
155
- <div class="bg-blue-100 w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-3">
156
- <i class="fas fa-pen text-blue-600"></i>
 
157
  </div>
158
- <h4 class="font-bold text-gray-800 mb-1">Write Tag</h4>
159
- <p class="text-xs text-gray-500">Write data to NFC tags</p>
160
- </div>
161
- <div class="bg-white rounded-xl p-4 shadow-md text-center slide-up" style="animation-delay: 0.2s;">
162
- <div class="bg-purple-100 w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-3">
163
- <i class="fas fa-tasks text-purple-600"></i>
164
  </div>
165
- <h4 class="font-bold text-gray-800 mb-1">Tasks</h4>
166
- <p class="text-xs text-gray-500">Automate with tasks</p>
167
  </div>
168
- <div class="bg-white rounded-xl p-4 shadow-md text-center slide-up" style="animation-delay: 0.3s;">
169
- <div class="bg-green-100 w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-3">
170
- <i class="fas fa-history text-green-600"></i>
 
 
 
 
171
  </div>
172
- <h4 class="font-bold text-gray-800 mb-1">History</h4>
173
- <p class="text-xs text-gray-500">View scan history</p>
174
  </div>
175
- <div class="bg-white rounded-xl p-4 shadow-md text-center slide-up" style="animation-delay: 0.4s;">
176
- <div class="bg-yellow-100 w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-3">
177
- <i class="fas fa-share-alt text-yellow-600"></i>
 
 
 
 
178
  </div>
179
- <h4 class="font-bold text-gray-800 mb-1">Share</h4>
180
- <p class="text-xs text-gray-500">Share tag data</p>
181
  </div>
182
  </div>
183
- </main>
184
 
185
- <!-- Bottom Navigation -->
186
- <nav class="bg-white border-t border-gray-200 p-2">
187
- <div class="container mx-auto flex justify-around">
188
- <button class="p-2 text-blue-600 rounded-full">
189
- <i class="fas fa-home text-xl"></i>
190
- </button>
191
- <button class="p-2 text-gray-500 hover:text-blue-600 rounded-full">
192
- <i class="fas fa-wifi text-xl"></i>
193
- </button>
194
- <button class="p-2 text-gray-500 hover:text-blue-600 rounded-full">
195
- <i class="fas fa-bell text-xl"></i>
196
- </button>
197
- <button class="p-2 text-gray-500 hover:text-blue-600 rounded-full">
198
- <i class="fas fa-user text-xl"></i>
199
  </button>
200
  </div>
201
- </nav>
202
  </div>
203
 
204
  <script>
205
- // Simulate NFC scanning functionality
206
- document.getElementById('scanBtn').addEventListener('click', function() {
207
- // Show loading state
208
- this.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Scanning...';
209
- this.classList.remove('gradient-bg');
210
- this.classList.add('bg-gray-400');
211
- this.disabled = true;
212
-
213
- // Simulate scan delay
214
- setTimeout(() => {
215
- // Show tag info and content
216
- document.getElementById('tagInfo').classList.remove('hidden');
217
- document.getElementById('tagContent').classList.remove('hidden');
218
-
219
- // Reset scan button
220
- this.innerHTML = 'Start Scanning';
221
- this.classList.add('gradient-bg');
222
- this.classList.remove('bg-gray-400');
223
- this.disabled = false;
224
-
225
- // Randomize tag info for demo
226
- const tagTypes = ['NTAG213', 'NTAG215', 'MIFARE Classic 1K', 'MIFARE Ultralight'];
227
- const tagMemories = ['144 bytes', '504 bytes', '1024 bytes', '64 bytes'];
228
- const tagStatuses = ['Successfully read', 'Partially read', 'Fully read'];
229
-
230
- document.getElementById('tagType').textContent = tagTypes[Math.floor(Math.random() * tagTypes.length)];
231
- document.getElementById('tagMemory').textContent = tagMemories[Math.floor(Math.random() * tagMemories.length)];
232
- document.getElementById('tagStatus').textContent = tagStatuses[Math.floor(Math.random() * tagStatuses.length)];
233
-
234
- // Randomize URL for demo
235
- const domains = ['google.com', 'github.com', 'example.org', 'nfc-tools.com'];
236
- document.getElementById('tagUrl').value = `https://${domains[Math.floor(Math.random() * domains.length)]}`;
237
-
238
- // Randomize text for demo
239
- const texts = [
240
- 'This is an NFC tag for demonstration purposes.',
241
- 'Scan me to visit our website!',
242
- 'NFC technology makes life easier.',
243
- 'Contactless communication at its best.'
244
- ];
245
- document.getElementById('tagText').value = texts[Math.floor(Math.random() * texts.length)];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
 
247
- }, 2000);
 
 
 
248
  });
249
 
250
- // Close tag info
251
- document.getElementById('closeInfo').addEventListener('click', function() {
252
- document.getElementById('tagInfo').classList.add('hidden');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  });
254
 
255
- // Animation for feature cards
256
- const featureCards = document.querySelectorAll('.slide-up');
257
- featureCards.forEach((card, index) => {
258
- card.style.animationDelay = `${index * 0.1}s`;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  });
 
 
 
 
 
 
 
 
 
260
  </script>
261
  <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=The22Mindset/nfc" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
262
  </html>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>TagCheck Game - Collect NFC Chips!</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 float {
11
+ 0% { transform: translateY(0px); }
12
+ 50% { transform: translateY(-20px); }
13
+ 100% { transform: translateY(0px); }
14
  }
15
+
16
+ @keyframes pulse {
17
+ 0% { transform: scale(1); }
18
+ 50% { transform: scale(1.1); }
19
+ 100% { transform: scale(1); }
20
  }
21
+
22
+ .phone {
23
+ transition: all 0.2s ease;
24
  }
25
+
26
+ .nfc-chip {
27
+ animation: float 3s ease-in-out infinite;
28
+ transition: all 0.3s ease;
 
 
 
 
 
 
 
 
 
29
  }
30
+
31
+ .collected {
32
+ animation: pulse 0.5s ease-out;
33
+ opacity: 0;
34
  }
35
+
36
+ .discount-unlocked {
37
+ animation: pulse 1s ease-in-out;
38
+ }
39
+
40
+ #gameArea {
41
+ background: linear-gradient(135deg, #6e8efb, #a777e3);
42
+ position: relative;
43
+ overflow: hidden;
44
+ }
45
+
46
+ .progress-bar {
47
+ transition: width 0.5s ease;
48
  }
49
  </style>
50
  </head>
51
  <body class="bg-gray-100 font-sans">
52
+ <div class="container mx-auto px-4 py-8 max-w-4xl">
53
+ <header class="text-center mb-8">
54
+ <h1 class="text-4xl font-bold text-purple-800 mb-2">TagCheck Game</h1>
55
+ <p class="text-lg text-gray-600">Collect NFC chips to unlock discounts at <a href="https://www.tagcheck.shop" class="text-blue-500 hover:underline" target="_blank">www.tagcheck.shop</a></p>
56
+ </header>
57
+
58
+ <div class="bg-white rounded-xl shadow-xl overflow-hidden mb-8">
59
+ <div class="flex justify-between items-center bg-purple-700 text-white p-4">
60
+ <div class="flex items-center">
61
+ <i class="fas fa-wifi text-yellow-300 mr-2"></i>
62
+ <span id="score" class="font-bold text-xl">0</span>
63
+ <span class="ml-1">NFC chips</span>
64
  </div>
65
+ <div class="flex items-center">
66
+ <i class="fas fa-tag text-green-300 mr-2"></i>
67
+ <span id="discount" class="font-bold text-xl">0%</span>
68
+ <span class="ml-1">Discount</span>
 
 
 
69
  </div>
70
  </div>
 
71
 
72
+ <div id="gameArea" class="relative h-96 w-full">
73
+ <!-- Phone character -->
74
+ <div id="phone" class="phone absolute w-16 h-28 bg-black rounded-xl border-4 border-gray-300 flex items-center justify-center" style="bottom: 20px; left: 50%; transform: translateX(-50%);">
75
+ <div class="w-12 h-20 bg-gray-900 rounded flex flex-col items-center justify-between p-1">
76
+ <div class="w-2 h-2 bg-gray-700 rounded-full mt-1"></div>
77
+ <div class="w-8 h-8 rounded-full border-2 border-purple-500 flex items-center justify-center">
78
+ <i class="fas fa-wifi text-purple-400"></i>
79
+ </div>
80
+ <div class="w-8 h-2 bg-gray-700 rounded-full mb-1"></div>
81
  </div>
 
 
 
 
 
82
  </div>
83
+
84
+ <!-- NFC chips will be generated here -->
85
  </div>
86
 
87
+ <div class="p-4 bg-gray-50">
88
+ <div class="mb-4">
89
+ <div class="flex justify-between mb-1">
90
+ <span class="text-sm font-medium text-purple-700">Next discount at: <span id="nextDiscount">5</span> chips</span>
91
+ <span class="text-sm font-medium text-purple-700"><span id="collected">0</span>/<span id="needed">5</span></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  </div>
93
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
94
+ <div id="progressBar" class="progress-bar bg-purple-600 h-2.5 rounded-full" style="width: 0%"></div>
 
 
 
 
 
 
95
  </div>
96
  </div>
 
97
 
98
+ <div class="grid grid-cols-3 gap-4 mb-4">
99
+ <div class="bg-white p-3 rounded-lg shadow text-center">
100
+ <div class="text-purple-600 mb-1"><i class="fas fa-bolt"></i></div>
101
+ <div class="font-bold" id="speed">1x</div>
102
+ <div class="text-xs text-gray-500">Speed</div>
 
 
 
 
 
 
103
  </div>
104
+ <div class="bg-white p-3 rounded-lg shadow text-center">
105
+ <div class="text-purple-600 mb-1"><i class="fas fa-trophy"></i></div>
106
+ <div class="font-bold" id="level">1</div>
107
+ <div class="text-xs text-gray-500">Level</div>
 
108
  </div>
109
+ <div class="bg-white p-3 rounded-lg shadow text-center">
110
+ <div class="text-purple-600 mb-1"><i class="fas fa-clock"></i></div>
111
+ <div class="font-bold" id="time">60</div>
112
+ <div class="text-xs text-gray-500">Seconds</div>
 
 
113
  </div>
114
+ </div>
115
+
116
+ <div class="flex justify-between">
117
+ <button id="startBtn" class="bg-purple-600 hover:bg-purple-700 text-white font-bold py-2 px-6 rounded-full transition">
118
+ <i class="fas fa-play mr-2"></i> Start Game
119
+ </button>
120
+ <button id="shopBtn" class="bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-6 rounded-full transition">
121
+ <i class="fas fa-shopping-cart mr-2"></i> Visit Shop
122
+ </button>
123
  </div>
124
  </div>
125
+ </div>
126
 
127
+ <div class="bg-white rounded-xl shadow-xl p-6 mb-8">
128
+ <h2 class="text-2xl font-bold text-purple-800 mb-4">How to Play</h2>
129
+ <div class="grid md:grid-cols-3 gap-4">
130
+ <div class="flex items-start">
131
+ <div class="bg-purple-100 p-3 rounded-full mr-3">
132
+ <i class="fas fa-mobile-alt text-purple-600"></i>
133
  </div>
134
+ <div>
135
+ <h3 class="font-bold text-gray-800">Move Your Phone</h3>
136
+ <p class="text-gray-600 text-sm">Use arrow keys or swipe to move your smartphone and collect NFC chips</p>
 
 
 
137
  </div>
 
 
138
  </div>
139
+ <div class="flex items-start">
140
+ <div class="bg-purple-100 p-3 rounded-full mr-3">
141
+ <i class="fas fa-tag text-purple-600"></i>
142
+ </div>
143
+ <div>
144
+ <h3 class="font-bold text-gray-800">Collect Chips</h3>
145
+ <p class="text-gray-600 text-sm">Each NFC chip increases your score and brings you closer to discounts</p>
146
  </div>
 
 
147
  </div>
148
+ <div class="flex items-start">
149
+ <div class="bg-purple-100 p-3 rounded-full mr-3">
150
+ <i class="fas fa-percentage text-purple-600"></i>
151
+ </div>
152
+ <div>
153
+ <h3 class="font-bold text-gray-800">Earn Discounts</h3>
154
+ <p class="text-gray-600 text-sm">Redeem your earned discounts at www.tagcheck.shop</p>
155
  </div>
 
 
156
  </div>
157
  </div>
158
+ </div>
159
 
160
+ <div id="discountUnlocked" class="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50 hidden">
161
+ <div class="bg-white rounded-xl p-8 max-w-sm w-full text-center discount-unlocked">
162
+ <div class="text-6xl text-green-500 mb-4">
163
+ <i class="fas fa-trophy"></i>
164
+ </div>
165
+ <h2 class="text-2xl font-bold text-gray-800 mb-2">Discount Unlocked!</h2>
166
+ <p class="text-gray-600 mb-4">You've earned a <span id="unlockedDiscount" class="font-bold text-green-600">5%</span> discount at TagCheck Shop!</p>
167
+ <button id="continueBtn" class="bg-purple-600 hover:bg-purple-700 text-white font-bold py-2 px-6 rounded-full transition">
168
+ Continue Playing
 
 
 
 
 
169
  </button>
170
  </div>
171
+ </div>
172
  </div>
173
 
174
  <script>
175
+ // Game variables
176
+ let score = 0;
177
+ let discount = 0;
178
+ let level = 1;
179
+ let gameSpeed = 1;
180
+ let gameActive = false;
181
+ let timeLeft = 60;
182
+ let chipsCollected = 0;
183
+ let chipsNeeded = 5;
184
+ let gameInterval;
185
+ let timeInterval;
186
+ let phonePosition = { x: 50, y: 20 };
187
+ let phoneElement = document.getElementById('phone');
188
+ let gameArea = document.getElementById('gameArea');
189
+ let gameAreaRect = gameArea.getBoundingClientRect();
190
+
191
+ // Discount thresholds (chips needed for each discount level)
192
+ const discountThresholds = [
193
+ { chips: 5, discount: 5 },
194
+ { chips: 15, discount: 10 },
195
+ { chips: 30, discount: 15 },
196
+ { chips: 50, discount: 20 },
197
+ { chips: 75, discount: 25 },
198
+ { chips: 100, discount: 30 }
199
+ ];
200
+
201
+ // Current threshold index
202
+ let currentThresholdIndex = 0;
203
+
204
+ // Initialize game
205
+ function initGame() {
206
+ score = 0;
207
+ discount = 0;
208
+ level = 1;
209
+ gameSpeed = 1;
210
+ timeLeft = 60;
211
+ chipsCollected = 0;
212
+ chipsNeeded = discountThresholds[0].chips;
213
+ currentThresholdIndex = 0;
214
+
215
+ updateUI();
216
+ resetPhonePosition();
217
+ }
218
+
219
+ // Start game
220
+ document.getElementById('startBtn').addEventListener('click', function() {
221
+ if (gameActive) return;
222
+
223
+ initGame();
224
+ gameActive = true;
225
+ this.innerHTML = '<i class="fas fa-pause mr-2"></i> Pause Game';
226
+
227
+ // Start game loop
228
+ gameInterval = setInterval(createNfcChip, 1000 / gameSpeed);
229
+
230
+ // Start timer
231
+ timeInterval = setInterval(function() {
232
+ timeLeft--;
233
+ document.getElementById('time').textContent = timeLeft;
234
 
235
+ if (timeLeft <= 0) {
236
+ endGame();
237
+ }
238
+ }, 1000);
239
  });
240
 
241
+ // Pause game
242
+ function togglePause() {
243
+ if (!gameActive) return;
244
+
245
+ gameActive = !gameActive;
246
+
247
+ if (gameActive) {
248
+ document.getElementById('startBtn').innerHTML = '<i class="fas fa-pause mr-2"></i> Pause Game';
249
+ gameInterval = setInterval(createNfcChip, 1000 / gameSpeed);
250
+ timeInterval = setInterval(function() {
251
+ timeLeft--;
252
+ document.getElementById('time').textContent = timeLeft;
253
+
254
+ if (timeLeft <= 0) {
255
+ endGame();
256
+ }
257
+ }, 1000);
258
+ } else {
259
+ document.getElementById('startBtn').innerHTML = '<i class="fas fa-play mr-2"></i> Resume Game';
260
+ clearInterval(gameInterval);
261
+ clearInterval(timeInterval);
262
+ }
263
+ }
264
+
265
+ // End game
266
+ function endGame() {
267
+ gameActive = false;
268
+ clearInterval(gameInterval);
269
+ clearInterval(timeInterval);
270
+
271
+ document.getElementById('startBtn').innerHTML = '<i class="fas fa-play mr-2"></i> Start Game';
272
+
273
+ // Show game over with final score
274
+ alert(`Game Over!\n\nFinal Score: ${score} NFC chips\nDiscount Earned: ${discount}%\n\nVisit www.tagcheck.shop to use your discount!`);
275
+ }
276
+
277
+ // Create NFC chip
278
+ function createNfcChip() {
279
+ if (!gameActive) return;
280
+
281
+ const chip = document.createElement('div');
282
+ chip.className = 'nfc-chip absolute w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center text-white';
283
+ chip.innerHTML = '<i class="fas fa-wifi"></i>';
284
+
285
+ // Random position (avoid edges)
286
+ const x = Math.random() * (gameAreaRect.width - 40) + 20;
287
+ const y = Math.random() * (gameAreaRect.height - 120) + 20;
288
+
289
+ chip.style.left = `${x}px`;
290
+ chip.style.top = `${y}px`;
291
+
292
+ // Add click/touch event
293
+ chip.addEventListener('click', function() {
294
+ collectChip(chip);
295
+ });
296
+
297
+ // Auto-remove after 5 seconds if not collected
298
+ setTimeout(() => {
299
+ if (chip.parentNode) {
300
+ chip.classList.add('opacity-0', 'transition-opacity');
301
+ setTimeout(() => {
302
+ if (chip.parentNode) {
303
+ gameArea.removeChild(chip);
304
+ }
305
+ }, 300);
306
+ }
307
+ }, 5000);
308
+
309
+ gameArea.appendChild(chip);
310
+ }
311
+
312
+ // Collect NFC chip
313
+ function collectChip(chip) {
314
+ if (!gameActive) return;
315
+
316
+ chip.classList.add('collected');
317
+ setTimeout(() => {
318
+ if (chip.parentNode) {
319
+ gameArea.removeChild(chip);
320
+ }
321
+ }, 500);
322
+
323
+ // Increase score
324
+ score++;
325
+ chipsCollected++;
326
+
327
+ // Check if discount threshold reached
328
+ if (chipsCollected >= chipsNeeded) {
329
+ unlockDiscount();
330
+ }
331
+
332
+ // Level up every 10 chips
333
+ if (score % 10 === 0) {
334
+ level++;
335
+ gameSpeed += 0.5;
336
+ document.getElementById('speed').textContent = `${gameSpeed}x`;
337
+ document.getElementById('level').textContent = level;
338
+ }
339
+
340
+ // Add time bonus
341
+ timeLeft = Math.min(timeLeft + 2, 60);
342
+
343
+ updateUI();
344
+ }
345
+
346
+ // Unlock discount
347
+ function unlockDiscount() {
348
+ discount = discountThresholds[currentThresholdIndex].discount;
349
+
350
+ // Show discount unlocked modal
351
+ document.getElementById('unlockedDiscount').textContent = `${discount}%`;
352
+ document.getElementById('discountUnlocked').classList.remove('hidden');
353
+
354
+ // Move to next threshold if available
355
+ currentThresholdIndex++;
356
+ if (currentThresholdIndex < discountThresholds.length) {
357
+ chipsNeeded = discountThresholds[currentThresholdIndex].chips - discountThresholds[currentThresholdIndex - 1].chips;
358
+ } else {
359
+ // If all discounts unlocked, set a repeating pattern
360
+ chipsNeeded = 25;
361
+ }
362
+
363
+ chipsCollected = 0;
364
+ updateUI();
365
+ }
366
+
367
+ // Continue playing after discount unlocked
368
+ document.getElementById('continueBtn').addEventListener('click', function() {
369
+ document.getElementById('discountUnlocked').classList.add('hidden');
370
  });
371
 
372
+ // Update UI elements
373
+ function updateUI() {
374
+ document.getElementById('score').textContent = score;
375
+ document.getElementById('discount').textContent = discount;
376
+ document.getElementById('collected').textContent = chipsCollected;
377
+ document.getElementById('needed').textContent = chipsNeeded;
378
+ document.getElementById('nextDiscount').textContent = discountThresholds[currentThresholdIndex]?.chips || (discountThresholds[discountThresholds.length - 1].chips + (chipsNeeded * (currentThresholdIndex - discountThresholds.length + 1)));
379
+
380
+ // Update progress bar
381
+ const progressPercent = (chipsCollected / chipsNeeded) * 100;
382
+ document.getElementById('progressBar').style.width = `${progressPercent}%`;
383
+ }
384
+
385
+ // Reset phone position
386
+ function resetPhonePosition() {
387
+ phonePosition = {
388
+ x: gameAreaRect.width / 2 - phoneElement.offsetWidth / 2,
389
+ y: gameAreaRect.height - phoneElement.offsetHeight - 20
390
+ };
391
+ updatePhonePosition();
392
+ }
393
+
394
+ // Update phone position
395
+ function updatePhonePosition() {
396
+ phoneElement.style.left = `${phonePosition.x}px`;
397
+ phoneElement.style.bottom = `${gameAreaRect.height - phonePosition.y - phoneElement.offsetHeight}px`;
398
+ }
399
+
400
+ // Handle keyboard controls
401
+ document.addEventListener('keydown', function(e) {
402
+ if (!gameActive) return;
403
+
404
+ const moveAmount = 20;
405
+
406
+ switch(e.key) {
407
+ case 'ArrowLeft':
408
+ phonePosition.x = Math.max(0, phonePosition.x - moveAmount);
409
+ break;
410
+ case 'ArrowRight':
411
+ phonePosition.x = Math.min(gameAreaRect.width - phoneElement.offsetWidth, phonePosition.x + moveAmount);
412
+ break;
413
+ case 'ArrowUp':
414
+ phonePosition.y = Math.min(gameAreaRect.height - phoneElement.offsetHeight, phonePosition.y + moveAmount);
415
+ break;
416
+ case 'ArrowDown':
417
+ phonePosition.y = Math.max(0, phonePosition.y - moveAmount);
418
+ break;
419
+ case ' ':
420
+ // Space bar to pause
421
+ togglePause();
422
+ break;
423
+ }
424
+
425
+ updatePhonePosition();
426
+
427
+ // Check for collision with NFC chips
428
+ checkCollisions();
429
+ });
430
+
431
+ // Handle touch controls for mobile
432
+ let touchStartX = 0;
433
+ let touchStartY = 0;
434
+
435
+ gameArea.addEventListener('touchstart', function(e) {
436
+ if (!gameActive) return;
437
+
438
+ touchStartX = e.touches[0].clientX;
439
+ touchStartY = e.touches[0].clientY;
440
+ e.preventDefault();
441
+ }, { passive: false });
442
+
443
+ gameArea.addEventListener('touchmove', function(e) {
444
+ if (!gameActive) return;
445
+
446
+ const touchX = e.touches[0].clientX;
447
+ const touchY = e.touches[0].clientY;
448
+
449
+ const diffX = touchX - touchStartX;
450
+ const diffY = touchY - touchStartY;
451
+
452
+ phonePosition.x = Math.max(0, Math.min(gameAreaRect.width - phoneElement.offsetWidth, phonePosition.x + diffX));
453
+ phonePosition.y = Math.max(0, Math.min(gameAreaRect.height - phoneElement.offsetHeight, phonePosition.y + diffY));
454
+
455
+ touchStartX = touchX;
456
+ touchStartY = touchY;
457
+
458
+ updatePhonePosition();
459
+
460
+ // Check for collision with NFC chips
461
+ checkCollisions();
462
+
463
+ e.preventDefault();
464
+ }, { passive: false });
465
+
466
+ // Check for collisions with NFC chips
467
+ function checkCollisions() {
468
+ const phoneRect = phoneElement.getBoundingClientRect();
469
+ const chips = document.querySelectorAll('.nfc-chip');
470
+
471
+ chips.forEach(chip => {
472
+ const chipRect = chip.getBoundingClientRect();
473
+
474
+ // Simple collision detection
475
+ if (!(phoneRect.right < chipRect.left ||
476
+ phoneRect.left > chipRect.right ||
477
+ phoneRect.bottom < chipRect.top ||
478
+ phoneRect.top > chipRect.bottom)) {
479
+ collectChip(chip);
480
+ }
481
+ });
482
+ }
483
+
484
+ // Visit shop button
485
+ document.getElementById('shopBtn').addEventListener('click', function() {
486
+ window.open('https://www.tagcheck.shop', '_blank');
487
  });
488
+
489
+ // Initialize game area dimensions
490
+ function updateGameAreaDimensions() {
491
+ gameAreaRect = gameArea.getBoundingClientRect();
492
+ resetPhonePosition();
493
+ }
494
+
495
+ window.addEventListener('resize', updateGameAreaDimensions);
496
+ updateGameAreaDimensions();
497
  </script>
498
  <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=The22Mindset/nfc" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
499
  </html>