Advertisement
NewBestPastebins

Nill-kickers | Aim Trainer

Apr 16th, 2025
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5. <meta charset="UTF-8">
  6. <title>Aim Trainer</title>
  7. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. box-sizing: border-box;
  12. }
  13.  
  14. body {
  15. height: 100vh;
  16. background: linear-gradient(135deg, #1f1f1f, #2c2c2c);
  17. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  18. cursor: crosshair;
  19. overflow: hidden;
  20. position: relative;
  21. color: #fff;
  22. }
  23.  
  24. #score {
  25. position: fixed;
  26. top: 20px;
  27. left: 50%;
  28. transform: translateX(-50%);
  29. background: rgba(0, 0, 0, 0.4);
  30. padding: 10px 25px;
  31. border-radius: 20px;
  32. font-size: 24px;
  33. font-weight: bold;
  34. backdrop-filter: blur(4px);
  35. box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
  36. z-index: 1000;
  37. }
  38.  
  39. .target {
  40. width: 60px;
  41. height: 60px;
  42. background-color: red;
  43. border: 3px solid #fff;
  44. border-radius: 50%;
  45. position: absolute;
  46. transition: top 0.2s ease, left 0.2s ease;
  47. box-shadow: 0 0 15px red;
  48. }
  49. </style>
  50. </head>
  51.  
  52. <body>
  53.  
  54. <div id="score">Score: 0</div>
  55. <div class="target" id="target"></div>
  56.  
  57. <script>
  58. const target = document.getElementById('target');
  59. const scoreDisplay = document.getElementById('score');
  60. const audio = new Audio('https://dictionary.cambridge.org/media/english/uk_pron/u/ukn/uknic/ukniche015.mp3');
  61. let score = 0;
  62.  
  63. function updateScore(value) {
  64. score += value;
  65. if (score < 0) score = 0;
  66. scoreDisplay.textContent = 'Score: ' + score;
  67. }
  68.  
  69. function moveTarget() {
  70. const maxX = window.innerWidth - 60;
  71. const maxY = window.innerHeight - 60;
  72. const x = Math.random() * maxX;
  73. const y = Math.random() * maxY;
  74. target.style.left = x + 'px';
  75. target.style.top = y + 'px';
  76. }
  77.  
  78. // Hit target
  79. target.addEventListener('click', function (event) {
  80. event.stopPropagation();
  81. updateScore(500);
  82. moveTarget();
  83. });
  84.  
  85. // Missed click
  86. document.body.addEventListener('click', function () {
  87. audio.currentTime = 0;
  88. audio.play();
  89. updateScore(-100);
  90. });
  91.  
  92. // Initial placement
  93. moveTarget();
  94. </script>
  95.  
  96. </body>
  97.  
  98. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement