|
425 | 425 | color: white; |
426 | 426 | } |
427 | 427 | .bg-reset-button:hover { background-color: #4b5563; } |
| 428 | + |
| 429 | + .about-button-row { |
| 430 | + margin-top: 1.5rem; |
| 431 | + text-align: center; |
| 432 | + } |
| 433 | + |
| 434 | + .about-button { |
| 435 | + cursor: pointer; |
| 436 | + padding: 0.4rem 1.1rem; |
| 437 | + background-color: transparent; |
| 438 | + color: #9ca3af; |
| 439 | + border: 1px solid #4b5563; |
| 440 | + border-radius: 0.5rem; |
| 441 | + font-size: 0.8rem; |
| 442 | + transition: background-color 0.2s, color 0.2s; |
| 443 | + } |
| 444 | + .about-button:hover { |
| 445 | + background-color: #374151; |
| 446 | + color: #e5e7eb; |
| 447 | + } |
| 448 | + |
| 449 | + .modal-backdrop { |
| 450 | + position: fixed; |
| 451 | + inset: 0; |
| 452 | + background-color: rgba(0, 0, 0, 0.6); |
| 453 | + display: flex; |
| 454 | + align-items: center; |
| 455 | + justify-content: center; |
| 456 | + z-index: 100; |
| 457 | + } |
| 458 | + |
| 459 | + .modal-box { |
| 460 | + background-color: #1f2937; |
| 461 | + border: 1px solid #4b5563; |
| 462 | + border-radius: 0.75rem; |
| 463 | + padding: 2rem; |
| 464 | + max-width: 22rem; |
| 465 | + width: 90%; |
| 466 | + text-align: center; |
| 467 | + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); |
| 468 | + } |
| 469 | + |
| 470 | + .modal-box h2 { |
| 471 | + font-size: 1.25rem; |
| 472 | + font-weight: 700; |
| 473 | + color: white; |
| 474 | + margin-bottom: 1rem; |
| 475 | + } |
| 476 | + |
| 477 | + .modal-box p { |
| 478 | + color: #d1d5db; |
| 479 | + font-size: 0.875rem; |
| 480 | + margin-bottom: 0.5rem; |
| 481 | + } |
| 482 | + |
| 483 | + .modal-box a { |
| 484 | + color: #60a5fa; |
| 485 | + text-decoration: none; |
| 486 | + } |
| 487 | + .modal-box a:hover { text-decoration: underline; } |
| 488 | + |
| 489 | + .modal-close-button { |
| 490 | + margin-top: 1.5rem; |
| 491 | + cursor: pointer; |
| 492 | + padding: 0.5rem 1.5rem; |
| 493 | + background-color: #374151; |
| 494 | + color: #e5e7eb; |
| 495 | + border: 1px solid #4b5563; |
| 496 | + border-radius: 0.5rem; |
| 497 | + font-size: 0.875rem; |
| 498 | + transition: background-color 0.2s; |
| 499 | + } |
| 500 | + .modal-close-button:hover { background-color: #4b5563; } |
428 | 501 | </style> |
429 | 502 | </head> |
430 | 503 |
|
@@ -572,6 +645,12 @@ <h3 class="result-label">Bounding Box Center</h3> |
572 | 645 | <h3>No image selected</h3> |
573 | 646 | <p>Upload a PNG with transparency for the best results.</p> |
574 | 647 | </div> |
| 648 | + |
| 649 | + <!-- About button --> |
| 650 | + <div class="about-button-row"> |
| 651 | + <button id="aboutButton" class="about-button">About</button> |
| 652 | + </div> |
| 653 | + |
575 | 654 | </div> |
576 | 655 | </div> |
577 | 656 |
|
@@ -1063,6 +1142,23 @@ <h3>No image selected</h3> |
1063 | 1142 | const canvasContainer = canvas.parentElement; |
1064 | 1143 | new ResizeObserver(repositionMarkers).observe(canvasContainer); |
1065 | 1144 |
|
| 1145 | + // --- About Modal --- |
| 1146 | + const aboutButton = document.getElementById('aboutButton'); |
| 1147 | + aboutButton.addEventListener('click', () => { |
| 1148 | + const backdrop = document.createElement('div'); |
| 1149 | + backdrop.className = 'modal-backdrop'; |
| 1150 | + backdrop.innerHTML = ` |
| 1151 | + <div class="modal-box"> |
| 1152 | + <h2>Visual Centroid Calculator</h2> |
| 1153 | + <p>Source Repo:<br><a href="https://github.com/ThioJoe/Browser-Based-Tools" target="_blank" rel="noopener noreferrer">github.com/ThioJoe/Browser-Based-Tools</a></p> |
| 1154 | + <p>Author:<br><a href="https://github.com/ThioJoe" target="_blank" rel="noopener noreferrer">ThioJoe</a></p> |
| 1155 | + <button class="modal-close-button">Close</button> |
| 1156 | + </div>`; |
| 1157 | + backdrop.querySelector('.modal-close-button').addEventListener('click', () => backdrop.remove()); |
| 1158 | + backdrop.addEventListener('click', (e) => { if (e.target === backdrop) backdrop.remove(); }); |
| 1159 | + document.body.appendChild(backdrop); |
| 1160 | + }); |
| 1161 | + |
1066 | 1162 | </script> |
1067 | 1163 | </body> |
1068 | 1164 |
|
|
0 commit comments