Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- index.html +1160 -1085
index.html
CHANGED
|
@@ -1,1103 +1,1178 @@
|
|
| 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>NFC Data Transfer Hub</title>
|
| 7 |
-
<style>
|
| 8 |
-
* {
|
| 9 |
-
margin: 0;
|
| 10 |
-
padding: 0;
|
| 11 |
-
box-sizing: border-box;
|
| 12 |
-
}
|
| 13 |
-
|
| 14 |
-
:root {
|
| 15 |
-
--primary: #6366f1;
|
| 16 |
-
--primary-dark: #4f46e5;
|
| 17 |
-
--secondary: #22d3ee;
|
| 18 |
-
--success: #10b981;
|
| 19 |
-
--warning: #f59e0b;
|
| 20 |
-
--danger: #ef4444;
|
| 21 |
-
--dark: #1e293b;
|
| 22 |
-
--light: #f1f5f9;
|
| 23 |
-
--white: #ffffff;
|
| 24 |
-
--shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
| 25 |
-
--shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
body {
|
| 29 |
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
| 30 |
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 31 |
-
min-height: 100vh;
|
| 32 |
-
color: var(--dark);
|
| 33 |
-
position: relative;
|
| 34 |
-
overflow-x: hidden;
|
| 35 |
-
}
|
| 36 |
-
|
| 37 |
-
.animated-bg {
|
| 38 |
-
position: fixed;
|
| 39 |
-
width: 100%;
|
| 40 |
-
height: 100%;
|
| 41 |
-
top: 0;
|
| 42 |
-
left: 0;
|
| 43 |
-
z-index: -1;
|
| 44 |
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
.animated-bg::before {
|
| 48 |
-
content: '';
|
| 49 |
-
position: absolute;
|
| 50 |
-
width: 200%;
|
| 51 |
-
height: 200%;
|
| 52 |
-
top: -50%;
|
| 53 |
-
left: -50%;
|
| 54 |
-
background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
|
| 55 |
-
background-size: 50px 50px;
|
| 56 |
-
animation: bgMove 20s linear infinite;
|
| 57 |
-
}
|
| 58 |
-
|
| 59 |
-
@keyframes bgMove {
|
| 60 |
-
0% { transform: translate(0, 0); }
|
| 61 |
-
100% { transform: translate(50px, 50px); }
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
-
header {
|
| 65 |
-
background: rgba(255, 255, 255, 0.95);
|
| 66 |
-
backdrop-filter: blur(10px);
|
| 67 |
-
padding: 1rem 2rem;
|
| 68 |
-
box-shadow: var(--shadow);
|
| 69 |
-
position: sticky;
|
| 70 |
-
top: 0;
|
| 71 |
-
z-index: 100;
|
| 72 |
-
}
|
| 73 |
-
|
| 74 |
-
.header-content {
|
| 75 |
-
max-width: 1400px;
|
| 76 |
-
margin: 0 auto;
|
| 77 |
-
display: flex;
|
| 78 |
-
justify-content: space-between;
|
| 79 |
-
align-items: center;
|
| 80 |
-
}
|
| 81 |
-
|
| 82 |
-
.logo {
|
| 83 |
-
display: flex;
|
| 84 |
-
align-items: center;
|
| 85 |
-
gap: 1rem;
|
| 86 |
-
}
|
| 87 |
-
|
| 88 |
-
.logo-icon {
|
| 89 |
-
width: 40px;
|
| 90 |
-
height: 40px;
|
| 91 |
-
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 92 |
-
border-radius: 12px;
|
| 93 |
-
display: flex;
|
| 94 |
-
align-items: center;
|
| 95 |
-
justify-content: center;
|
| 96 |
-
color: white;
|
| 97 |
-
font-weight: bold;
|
| 98 |
-
font-size: 1.2rem;
|
| 99 |
-
}
|
| 100 |
-
|
| 101 |
-
.logo h1 {
|
| 102 |
-
font-size: 1.5rem;
|
| 103 |
-
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 104 |
-
-webkit-background-clip: text;
|
| 105 |
-
-webkit-text-fill-color: transparent;
|
| 106 |
-
}
|
| 107 |
-
|
| 108 |
-
.status-indicator {
|
| 109 |
-
display: flex;
|
| 110 |
-
align-items: center;
|
| 111 |
-
gap: 0.5rem;
|
| 112 |
-
padding: 0.5rem 1rem;
|
| 113 |
-
background: var(--light);
|
| 114 |
-
border-radius: 20px;
|
| 115 |
-
font-size: 0.9rem;
|
| 116 |
-
}
|
| 117 |
-
|
| 118 |
-
.status-dot {
|
| 119 |
-
width: 8px;
|
| 120 |
-
height: 8px;
|
| 121 |
-
border-radius: 50%;
|
| 122 |
-
background: var(--success);
|
| 123 |
-
animation: pulse 2s infinite;
|
| 124 |
-
}
|
| 125 |
-
|
| 126 |
-
@keyframes pulse {
|
| 127 |
-
0%, 100% { opacity: 1; }
|
| 128 |
-
50% { opacity: 0.5; }
|
| 129 |
-
}
|
| 130 |
-
|
| 131 |
-
main {
|
| 132 |
-
max-width: 1400px;
|
| 133 |
-
margin: 2rem auto;
|
| 134 |
-
padding: 0 2rem;
|
| 135 |
-
}
|
| 136 |
-
|
| 137 |
-
.app-container {
|
| 138 |
-
display: grid;
|
| 139 |
-
grid-template-columns: 1fr 1fr;
|
| 140 |
-
gap: 2rem;
|
| 141 |
-
margin-bottom: 2rem;
|
| 142 |
-
}
|
| 143 |
-
|
| 144 |
-
.panel {
|
| 145 |
-
background: rgba(255, 255, 255, 0.95);
|
| 146 |
-
backdrop-filter: blur(10px);
|
| 147 |
-
border-radius: 20px;
|
| 148 |
-
padding: 2rem;
|
| 149 |
-
box-shadow: var(--shadow-lg);
|
| 150 |
-
transition: transform 0.3s, box-shadow 0.3s;
|
| 151 |
-
}
|
| 152 |
-
|
| 153 |
-
.panel:hover {
|
| 154 |
-
transform: translateY(-5px);
|
| 155 |
-
box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
|
| 156 |
-
}
|
| 157 |
-
|
| 158 |
-
.panel-header {
|
| 159 |
-
display: flex;
|
| 160 |
-
align-items: center;
|
| 161 |
-
gap: 1rem;
|
| 162 |
-
margin-bottom: 1.5rem;
|
| 163 |
-
padding-bottom: 1rem;
|
| 164 |
-
border-bottom: 2px solid var(--light);
|
| 165 |
-
}
|
| 166 |
-
|
| 167 |
-
.panel-icon {
|
| 168 |
-
width: 40px;
|
| 169 |
-
height: 40px;
|
| 170 |
-
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 171 |
-
border-radius: 10px;
|
| 172 |
-
display: flex;
|
| 173 |
-
align-items: center;
|
| 174 |
-
justify-content: center;
|
| 175 |
-
color: white;
|
| 176 |
-
}
|
| 177 |
-
|
| 178 |
-
.panel h2 {
|
| 179 |
-
font-size: 1.3rem;
|
| 180 |
-
color: var(--dark);
|
| 181 |
-
}
|
| 182 |
-
|
| 183 |
-
.nfc-simulator {
|
| 184 |
-
display: flex;
|
| 185 |
-
flex-direction: column;
|
| 186 |
-
align-items: center;
|
| 187 |
-
gap: 2rem;
|
| 188 |
-
}
|
| 189 |
-
|
| 190 |
-
.nfc-device {
|
| 191 |
-
width: 200px;
|
| 192 |
-
height: 200px;
|
| 193 |
-
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
|
| 194 |
-
border-radius: 20px;
|
| 195 |
-
display: flex;
|
| 196 |
-
align-items: center;
|
| 197 |
-
justify-content: center;
|
| 198 |
-
position: relative;
|
| 199 |
-
cursor: pointer;
|
| 200 |
-
transition: all 0.3s;
|
| 201 |
-
box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
|
| 202 |
-
}
|
| 203 |
-
|
| 204 |
-
.nfc-device:hover {
|
| 205 |
-
transform: scale(1.05);
|
| 206 |
-
box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
|
| 207 |
-
}
|
| 208 |
-
|
| 209 |
-
.nfc-device.active {
|
| 210 |
-
animation: nfcPulse 1s infinite;
|
| 211 |
-
}
|
| 212 |
-
|
| 213 |
-
@keyframes nfcPulse {
|
| 214 |
-
0%, 100% {
|
| 215 |
-
box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
|
| 216 |
-
}
|
| 217 |
-
50% {
|
| 218 |
-
box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
|
| 219 |
-
}
|
| 220 |
-
}
|
| 221 |
-
|
| 222 |
-
.nfc-symbol {
|
| 223 |
-
font-size: 4rem;
|
| 224 |
-
color: white;
|
| 225 |
-
}
|
| 226 |
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 586 |
</head>
|
|
|
|
| 587 |
<body>
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 595 |
</div>
|
| 596 |
-
<div class="
|
| 597 |
-
|
| 598 |
-
|
| 599 |
</div>
|
| 600 |
-
<
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
</div>
|
| 604 |
-
</header>
|
| 605 |
-
|
| 606 |
-
<main>
|
| 607 |
-
<div class="app-container">
|
| 608 |
-
<!-- NFC Simulator Panel -->
|
| 609 |
-
<div class="panel">
|
| 610 |
-
<div class="panel-header">
|
| 611 |
-
<div class="panel-icon">📡</div>
|
| 612 |
-
<h2>NFC Simulator</h2>
|
| 613 |
-
</div>
|
| 614 |
-
<div class="nfc-simulator">
|
| 615 |
-
<div class="nfc-device" id="nfcDevice">
|
| 616 |
-
<div class="nfc-symbol">📱</div>
|
| 617 |
-
</div>
|
| 618 |
-
<div class="data-types">
|
| 619 |
-
<div class="data-type-btn active" data-type="text">
|
| 620 |
-
<div class="data-type-icon">📝</div>
|
| 621 |
-
<div>Text</div>
|
| 622 |
-
</div>
|
| 623 |
-
<div class="data-type-btn" data-type="url">
|
| 624 |
-
<div class="data-type-icon">🔗</div>
|
| 625 |
-
<div>URL</div>
|
| 626 |
-
</div>
|
| 627 |
-
<div class="data-type-btn" data-type="contact">
|
| 628 |
-
<div class="data-type-icon">👤</div>
|
| 629 |
-
<div>Contact</div>
|
| 630 |
-
</div>
|
| 631 |
-
<div class="data-type-btn" data-type="wifi">
|
| 632 |
-
<div class="data-type-icon">📶</div>
|
| 633 |
-
<div>WiFi</div>
|
| 634 |
-
</div>
|
| 635 |
-
</div>
|
| 636 |
-
</div>
|
| 637 |
</div>
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
<div class="panel-header">
|
| 642 |
-
<div class="panel-icon">💾</div>
|
| 643 |
-
<h2>Data Input</h2>
|
| 644 |
-
</div>
|
| 645 |
-
<div class="data-input-section" id="dataInputSection">
|
| 646 |
-
<div class="input-group">
|
| 647 |
-
<label for="textInput">Text Message</label>
|
| 648 |
-
<textarea id="textInput" placeholder="Enter your text message here..."></textarea>
|
| 649 |
-
</div>
|
| 650 |
-
<div class="format-options">
|
| 651 |
-
<div class="format-chip active" data-format="plain">Plain Text</div>
|
| 652 |
-
<div class="format-chip" data-format="json">JSON</div>
|
| 653 |
-
<div class="format-chip" data-format="base64">Base64</div>
|
| 654 |
-
<div class="format-chip" data-format="hex">Hex</div>
|
| 655 |
-
</div>
|
| 656 |
-
</div>
|
| 657 |
-
<div class="action-buttons">
|
| 658 |
-
<button class="btn btn-success" id="transferBtn">
|
| 659 |
-
<span>⚡</span>
|
| 660 |
-
<span>Transfer Data</span>
|
| 661 |
-
</button>
|
| 662 |
-
<button class="btn btn-secondary" id="clearBtn">
|
| 663 |
-
<span>🗑️</span>
|
| 664 |
-
<span>Clear</span>
|
| 665 |
-
</button>
|
| 666 |
-
</div>
|
| 667 |
-
<div class="progress-bar">
|
| 668 |
-
<div class="progress-fill" id="progressBar"></div>
|
| 669 |
-
</div>
|
| 670 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 671 |
</div>
|
|
|
|
| 672 |
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
</div>
|
| 679 |
-
<div class="history-list" id="historyList">
|
| 680 |
-
<div class="history-item">
|
| 681 |
-
<div class="history-info">
|
| 682 |
-
<div class="history-type">Welcome Message</div>
|
| 683 |
-
<div class="history-time">Just now</div>
|
| 684 |
-
</div>
|
| 685 |
-
<div class="history-actions">
|
| 686 |
-
<button class="icon-btn">👁️</button>
|
| 687 |
-
<button class="icon-btn">📋</button>
|
| 688 |
-
<button class="icon-btn">🔄</button>
|
| 689 |
-
</div>
|
| 690 |
-
</div>
|
| 691 |
-
</div>
|
| 692 |
</div>
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
</div>
|
| 702 |
-
<div
|
|
|
|
| 703 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 704 |
</div>
|
| 705 |
|
| 706 |
-
<!--
|
| 707 |
-
<div class="
|
| 708 |
-
|
| 709 |
-
<div class="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 710 |
</div>
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
|
| 742 |
-
|
| 743 |
-
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
|
| 770 |
-
|
| 771 |
-
|
| 772 |
-
|
| 773 |
-
|
| 774 |
-
|
| 775 |
-
|
| 776 |
-
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
|
| 786 |
-
|
| 787 |
-
|
| 788 |
-
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
|
| 794 |
-
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
|
| 801 |
-
|
| 802 |
-
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
-
|
| 808 |
-
|
| 809 |
-
|
| 810 |
-
|
| 811 |
-
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
|
| 815 |
-
|
| 816 |
-
|
| 817 |
-
|
| 818 |
-
|
| 819 |
-
|
| 820 |
-
|
| 821 |
-
|
| 822 |
-
|
| 823 |
-
|
| 824 |
-
|
| 825 |
-
|
| 826 |
-
|
| 827 |
-
|
| 828 |
-
|
| 829 |
-
|
| 830 |
-
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
|
| 836 |
-
|
| 837 |
-
|
| 838 |
-
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
|
| 859 |
-
|
| 860 |
-
|
| 861 |
-
|
| 862 |
-
|
| 863 |
-
|
| 864 |
-
|
| 865 |
-
|
| 866 |
-
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
|
| 875 |
-
|
| 876 |
-
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
-
|
| 891 |
-
|
| 892 |
-
|
| 893 |
-
|
| 894 |
-
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
|
| 925 |
-
|
| 926 |
-
|
| 927 |
-
|
| 928 |
-
|
| 929 |
-
|
| 930 |
-
|
| 931 |
-
|
| 932 |
-
|
| 933 |
-
|
| 934 |
-
|
| 935 |
-
|
| 936 |
-
|
| 937 |
-
|
| 938 |
-
|
| 939 |
-
|
| 940 |
-
|
| 941 |
-
|
| 942 |
-
|
| 943 |
-
|
| 944 |
-
|
| 945 |
-
|
| 946 |
-
|
| 947 |
-
|
| 948 |
-
<div class="history-time">${timeAgo}</div>
|
| 949 |
-
</div>
|
| 950 |
-
<div class="history-actions">
|
| 951 |
-
<button class="icon-btn" onclick="viewData(${item.id})">👁️</button>
|
| 952 |
-
<button class="icon-btn" onclick="copyData(${item.id})">📋</button>
|
| 953 |
-
<button class="icon-btn" onclick="retransferData(${item.id})">🔄</button>
|
| 954 |
-
</div>
|
| 955 |
-
</div>
|
| 956 |
-
`;
|
| 957 |
-
}).join('');
|
| 958 |
-
|
| 959 |
-
historyList.innerHTML = historyHTML || '<p style="text-align: center; color: #64748b;">No transfer history yet</p>';
|
| 960 |
-
}
|
| 961 |
-
|
| 962 |
-
function getTypeIcon(type) {
|
| 963 |
-
const icons = {
|
| 964 |
-
text: '📝',
|
| 965 |
-
url: '🔗',
|
| 966 |
-
contact: '👤',
|
| 967 |
-
wifi: '📶'
|
| 968 |
-
};
|
| 969 |
-
return icons[type] || '📄';
|
| 970 |
-
}
|
| 971 |
-
|
| 972 |
-
function getTimeAgo(date) {
|
| 973 |
-
const seconds = Math.floor((new Date() - date) / 1000);
|
| 974 |
-
|
| 975 |
-
if (seconds < 60) return 'Just now';
|
| 976 |
-
if (seconds < 3600) return Math.floor(seconds / 60) + ' minutes ago';
|
| 977 |
-
if (seconds < 86400) return Math.floor(seconds / 3600) + ' hours ago';
|
| 978 |
-
return Math.floor(seconds / 86400) + ' days ago';
|
| 979 |
-
}
|
| 980 |
-
|
| 981 |
-
function viewData(id) {
|
| 982 |
-
const item = transferHistory.find(h => h.id === id);
|
| 983 |
-
if (!item) return;
|
| 984 |
-
|
| 985 |
-
let content = '<div style="word-break: break-all;">';
|
| 986 |
-
|
| 987 |
-
switch(item.type) {
|
| 988 |
-
case 'text':
|
| 989 |
-
content += `<strong>Content:</strong> ${item.data.content}`;
|
| 990 |
-
break;
|
| 991 |
-
case 'url':
|
| 992 |
-
content += `<strong>URL:</strong> ${item.data.url}<br>`;
|
| 993 |
-
content += `<strong>Title:</strong> ${item.data.title || 'N/A'}`;
|
| 994 |
-
break;
|
| 995 |
-
case 'contact':
|
| 996 |
-
content += `<strong>Name:</strong> ${item.data.name}<br>`;
|
| 997 |
-
content += `<strong>Phone:</strong> ${item.data.phone}<br>`;
|
| 998 |
-
content += `<strong>Email:</strong> ${item.data.email}`;
|
| 999 |
-
break;
|
| 1000 |
-
case 'wifi':
|
| 1001 |
-
content += `<strong>SSID:</strong> ${item.data.ssid}<br>`;
|
| 1002 |
-
content += `<strong>Security:</strong> ${item.data.security}<br>`;
|
| 1003 |
-
content += `<strong>Password:</strong> ${item.data.password ? '••••••••' : 'None'}`;
|
| 1004 |
-
break;
|
| 1005 |
-
}
|
| 1006 |
-
|
| 1007 |
-
if (item.data.format !== 'plain') {
|
| 1008 |
-
content += `<br><br><strong>Encoded (${item.data.format}):</strong><br><code style="background: #f1f5f9; padding: 10px; border-radius: 5px; display: block;">${item.data.encoded}</code>`;
|
| 1009 |
-
}
|
| 1010 |
-
|
| 1011 |
-
content += '</div>';
|
| 1012 |
-
|
| 1013 |
-
modalBody.innerHTML = content;
|
| 1014 |
-
viewModal.classList.add('active');
|
| 1015 |
-
}
|
| 1016 |
-
|
| 1017 |
-
function copyData(id) {
|
| 1018 |
-
const item = transferHistory.find(h => h.id === id);
|
| 1019 |
-
if (!item) return;
|
| 1020 |
-
|
| 1021 |
-
const textToCopy = JSON.stringify(item.data, null, 2);
|
| 1022 |
-
navigator.clipboard.writeText(textToCopy).then(() => {
|
| 1023 |
-
showToast('Data copied to clipboard!', 'success');
|
| 1024 |
-
});
|
| 1025 |
-
}
|
| 1026 |
-
|
| 1027 |
-
function retransferData(id) {
|
| 1028 |
-
const item = transferHistory.find(h => h.id === id);
|
| 1029 |
-
if (!item) return;
|
| 1030 |
-
|
| 1031 |
-
// Fill the form with the data
|
| 1032 |
-
currentDataType = item.type;
|
| 1033 |
-
document.querySelectorAll('.data-type-btn').forEach(btn => {
|
| 1034 |
-
btn.classList.toggle('active', btn.dataset.type === item.type);
|
| 1035 |
-
});
|
| 1036 |
-
updateDataInput();
|
| 1037 |
-
|
| 1038 |
-
// Populate the form
|
| 1039 |
-
setTimeout(() => {
|
| 1040 |
-
switch(item.type) {
|
| 1041 |
-
case 'text':
|
| 1042 |
-
document.getElementById('textInput').value = item.data.content;
|
| 1043 |
-
break;
|
| 1044 |
-
case 'url':
|
| 1045 |
-
document.getElementById('urlInput').value = item.data.url;
|
| 1046 |
-
document.getElementById('urlTitle').value = item.data.title;
|
| 1047 |
-
break;
|
| 1048 |
-
case 'contact':
|
| 1049 |
-
document.getElementById('contactName').value = item.data.name;
|
| 1050 |
-
document.getElementById('contactPhone').value = item.data.phone;
|
| 1051 |
-
document.getElementById('contactEmail').value = item.data.email;
|
| 1052 |
-
break;
|
| 1053 |
-
case 'wifi':
|
| 1054 |
-
document.getElementById('wifiSSID').value = item.data.ssid;
|
| 1055 |
-
document.getElementById('wifiPassword').value = item.data.password;
|
| 1056 |
-
document.getElementById('wifiSecurity').value = item.data.security;
|
| 1057 |
-
break;
|
| 1058 |
-
}
|
| 1059 |
-
}, 100);
|
| 1060 |
-
|
| 1061 |
-
showToast('Data loaded for retransfer', 'success');
|
| 1062 |
-
}
|
| 1063 |
-
|
| 1064 |
-
function showToast(message, type = 'success') {
|
| 1065 |
-
toastMessage.textContent = message;
|
| 1066 |
-
toast.className = `toast ${type}`;
|
| 1067 |
-
toast.classList.add('show');
|
| 1068 |
-
|
| 1069 |
-
setTimeout(() => {
|
| 1070 |
-
toast.classList.remove('show');
|
| 1071 |
-
}, 3000);
|
| 1072 |
-
}
|
| 1073 |
-
|
| 1074 |
-
// Initialize with welcome message
|
| 1075 |
-
window.addEventListener('load', () => {
|
| 1076 |
-
const welcomeData = {
|
| 1077 |
-
id: Date.now(),
|
| 1078 |
-
type: 'text',
|
| 1079 |
-
data: { content: 'Welcome to NFC Data Transfer Hub!', format: 'plain' },
|
| 1080 |
-
timestamp: new Date()
|
| 1081 |
-
};
|
| 1082 |
-
transferHistory.push(welcomeData);
|
| 1083 |
-
updateHistoryDisplay();
|
| 1084 |
});
|
| 1085 |
-
|
| 1086 |
-
|
| 1087 |
-
|
| 1088 |
-
|
| 1089 |
-
|
| 1090 |
-
|
| 1091 |
-
|
| 1092 |
-
|
| 1093 |
-
|
| 1094 |
-
|
| 1095 |
-
|
| 1096 |
-
|
| 1097 |
-
|
| 1098 |
-
|
| 1099 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1100 |
});
|
| 1101 |
-
|
| 1102 |
-
|
| 1103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>NFC Data Transfer Hub - Mobile Ready</title>
|
| 8 |
+
<style>
|
| 9 |
+
* {
|
| 10 |
+
margin: 0;
|
| 11 |
+
padding: 0;
|
| 12 |
+
box-sizing: border-box;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
:root {
|
| 16 |
+
--primary: #6366f1;
|
| 17 |
+
--primary-dark: #4f46e5;
|
| 18 |
+
--secondary: #22d3ee;
|
| 19 |
+
--success: #10b981;
|
| 20 |
+
--warning: #f59e0b;
|
| 21 |
+
--danger: #ef4444;
|
| 22 |
+
--dark: #1e293b;
|
| 23 |
+
--light: #f1f5f9;
|
| 24 |
+
--white: #ffffff;
|
| 25 |
+
--shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
| 26 |
+
--shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
body {
|
| 30 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
| 31 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 32 |
+
min-height: 100vh;
|
| 33 |
+
color: var(--dark);
|
| 34 |
+
position: relative;
|
| 35 |
+
overflow-x: hidden;
|
| 36 |
+
-webkit-tap-highlight-color: transparent;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
.animated-bg {
|
| 40 |
+
position: fixed;
|
| 41 |
+
width: 100%;
|
| 42 |
+
height: 100%;
|
| 43 |
+
top: 0;
|
| 44 |
+
left: 0;
|
| 45 |
+
z-index: -1;
|
| 46 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.animated-bg::before {
|
| 50 |
+
content: '';
|
| 51 |
+
position: absolute;
|
| 52 |
+
width: 200%;
|
| 53 |
+
height: 200%;
|
| 54 |
+
top: -50%;
|
| 55 |
+
left: -50%;
|
| 56 |
+
background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
|
| 57 |
+
background-size: 50px 50px;
|
| 58 |
+
animation: bgMove 20s linear infinite;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
@keyframes bgMove {
|
| 62 |
+
0% { transform: translate(0, 0); }
|
| 63 |
+
100% { transform: translate(50px, 50px); }
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
header {
|
| 67 |
+
background: rgba(255, 255, 255, 0.95);
|
| 68 |
+
backdrop-filter: blur(10px);
|
| 69 |
+
padding: 1rem;
|
| 70 |
+
box-shadow: var(--shadow);
|
| 71 |
+
position: sticky;
|
| 72 |
+
top: 0;
|
| 73 |
+
z-index: 100;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.header-content {
|
| 77 |
+
max-width: 1400px;
|
| 78 |
+
margin: 0 auto;
|
| 79 |
+
display: flex;
|
| 80 |
+
justify-content: space-between;
|
| 81 |
+
align-items: center;
|
| 82 |
+
flex-wrap: wrap;
|
| 83 |
+
gap: 1rem;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
.logo {
|
| 87 |
+
display: flex;
|
| 88 |
+
align-items: center;
|
| 89 |
+
gap: 0.75rem;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
.logo-icon {
|
| 93 |
+
width: 40px;
|
| 94 |
+
height: 40px;
|
| 95 |
+
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 96 |
+
border-radius: 12px;
|
| 97 |
+
display: flex;
|
| 98 |
+
align-items: center;
|
| 99 |
+
justify-content: center;
|
| 100 |
+
color: white;
|
| 101 |
+
font-weight: bold;
|
| 102 |
+
font-size: 1.2rem;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.logo h1 {
|
| 106 |
+
font-size: 1.3rem;
|
| 107 |
+
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 108 |
+
-webkit-background-clip: text;
|
| 109 |
+
-webkit-text-fill-color: transparent;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
.status-indicator {
|
| 113 |
+
display: flex;
|
| 114 |
+
align-items: center;
|
| 115 |
+
gap: 0.5rem;
|
| 116 |
+
padding: 0.5rem 1rem;
|
| 117 |
+
background: var(--light);
|
| 118 |
+
border-radius: 20px;
|
| 119 |
+
font-size: 0.85rem;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
.status-dot {
|
| 123 |
+
width: 8px;
|
| 124 |
+
height: 8px;
|
| 125 |
+
border-radius: 50%;
|
| 126 |
+
background: var(--success);
|
| 127 |
+
animation: pulse 2s infinite;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.status-dot.error {
|
| 131 |
+
background: var(--danger);
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
@keyframes pulse {
|
| 135 |
+
0%, 100% { opacity: 1; }
|
| 136 |
+
50% { opacity: 0.5; }
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
main {
|
| 140 |
+
max-width: 1400px;
|
| 141 |
+
margin: 1rem auto;
|
| 142 |
+
padding: 0 1rem;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
.nfc-mode-toggle {
|
| 146 |
+
background: rgba(255, 255, 255, 0.95);
|
| 147 |
+
backdrop-filter: blur(10px);
|
| 148 |
+
border-radius: 15px;
|
| 149 |
+
padding: 1rem;
|
| 150 |
+
margin-bottom: 1rem;
|
| 151 |
+
box-shadow: var(--shadow);
|
| 152 |
+
display: flex;
|
| 153 |
+
align-items: center;
|
| 154 |
+
justify-content: space-between;
|
| 155 |
+
flex-wrap: wrap;
|
| 156 |
+
gap: 1rem;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
.toggle-switch {
|
| 160 |
+
display: flex;
|
| 161 |
+
align-items: center;
|
| 162 |
+
gap: 0.75rem;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
.switch {
|
| 166 |
+
position: relative;
|
| 167 |
+
width: 60px;
|
| 168 |
+
height: 30px;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
.switch input {
|
| 172 |
+
opacity: 0;
|
| 173 |
+
width: 0;
|
| 174 |
+
height: 0;
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
.slider {
|
| 178 |
+
position: absolute;
|
| 179 |
+
cursor: pointer;
|
| 180 |
+
top: 0;
|
| 181 |
+
left: 0;
|
| 182 |
+
right: 0;
|
| 183 |
+
bottom: 0;
|
| 184 |
+
background-color: #ccc;
|
| 185 |
+
transition: .4s;
|
| 186 |
+
border-radius: 34px;
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
.slider:before {
|
| 190 |
+
position: absolute;
|
| 191 |
+
content: "";
|
| 192 |
+
height: 22px;
|
| 193 |
+
width: 22px;
|
| 194 |
+
left: 4px;
|
| 195 |
+
bottom: 4px;
|
| 196 |
+
background-color: white;
|
| 197 |
+
transition: .4s;
|
| 198 |
+
border-radius: 50%;
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
input:checked + .slider {
|
| 202 |
+
background-color: var(--primary);
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
input:checked + .slider:before {
|
| 206 |
+
transform: translateX(30px);
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
.app-container {
|
| 210 |
+
display: grid;
|
| 211 |
+
grid-template-columns: 1fr;
|
| 212 |
+
gap: 1rem;
|
| 213 |
+
margin-bottom: 1rem;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
.panel {
|
| 217 |
+
background: rgba(255, 255, 255, 0.95);
|
| 218 |
+
backdrop-filter: blur(10px);
|
| 219 |
+
border-radius: 20px;
|
| 220 |
+
padding: 1.5rem;
|
| 221 |
+
box-shadow: var(--shadow-lg);
|
| 222 |
+
transition: transform 0.3s, box-shadow 0.3s;
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
.panel:hover {
|
| 226 |
+
transform: translateY(-2px);
|
| 227 |
+
box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
.panel-header {
|
| 231 |
+
display: flex;
|
| 232 |
+
align-items: center;
|
| 233 |
+
gap: 1rem;
|
| 234 |
+
margin-bottom: 1.5rem;
|
| 235 |
+
padding-bottom: 1rem;
|
| 236 |
+
border-bottom: 2px solid var(--light);
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
.panel-icon {
|
| 240 |
+
width: 40px;
|
| 241 |
+
height: 40px;
|
| 242 |
+
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 243 |
+
border-radius: 10px;
|
| 244 |
+
display: flex;
|
| 245 |
+
align-items: center;
|
| 246 |
+
justify-content: center;
|
| 247 |
+
color: white;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
.panel h2 {
|
| 251 |
+
font-size: 1.2rem;
|
| 252 |
+
color: var(--dark);
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
.nfc-simulator {
|
| 256 |
+
display: flex;
|
| 257 |
+
flex-direction: column;
|
| 258 |
+
align-items: center;
|
| 259 |
+
gap: 1.5rem;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
.nfc-device {
|
| 263 |
+
width: 150px;
|
| 264 |
+
height: 150px;
|
| 265 |
+
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
|
| 266 |
+
border-radius: 20px;
|
| 267 |
+
display: flex;
|
| 268 |
+
align-items: center;
|
| 269 |
+
justify-content: center;
|
| 270 |
+
position: relative;
|
| 271 |
+
cursor: pointer;
|
| 272 |
+
transition: all 0.3s;
|
| 273 |
+
box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
.nfc-device:hover {
|
| 277 |
+
transform: scale(1.05);
|
| 278 |
+
box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
.nfc-device.active {
|
| 282 |
+
animation: nfcPulse 1s infinite;
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
@keyframes nfcPulse {
|
| 286 |
+
0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
|
| 287 |
+
50% { box-shadow: 0 0 0 20px rgba(99, 102, 241, 0); }
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
.nfc-symbol {
|
| 291 |
+
font-size: 3rem;
|
| 292 |
+
color: white;
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
.data-types {
|
| 296 |
+
display: grid;
|
| 297 |
+
grid-template-columns: repeat(2, 1fr);
|
| 298 |
+
gap: 0.75rem;
|
| 299 |
+
width: 100%;
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
.data-type-btn {
|
| 303 |
+
padding: 0.75rem;
|
| 304 |
+
background: var(--light);
|
| 305 |
+
border: 2px solid transparent;
|
| 306 |
+
border-radius: 12px;
|
| 307 |
+
cursor: pointer;
|
| 308 |
+
transition: all 0.3s;
|
| 309 |
+
text-align: center;
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
.data-type-btn:hover {
|
| 313 |
+
background: white;
|
| 314 |
+
border-color: var(--primary);
|
| 315 |
+
transform: translateY(-2px);
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
.data-type-btn.active {
|
| 319 |
+
background: var(--primary);
|
| 320 |
+
color: white;
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
.data-type-icon {
|
| 324 |
+
font-size: 1.5rem;
|
| 325 |
+
margin-bottom: 0.25rem;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
.data-type-text {
|
| 329 |
+
font-size: 0.85rem;
|
| 330 |
+
font-weight: 500;
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
.data-input-section {
|
| 334 |
+
margin-top: 1.5rem;
|
| 335 |
+
}
|
| 336 |
+
|
| 337 |
+
.input-group {
|
| 338 |
+
margin-bottom: 1rem;
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
.input-group label {
|
| 342 |
+
display: block;
|
| 343 |
+
margin-bottom: 0.5rem;
|
| 344 |
+
font-weight: 500;
|
| 345 |
+
color: var(--dark);
|
| 346 |
+
font-size: 0.9rem;
|
| 347 |
+
}
|
| 348 |
+
|
| 349 |
+
.input-group input,
|
| 350 |
+
.input-group textarea,
|
| 351 |
+
.input-group select {
|
| 352 |
+
width: 100%;
|
| 353 |
+
padding: 0.75rem;
|
| 354 |
+
border: 2px solid var(--light);
|
| 355 |
+
border-radius: 10px;
|
| 356 |
+
font-size: 1rem;
|
| 357 |
+
transition: all 0.3s;
|
| 358 |
+
-webkit-appearance: none;
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
.input-group input:focus,
|
| 362 |
+
.input-group textarea:focus,
|
| 363 |
+
.input-group select:focus {
|
| 364 |
+
outline: none;
|
| 365 |
+
border-color: var(--primary);
|
| 366 |
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
.input-group textarea {
|
| 370 |
+
resize: vertical;
|
| 371 |
+
min-height: 80px;
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
.btn {
|
| 375 |
+
padding: 0.75rem 1.5rem;
|
| 376 |
+
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
|
| 377 |
+
color: white;
|
| 378 |
+
border: none;
|
| 379 |
+
border-radius: 10px;
|
| 380 |
+
font-size: 1rem;
|
| 381 |
+
font-weight: 500;
|
| 382 |
+
cursor: pointer;
|
| 383 |
+
transition: all 0.3s;
|
| 384 |
+
display: inline-flex;
|
| 385 |
+
align-items: center;
|
| 386 |
+
gap: 0.5rem;
|
| 387 |
+
width: 100%;
|
| 388 |
+
justify-content: center;
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
.btn:hover {
|
| 392 |
+
transform: translateY(-2px);
|
| 393 |
+
box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
.btn:active {
|
| 397 |
+
transform: translateY(0);
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
.btn:disabled {
|
| 401 |
+
opacity: 0.5;
|
| 402 |
+
cursor: not-allowed;
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
.btn-secondary {
|
| 406 |
+
background: var(--light);
|
| 407 |
+
color: var(--dark);
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
.btn-success {
|
| 411 |
+
background: linear-gradient(135deg, var(--success), #059669);
|
| 412 |
+
}
|
| 413 |
+
|
| 414 |
+
.btn-danger {
|
| 415 |
+
background: linear-gradient(135deg, var(--danger), #dc2626);
|
| 416 |
+
}
|
| 417 |
+
|
| 418 |
+
.action-buttons {
|
| 419 |
+
display: grid;
|
| 420 |
+
grid-template-columns: 1fr 1fr;
|
| 421 |
+
gap: 0.75rem;
|
| 422 |
+
margin-top: 1.5rem;
|
| 423 |
+
}
|
| 424 |
+
|
| 425 |
+
.history-section {
|
| 426 |
+
background: rgba(255, 255, 255, 0.95);
|
| 427 |
+
backdrop-filter: blur(10px);
|
| 428 |
+
border-radius: 20px;
|
| 429 |
+
padding: 1.5rem;
|
| 430 |
+
box-shadow: var(--shadow-lg);
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
.history-list {
|
| 434 |
+
display: flex;
|
| 435 |
+
flex-direction: column;
|
| 436 |
+
gap: 0.75rem;
|
| 437 |
+
max-height: 300px;
|
| 438 |
+
overflow-y: auto;
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
.history-item {
|
| 442 |
+
padding: 1rem;
|
| 443 |
+
background: var(--light);
|
| 444 |
+
border-radius: 12px;
|
| 445 |
+
display: flex;
|
| 446 |
+
justify-content: space-between;
|
| 447 |
+
align-items: center;
|
| 448 |
+
transition: all 0.3s;
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
.history-item:hover {
|
| 452 |
+
background: white;
|
| 453 |
+
transform: translateX(5px);
|
| 454 |
+
}
|
| 455 |
+
|
| 456 |
+
.history-info {
|
| 457 |
+
flex: 1;
|
| 458 |
+
min-width: 0;
|
| 459 |
+
}
|
| 460 |
+
|
| 461 |
+
.history-type {
|
| 462 |
+
font-weight: 600;
|
| 463 |
+
color: var(--primary);
|
| 464 |
+
margin-bottom: 0.25rem;
|
| 465 |
+
font-size: 0.9rem;
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
.history-time {
|
| 469 |
+
font-size: 0.75rem;
|
| 470 |
+
color: #64748b;
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
.history-actions {
|
| 474 |
+
display: flex;
|
| 475 |
+
gap: 0.25rem;
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
.icon-btn {
|
| 479 |
+
width: 32px;
|
| 480 |
+
height: 32px;
|
| 481 |
+
border-radius: 8px;
|
| 482 |
+
border: none;
|
| 483 |
+
background: white;
|
| 484 |
+
color: var(--primary);
|
| 485 |
+
cursor: pointer;
|
| 486 |
+
transition: all 0.3s;
|
| 487 |
+
display: flex;
|
| 488 |
+
align-items: center;
|
| 489 |
+
justify-content: center;
|
| 490 |
+
font-size: 0.9rem;
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
.icon-btn:hover {
|
| 494 |
+
background: var(--primary);
|
| 495 |
+
color: white;
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
.toast {
|
| 499 |
+
position: fixed;
|
| 500 |
+
bottom: 2rem;
|
| 501 |
+
right: 1rem;
|
| 502 |
+
left: 1rem;
|
| 503 |
+
padding: 1rem;
|
| 504 |
+
background: white;
|
| 505 |
+
border-radius: 12px;
|
| 506 |
+
box-shadow: var(--shadow-lg);
|
| 507 |
+
display: flex;
|
| 508 |
+
align-items: center;
|
| 509 |
+
gap: 1rem;
|
| 510 |
+
transform: translateY(100px);
|
| 511 |
+
transition: transform 0.3s;
|
| 512 |
+
z-index: 1000;
|
| 513 |
+
max-width: 400px;
|
| 514 |
+
margin: 0 auto;
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
.toast.show {
|
| 518 |
+
transform: translateY(0);
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
.toast-icon {
|
| 522 |
+
width: 30px;
|
| 523 |
+
height: 30px;
|
| 524 |
+
border-radius: 50%;
|
| 525 |
+
display: flex;
|
| 526 |
+
align-items: center;
|
| 527 |
+
justify-content: center;
|
| 528 |
+
flex-shrink: 0;
|
| 529 |
+
}
|
| 530 |
+
|
| 531 |
+
.toast.success .toast-icon {
|
| 532 |
+
background: var(--success);
|
| 533 |
+
color: white;
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
.toast.error .toast-icon {
|
| 537 |
+
background: var(--danger);
|
| 538 |
+
color: white;
|
| 539 |
+
}
|
| 540 |
+
|
| 541 |
+
.toast.info .toast-icon {
|
| 542 |
+
background: var(--primary);
|
| 543 |
+
color: white;
|
| 544 |
+
}
|
| 545 |
+
|
| 546 |
+
.modal {
|
| 547 |
+
display: none;
|
| 548 |
+
position: fixed;
|
| 549 |
+
top: 0;
|
| 550 |
+
left: 0;
|
| 551 |
+
width: 100%;
|
| 552 |
+
height: 100%;
|
| 553 |
+
background: rgba(0, 0, 0, 0.5);
|
| 554 |
+
backdrop-filter: blur(5px);
|
| 555 |
+
align-items: center;
|
| 556 |
+
justify-content: center;
|
| 557 |
+
z-index: 200;
|
| 558 |
+
padding: 1rem;
|
| 559 |
+
}
|
| 560 |
+
|
| 561 |
+
.modal.active {
|
| 562 |
+
display: flex;
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
.modal-content {
|
| 566 |
+
background: white;
|
| 567 |
+
border-radius: 20px;
|
| 568 |
+
padding: 1.5rem;
|
| 569 |
+
max-width: 500px;
|
| 570 |
+
width: 100%;
|
| 571 |
+
max-height: 80vh;
|
| 572 |
+
overflow-y: auto;
|
| 573 |
+
animation: modalSlideIn 0.3s;
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
@keyframes modalSlideIn {
|
| 577 |
+
from { transform: translateY(-50px); opacity: 0; }
|
| 578 |
+
to { transform: translateY(0); opacity: 1; }
|
| 579 |
+
}
|
| 580 |
+
|
| 581 |
+
.modal-header {
|
| 582 |
+
display: flex;
|
| 583 |
+
justify-content: space-between;
|
| 584 |
+
align-items: center;
|
| 585 |
+
margin-bottom: 1.5rem;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
.modal-close {
|
| 589 |
+
width: 30px;
|
| 590 |
+
height: 30px;
|
| 591 |
+
border-radius: 50%;
|
| 592 |
+
border: none;
|
| 593 |
+
background: var(--light);
|
| 594 |
+
cursor: pointer;
|
| 595 |
+
transition: all 0.3s;
|
| 596 |
+
}
|
| 597 |
+
|
| 598 |
+
.modal-close:hover {
|
| 599 |
+
background: var(--danger);
|
| 600 |
+
color: white;
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
.progress-bar {
|
| 604 |
+
width: 100%;
|
| 605 |
+
height: 6px;
|
| 606 |
+
background: var(--light);
|
| 607 |
+
border-radius: 3px;
|
| 608 |
+
overflow: hidden;
|
| 609 |
+
margin-top: 1rem;
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
.progress-fill {
|
| 613 |
+
height: 100%;
|
| 614 |
+
background: linear-gradient(90deg, var(--primary), var(--secondary));
|
| 615 |
+
border-radius: 3px;
|
| 616 |
+
width: 0;
|
| 617 |
+
transition: width 0.3s;
|
| 618 |
+
}
|
| 619 |
+
|
| 620 |
+
.format-options {
|
| 621 |
+
display: flex;
|
| 622 |
+
gap: 0.5rem;
|
| 623 |
+
margin-top: 1rem;
|
| 624 |
+
flex-wrap: wrap;
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
.format-chip {
|
| 628 |
+
padding: 0.5rem 0.75rem;
|
| 629 |
+
background: var(--light);
|
| 630 |
+
border: 2px solid transparent;
|
| 631 |
+
border-radius: 20px;
|
| 632 |
+
cursor: pointer;
|
| 633 |
+
transition: all 0.3s;
|
| 634 |
+
font-size: 0.85rem;
|
| 635 |
+
}
|
| 636 |
+
|
| 637 |
+
.format-chip:hover {
|
| 638 |
+
border-color: var(--primary);
|
| 639 |
+
}
|
| 640 |
+
|
| 641 |
+
.format-chip.active {
|
| 642 |
+
background: var(--primary);
|
| 643 |
+
color: white;
|
| 644 |
+
}
|
| 645 |
+
|
| 646 |
+
.scan-overlay {
|
| 647 |
+
position: fixed;
|
| 648 |
+
top: 0;
|
| 649 |
+
left: 0;
|
| 650 |
+
width: 100%;
|
| 651 |
+
height: 100%;
|
| 652 |
+
background: rgba(0, 0, 0, 0.8);
|
| 653 |
+
display: none;
|
| 654 |
+
align-items: center;
|
| 655 |
+
justify-content: center;
|
| 656 |
+
z-index: 300;
|
| 657 |
+
}
|
| 658 |
+
|
| 659 |
+
.scan-overlay.active {
|
| 660 |
+
display: flex;
|
| 661 |
+
}
|
| 662 |
+
|
| 663 |
+
.scan-content {
|
| 664 |
+
text-align: center;
|
| 665 |
+
color: white;
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
.scan-animation {
|
| 669 |
+
width: 200px;
|
| 670 |
+
height: 200px;
|
| 671 |
+
border: 3px solid var(--primary);
|
| 672 |
+
border-radius: 20px;
|
| 673 |
+
margin: 0 auto 2rem;
|
| 674 |
+
position: relative;
|
| 675 |
+
animation: scanPulse 1.5s infinite;
|
| 676 |
+
}
|
| 677 |
+
|
| 678 |
+
@keyframes scanPulse {
|
| 679 |
+
0%, 100% { transform: scale(1); opacity: 1; }
|
| 680 |
+
50% { transform: scale(1.1); opacity: 0.8; }
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
+
.scan-animation::before {
|
| 684 |
+
content: '📱';
|
| 685 |
+
position: absolute;
|
| 686 |
+
top: 50%;
|
| 687 |
+
left: 50%;
|
| 688 |
+
transform: translate(-50%, -50%);
|
| 689 |
+
font-size: 3rem;
|
| 690 |
+
}
|
| 691 |
+
|
| 692 |
+
@media (min-width: 768px) {
|
| 693 |
+
.app-container {
|
| 694 |
+
grid-template-columns: 1fr 1fr;
|
| 695 |
+
}
|
| 696 |
+
|
| 697 |
+
.data-types {
|
| 698 |
+
grid-template-columns: repeat(4, 1fr);
|
| 699 |
+
}
|
| 700 |
+
|
| 701 |
+
.action-buttons {
|
| 702 |
+
grid-template-columns: 1fr 1fr;
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
main {
|
| 706 |
+
padding: 0 2rem;
|
| 707 |
+
}
|
| 708 |
+
}
|
| 709 |
+
|
| 710 |
+
@media (min-width: 1024px) {
|
| 711 |
+
.toast {
|
| 712 |
+
left: auto;
|
| 713 |
+
right: 2rem;
|
| 714 |
+
}
|
| 715 |
+
}
|
| 716 |
+
</style>
|
| 717 |
</head>
|
| 718 |
+
|
| 719 |
<body>
|
| 720 |
+
<div class="animated-bg"></div>
|
| 721 |
+
|
| 722 |
+
<header>
|
| 723 |
+
<div class="header-content">
|
| 724 |
+
<div class="logo">
|
| 725 |
+
<div class="logo-icon">N</div>
|
| 726 |
+
<h1>NFC Hub</h1>
|
| 727 |
+
</div>
|
| 728 |
+
<div class="status-indicator" id="statusIndicator">
|
| 729 |
+
<span class="status-dot" id="statusDot"></span>
|
| 730 |
+
<span id="statusText">Checking NFC...</span>
|
| 731 |
+
</div>
|
| 732 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank"
|
| 733 |
+
style="color: var(--primary); text-decoration: none; font-weight: 500; font-size: 0.85rem;">
|
| 734 |
+
Built with anycoder
|
| 735 |
+
</a>
|
| 736 |
+
</div>
|
| 737 |
+
</header>
|
| 738 |
+
|
| 739 |
+
<main>
|
| 740 |
+
<div class="nfc-mode-toggle">
|
| 741 |
+
<div>
|
| 742 |
+
<strong>NFC Mode:</strong>
|
| 743 |
+
<span id="modeText">Real NFC</span>
|
| 744 |
+
</div>
|
| 745 |
+
<div class="toggle-switch">
|
| 746 |
+
<span>Simulator</span>
|
| 747 |
+
<label class="switch">
|
| 748 |
+
<input type="checkbox" id="modeToggle">
|
| 749 |
+
<span class="slider"></span>
|
| 750 |
+
</label>
|
| 751 |
+
<span>Real NFC</span>
|
| 752 |
+
</div>
|
| 753 |
+
</div>
|
| 754 |
+
|
| 755 |
+
<div class="app-container">
|
| 756 |
+
<!-- NFC Device Panel -->
|
| 757 |
+
<div class="panel">
|
| 758 |
+
<div class="panel-header">
|
| 759 |
+
<div class="panel-icon" id="deviceIcon">📡</div>
|
| 760 |
+
<h2 id="deviceTitle">NFC Device</h2>
|
| 761 |
+
</div>
|
| 762 |
+
<div class="nfc-simulator">
|
| 763 |
+
<div class="nfc-device" id="nfcDevice">
|
| 764 |
+
<div class="nfc-symbol">📱</div>
|
| 765 |
+
</div>
|
| 766 |
+
<div class="data-types">
|
| 767 |
+
<div class="data-type-btn active" data-type="text">
|
| 768 |
+
<div class="data-type-icon">📝</div>
|
| 769 |
+
<div class="data-type-text">Text</div>
|
| 770 |
</div>
|
| 771 |
+
<div class="data-type-btn" data-type="url">
|
| 772 |
+
<div class="data-type-icon">🔗</div>
|
| 773 |
+
<div class="data-type-text">URL</div>
|
| 774 |
</div>
|
| 775 |
+
<div class="data-type-btn" data-type="contact">
|
| 776 |
+
<div class="data-type-icon">👤</div>
|
| 777 |
+
<div class="data-type-text">Contact</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 778 |
</div>
|
| 779 |
+
<div class="data-type-btn" data-type="wifi">
|
| 780 |
+
<div class="data-type-icon">📶</div>
|
| 781 |
+
<div class="data-type-text">WiFi</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 782 |
</div>
|
| 783 |
+
</div>
|
| 784 |
+
<button class="btn btn-success" id="scanBtn" style="display: none;">
|
| 785 |
+
<span>🔍</span>
|
| 786 |
+
<span>Scan NFC Tag</span>
|
| 787 |
+
</button>
|
| 788 |
</div>
|
| 789 |
+
</div>
|
| 790 |
|
| 791 |
+
<!-- Data Input Panel -->
|
| 792 |
+
<div class="panel">
|
| 793 |
+
<div class="panel-header">
|
| 794 |
+
<div class="panel-icon">💾</div>
|
| 795 |
+
<h2>Data Input</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 796 |
</div>
|
| 797 |
+
<div class="data-input-section" id="dataInputSection">
|
| 798 |
+
<div class="input-group">
|
| 799 |
+
<label for="textInput">Text Message</label>
|
| 800 |
+
<textarea id="textInput" placeholder="Enter your text message here..." rows="3"></textarea>
|
| 801 |
+
</div>
|
| 802 |
+
<div class="format-options">
|
| 803 |
+
<div class="format-chip active" data-format="plain">Plain</div>
|
| 804 |
+
<div class="format-chip" data-format="json">JSON</div>
|
| 805 |
+
<div class="format-chip" data-format="base64">Base64</div>
|
| 806 |
+
<div class="format-chip" data-format="hex">Hex</div>
|
| 807 |
+
</div>
|
| 808 |
</div>
|
| 809 |
+
<div class="action-buttons">
|
| 810 |
+
<button class="btn btn-success" id="writeBtn">
|
| 811 |
+
<span>✍️</span>
|
| 812 |
+
<span>Write to NFC</span>
|
| 813 |
+
</button>
|
| 814 |
+
<button class="btn btn-secondary" id="clearBtn">
|
| 815 |
+
<span>🗑️</span>
|
| 816 |
+
<span>Clear</span>
|
| 817 |
+
</button>
|
| 818 |
+
</div>
|
| 819 |
+
<div class="progress-bar">
|
| 820 |
+
<div class="progress-fill" id="progressBar"></div>
|
| 821 |
+
</div>
|
| 822 |
+
</div>
|
| 823 |
</div>
|
| 824 |
|
| 825 |
+
<!-- History Section -->
|
| 826 |
+
<div class="history-section">
|
| 827 |
+
<div class="panel-header">
|
| 828 |
+
<div class="panel-icon">📋</div>
|
| 829 |
+
<h2>Transfer History</h2>
|
| 830 |
+
</div>
|
| 831 |
+
<div class="history-list" id="historyList">
|
| 832 |
+
<div class="history-item">
|
| 833 |
+
<div class="history-info">
|
| 834 |
+
<div class="history-type">📝 Welcome Message</div>
|
| 835 |
+
<div class="history-time">Just now</div>
|
| 836 |
+
</div>
|
| 837 |
+
<div class="history-actions">
|
| 838 |
+
<button class="icon-btn">👁️</button>
|
| 839 |
+
<button class="icon-btn">📋</button>
|
| 840 |
+
<button class="icon-btn">🔄</button>
|
| 841 |
+
</div>
|
| 842 |
+
</div>
|
| 843 |
+
</div>
|
| 844 |
</div>
|
| 845 |
+
</main>
|
| 846 |
+
|
| 847 |
+
<!-- Scan Overlay -->
|
| 848 |
+
<div class="scan-overlay" id="scanOverlay">
|
| 849 |
+
<div class="scan-content">
|
| 850 |
+
<div class="scan-animation"></div>
|
| 851 |
+
<h2>Hold your device near an NFC tag</h2>
|
| 852 |
+
<p id="scanStatus">Waiting for tag...</p>
|
| 853 |
+
<button class="btn btn-danger" id="cancelScan" style="margin-top: 2rem;">
|
| 854 |
+
Cancel Scan
|
| 855 |
+
</button>
|
| 856 |
+
</div>
|
| 857 |
+
</div>
|
| 858 |
+
|
| 859 |
+
<!-- Modal for viewing data -->
|
| 860 |
+
<div class="modal" id="viewModal">
|
| 861 |
+
<div class="modal-content">
|
| 862 |
+
<div class="modal-header">
|
| 863 |
+
<h2>View Data</h2>
|
| 864 |
+
<button class="modal-close" id="closeModal">✕</button>
|
| 865 |
+
</div>
|
| 866 |
+
<div id="modalBody"></div>
|
| 867 |
+
</div>
|
| 868 |
+
</div>
|
| 869 |
+
|
| 870 |
+
<!-- Toast Notification -->
|
| 871 |
+
<div class="toast" id="toast">
|
| 872 |
+
<div class="toast-icon">✓</div>
|
| 873 |
+
<div class="toast-message" id="toastMessage">Operation successful!</div>
|
| 874 |
+
</div>
|
| 875 |
+
|
| 876 |
+
<script>
|
| 877 |
+
// Global state
|
| 878 |
+
let currentDataType = 'text';
|
| 879 |
+
let currentFormat = 'plain';
|
| 880 |
+
let transferHistory = [];
|
| 881 |
+
let isTransferring = false;
|
| 882 |
+
let useRealNFC = false;
|
| 883 |
+
let nfcSupported = false;
|
| 884 |
+
let nfcPermission = false;
|
| 885 |
+
|
| 886 |
+
// DOM elements
|
| 887 |
+
const nfcDevice = document.getElementById('nfcDevice');
|
| 888 |
+
const dataInputSection = document.getElementById('dataInputSection');
|
| 889 |
+
const writeBtn = document.getElementById('writeBtn');
|
| 890 |
+
const scanBtn = document.getElementById('scanBtn');
|
| 891 |
+
const clearBtn = document.getElementById('clearBtn');
|
| 892 |
+
const progressBar = document.getElementById('progressBar');
|
| 893 |
+
const historyList = document.getElementById('historyList');
|
| 894 |
+
const toast = document.getElementById('toast');
|
| 895 |
+
const toastMessage = document.getElementById('toastMessage');
|
| 896 |
+
const viewModal = document.getElementById('viewModal');
|
| 897 |
+
const modalBody = document.getElementById('modalBody');
|
| 898 |
+
const closeModal = document.getElementById('closeModal');
|
| 899 |
+
const modeToggle = document.getElementById('modeToggle');
|
| 900 |
+
const modeText = document.getElementById('modeText');
|
| 901 |
+
const deviceTitle = document.getElementById('deviceTitle');
|
| 902 |
+
const deviceIcon = document.getElementById('deviceIcon');
|
| 903 |
+
const statusText = document.getElementById('statusText');
|
| 904 |
+
const statusDot = document.getElementById('statusDot');
|
| 905 |
+
const scanOverlay = document.getElementById('scanOverlay');
|
| 906 |
+
const cancelScan = document.getElementById('cancelScan');
|
| 907 |
+
const scanStatus = document.getElementById('scanStatus');
|
| 908 |
+
|
| 909 |
+
// Data type templates
|
| 910 |
+
const dataTemplates = {
|
| 911 |
+
text: `
|
| 912 |
+
<div class="input-group">
|
| 913 |
+
<label for="textInput">Text Message</label>
|
| 914 |
+
<textarea id="textInput" placeholder="Enter your text message here..." rows="3"></textarea>
|
| 915 |
+
</div>
|
| 916 |
+
`,
|
| 917 |
+
url: `
|
| 918 |
+
<div class="input-group">
|
| 919 |
+
<label for="urlInput">URL</label>
|
| 920 |
+
<input type="url" id="urlInput" placeholder="https://example.com">
|
| 921 |
+
</div>
|
| 922 |
+
<div class="input-group">
|
| 923 |
+
<label for="urlTitle">Title (Optional)</label>
|
| 924 |
+
<input type="text" id="urlTitle" placeholder="Website Title">
|
| 925 |
+
</div>
|
| 926 |
+
`,
|
| 927 |
+
contact: `
|
| 928 |
+
<div class="input-group">
|
| 929 |
+
<label for="contactName">Name</label>
|
| 930 |
+
<input type="text" id="contactName" placeholder="John Doe">
|
| 931 |
+
</div>
|
| 932 |
+
<div class="input-group">
|
| 933 |
+
<label for="contactPhone">Phone</label>
|
| 934 |
+
<input type="tel" id="contactPhone" placeholder="+1234567890">
|
| 935 |
+
</div>
|
| 936 |
+
<div class="input-group">
|
| 937 |
+
<label for="contactEmail">Email</label>
|
| 938 |
+
<input type="email" id="contactEmail" placeholder="john@example.com">
|
| 939 |
+
</div>
|
| 940 |
+
`,
|
| 941 |
+
wifi: `
|
| 942 |
+
<div class="input-group">
|
| 943 |
+
<label for="wifiSSID">Network Name (SSID)</label>
|
| 944 |
+
<input type="text" id="wifiSSID" placeholder="MyWiFi">
|
| 945 |
+
</div>
|
| 946 |
+
<div class="input-group">
|
| 947 |
+
<label for="wifiPassword">Password</label>
|
| 948 |
+
<input type="password" id="wifiPassword" placeholder="••••••••">
|
| 949 |
+
</div>
|
| 950 |
+
<div class="input-group">
|
| 951 |
+
<label for="wifiSecurity">Security Type</label>
|
| 952 |
+
<select id="wifiSecurity">
|
| 953 |
+
<option value="WPA">WPA/WPA2</option>
|
| 954 |
+
<option value="WEP">WEP</option>
|
| 955 |
+
<option value="nopass">Open Network</option>
|
| 956 |
+
</select>
|
| 957 |
+
</div>
|
| 958 |
+
`
|
| 959 |
+
};
|
| 960 |
+
|
| 961 |
+
// Initialize NFC support check
|
| 962 |
+
async function checkNFCSupport() {
|
| 963 |
+
if ('NDEFReader' in window) {
|
| 964 |
+
nfcSupported = true;
|
| 965 |
+
try {
|
| 966 |
+
const ndef = new NDEFReader();
|
| 967 |
+
await ndef.scan();
|
| 968 |
+
nfcPermission = true;
|
| 969 |
+
updateStatus('NFC Ready', true);
|
| 970 |
+
modeToggle.checked = true;
|
| 971 |
+
useRealNFC = true;
|
| 972 |
+
updateNFCMode(true);
|
| 973 |
+
} catch (error) {
|
| 974 |
+
if (error.name === 'NotAllowedError') {
|
| 975 |
+
updateStatus('NFC Permission Required', false);
|
| 976 |
+
showToast('NFC permission required. Please grant access.', 'info');
|
| 977 |
+
} else {
|
| 978 |
+
updateStatus('NFC Error', false);
|
| 979 |
+
}
|
| 980 |
+
}
|
| 981 |
+
} else {
|
| 982 |
+
nfcSupported = false;
|
| 983 |
+
updateStatus('NFC Not Supported', false);
|
| 984 |
+
modeToggle.checked = false;
|
| 985 |
+
useRealNFC = false;
|
| 986 |
+
updateNFCMode(false);
|
| 987 |
+
}
|
| 988 |
+
}
|
| 989 |
+
|
| 990 |
+
function updateStatus(text, success) {
|
| 991 |
+
statusText.textContent = text;
|
| 992 |
+
if (success) {
|
| 993 |
+
statusDot.classList.remove('error');
|
| 994 |
+
} else {
|
| 995 |
+
statusDot.classList.add('error');
|
| 996 |
+
}
|
| 997 |
+
}
|
| 998 |
+
|
| 999 |
+
function updateNFCMode(useReal) {
|
| 1000 |
+
useRealNFC = useReal;
|
| 1001 |
+
if (useReal) {
|
| 1002 |
+
modeText.textContent = 'Real NFC';
|
| 1003 |
+
deviceTitle.textContent = 'NFC Device';
|
| 1004 |
+
deviceIcon.textContent = '📱';
|
| 1005 |
+
scanBtn.style.display = 'block';
|
| 1006 |
+
writeBtn.innerHTML = '<span>✍️</span><span>Write to NFC</span>';
|
| 1007 |
+
} else {
|
| 1008 |
+
modeText.textContent = 'Simulator';
|
| 1009 |
+
deviceTitle.textContent = 'NFC Simulator';
|
| 1010 |
+
deviceIcon.textContent = '📡';
|
| 1011 |
+
scanBtn.style.display = 'none';
|
| 1012 |
+
writeBtn.innerHTML = '<span>⚡</span><span>Transfer Data</span>';
|
| 1013 |
+
}
|
| 1014 |
+
}
|
| 1015 |
+
|
| 1016 |
+
// Event listeners
|
| 1017 |
+
modeToggle.addEventListener('change', (e) => {
|
| 1018 |
+
updateNFCMode(e.target.checked);
|
| 1019 |
+
if (e.target.checked && !nfcSupported) {
|
| 1020 |
+
showToast('NFC not supported on this device', 'error');
|
| 1021 |
+
modeToggle.checked = false;
|
| 1022 |
+
updateNFCMode(false);
|
| 1023 |
+
}
|
| 1024 |
+
});
|
| 1025 |
+
|
| 1026 |
+
document.querySelectorAll('.data-type-btn').forEach(btn => {
|
| 1027 |
+
btn.addEventListener('click', function() {
|
| 1028 |
+
document.querySelectorAll('.data-type-btn').forEach(b => b.classList.remove('active'));
|
| 1029 |
+
this.classList.add('active');
|
| 1030 |
+
currentDataType = this.dataset.type;
|
| 1031 |
+
updateDataInput();
|
| 1032 |
+
});
|
| 1033 |
+
});
|
| 1034 |
+
|
| 1035 |
+
document.querySelectorAll('.format-chip').forEach(chip => {
|
| 1036 |
+
chip.addEventListener('click', function() {
|
| 1037 |
+
document.querySelectorAll('.format-chip').forEach(c => c.classList.remove('active'));
|
| 1038 |
+
this.classList.add('active');
|
| 1039 |
+
currentFormat = this.dataset.format;
|
| 1040 |
+
});
|
| 1041 |
+
});
|
| 1042 |
+
|
| 1043 |
+
nfcDevice.addEventListener('click', () => {
|
| 1044 |
+
if (useRealNFC) {
|
| 1045 |
+
requestNFCTap();
|
| 1046 |
+
} else {
|
| 1047 |
+
simulateTransfer();
|
| 1048 |
+
}
|
| 1049 |
+
});
|
| 1050 |
+
|
| 1051 |
+
writeBtn.addEventListener('click', () => {
|
| 1052 |
+
if (useRealNFC) {
|
| 1053 |
+
writeToNFC();
|
| 1054 |
+
} else {
|
| 1055 |
+
initiateTransfer();
|
| 1056 |
+
}
|
| 1057 |
+
});
|
| 1058 |
+
|
| 1059 |
+
clearBtn.addEventListener('click', clearData);
|
| 1060 |
+
scanBtn.addEventListener('click', scanNFC);
|
| 1061 |
+
cancelScan.addEventListener('click', () => {
|
| 1062 |
+
scanOverlay.classList.remove('active');
|
| 1063 |
+
});
|
| 1064 |
+
closeModal.addEventListener('click', () => viewModal.classList.remove('active'));
|
| 1065 |
+
|
| 1066 |
+
function updateDataInput() {
|
| 1067 |
+
dataInputSection.innerHTML = dataTemplates[currentDataType] + `
|
| 1068 |
+
<div class="format-options">
|
| 1069 |
+
<div class="format-chip ${currentFormat === 'plain' ? 'active' : ''}" data-format="plain">Plain</div>
|
| 1070 |
+
<div class="format-chip ${currentFormat === 'json' ? 'active' : ''}" data-format="json">JSON</div>
|
| 1071 |
+
<div class="format-chip ${currentFormat === 'base64' ? 'active' : ''}" data-format="base64">Base64</div>
|
| 1072 |
+
<div class="format-chip ${currentFormat === 'hex' ? 'active' : ''}" data-format="hex">Hex</div>
|
| 1073 |
+
</div>
|
| 1074 |
+
`;
|
| 1075 |
+
|
| 1076 |
+
// Re-attach format chip listeners
|
| 1077 |
+
document.querySelectorAll('.format-chip').forEach(chip => {
|
| 1078 |
+
chip.addEventListener('click', function() {
|
| 1079 |
+
document.querySelectorAll('.format-chip').forEach(c => c.classList.remove('active'));
|
| 1080 |
+
this.classList.add('active');
|
| 1081 |
+
currentFormat = this.dataset.format;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1082 |
});
|
| 1083 |
+
});
|
| 1084 |
+
}
|
| 1085 |
+
|
| 1086 |
+
function simulateTransfer() {
|
| 1087 |
+
if (isTransferring) return;
|
| 1088 |
+
nfcDevice.classList.add('active');
|
| 1089 |
+
setTimeout(() => {
|
| 1090 |
+
nfcDevice.classList.remove('active');
|
| 1091 |
+
}, 1000);
|
| 1092 |
+
}
|
| 1093 |
+
|
| 1094 |
+
async function requestNFCTap() {
|
| 1095 |
+
if (!nfcSupported || !nfcPermission) {
|
| 1096 |
+
showToast('NFC not available or permission denied', 'error');
|
| 1097 |
+
return;
|
| 1098 |
+
}
|
| 1099 |
+
|
| 1100 |
+
showToast('Tap your phone on an NFC tag', 'info');
|
| 1101 |
+
nfcDevice.classList.add('active');
|
| 1102 |
+
|
| 1103 |
+
setTimeout(() => {
|
| 1104 |
+
nfcDevice.classList.remove('active');
|
| 1105 |
+
}, 2000);
|
| 1106 |
+
}
|
| 1107 |
+
|
| 1108 |
+
async function scanNFC() {
|
| 1109 |
+
if (!nfcSupported) {
|
| 1110 |
+
showToast('NFC not supported', 'error');
|
| 1111 |
+
return;
|
| 1112 |
+
}
|
| 1113 |
+
|
| 1114 |
+
try {
|
| 1115 |
+
const ndef = new NDEFReader();
|
| 1116 |
+
scanOverlay.classList.add('active');
|
| 1117 |
+
scanStatus.textContent = 'Scanning for NFC tags...';
|
| 1118 |
+
|
| 1119 |
+
await ndef.scan();
|
| 1120 |
+
showToast('Ready to scan', 'success');
|
| 1121 |
+
|
| 1122 |
+
ndef.addEventListener("reading", ({ message, serialNumber }) => {
|
| 1123 |
+
scanOverlay.classList.remove('active');
|
| 1124 |
+
handleNFCRead(message, serialNumber);
|
| 1125 |
});
|
| 1126 |
+
|
| 1127 |
+
} catch (error) {
|
| 1128 |
+
scanOverlay.classList.remove('active');
|
| 1129 |
+
showToast('Failed to start NFC scan: ' + error.message, 'error');
|
| 1130 |
+
}
|
| 1131 |
+
}
|
| 1132 |
+
|
| 1133 |
+
function handleNFCRead(message, serialNumber) {
|
| 1134 |
+
let data = {
|
| 1135 |
+
type: 'text',
|
| 1136 |
+
content: '',
|
| 1137 |
+
serialNumber: serialNumber,
|
| 1138 |
+
timestamp: new Date()
|
| 1139 |
+
};
|
| 1140 |
+
|
| 1141 |
+
for (const record of message.records) {
|
| 1142 |
+
if (record.recordType === "text") {
|
| 1143 |
+
const textDecoder = new TextDecoder(record.encoding);
|
| 1144 |
+
data.content = textDecoder.decode(record.data);
|
| 1145 |
+
data.type = 'text';
|
| 1146 |
+
} else if (record.recordType === "url") {
|
| 1147 |
+
const textDecoder = new TextDecoder();
|
| 1148 |
+
data.content = textDecoder.decode(record.data);
|
| 1149 |
+
data.type = 'url';
|
| 1150 |
+
}
|
| 1151 |
+
}
|
| 1152 |
+
|
| 1153 |
+
const historyItem = {
|
| 1154 |
+
id: Date.now(),
|
| 1155 |
+
type: 'read',
|
| 1156 |
+
data: data,
|
| 1157 |
+
timestamp: new Date()
|
| 1158 |
+
};
|
| 1159 |
+
|
| 1160 |
+
transferHistory.unshift(historyItem);
|
| 1161 |
+
updateHistoryDisplay();
|
| 1162 |
+
showToast('NFC data read successfully!', 'success');
|
| 1163 |
+
}
|
| 1164 |
+
|
| 1165 |
+
async function writeToNFC() {
|
| 1166 |
+
if (!nfcSupported) {
|
| 1167 |
+
showToast('NFC not supported', 'error');
|
| 1168 |
+
return;
|
| 1169 |
+
}
|
| 1170 |
+
|
| 1171 |
+
const data = collectData();
|
| 1172 |
+
if (!validateData(data)) {
|
| 1173 |
+
showToast('Please fill in the required fields', 'error');
|
| 1174 |
+
return;
|
| 1175 |
+
}
|
| 1176 |
+
|
| 1177 |
+
try {
|
| 1178 |
+
isTransferring = true;
|