Guest User

Untitled

a guest
Dec 27th, 2023
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>nome</title>
  5. <style type="text/css">
  6. .button {
  7. border: none;
  8. color: white;
  9. padding: 10px 25px;
  10. text-align: center;
  11. text-decoration: none;
  12. display: inline-block;
  13. font-size: 16px;
  14. transition-duration: 0.4s;
  15. cursor: pointer;
  16. }
  17. .button2 {
  18. background-color: white;
  19. color: black;
  20. border: 2px solid #008CBA;
  21. }
  22. .button2:hover {
  23. background-color: #008CBA;
  24. color: white;
  25. }
  26. .partita{
  27. position:absolute;
  28. width:500px;
  29. height:80px;
  30. top:20%;
  31. left:50%;
  32. margin-left:-250px;
  33. line-height:80px;
  34. }
  35. .casa{
  36. position:absolute;
  37. height:100%;
  38. width:auto;
  39. left:0%;
  40. }
  41. .ospite{
  42. position:absolute;
  43. height:100%;
  44. width:auto;
  45. right:0%;
  46. }
  47. .risultato{
  48. position:absolute;
  49. width:70%;
  50. height:100%;
  51. left:50%;
  52. margin-left:-35%;
  53. text-align:center;
  54. font-size:30pt;
  55. margin-top:0%;
  56. }
  57. .tim{
  58. position:absolute;
  59. top:-50%;
  60. height:auto;
  61. width:30px;
  62. margin-left:-15px;
  63. left:50%;
  64. }
  65. .quote{
  66. position:absolute;
  67. width:500px;
  68. height:80px;
  69. top:100%;
  70. left:50%;
  71. margin-left:-250px;
  72. line-height:80px;
  73. margin-top:-80px;
  74. }
  75. .qt{
  76. position:absolute;
  77. width:80%;
  78. height:40px;
  79. left:50%;
  80. margin-left:-40%;
  81. }
  82. .q1{
  83. position:absolute;
  84. left:25%;
  85. margin-left:-42.175px;
  86. }
  87. .qx{
  88. position:absolute;
  89. margin-left:-42.175px;
  90. left:50%;
  91. }
  92. .q2{
  93. position:absolute;
  94. left:75%;
  95. margin-left:-42.175px;
  96. }
  97. .b1{
  98. position:absolute;
  99. top:100%;
  100. margin-top:-21.2px;
  101. margin-left:-48.345px;
  102. left:50%;
  103. }
  104. .rel{
  105. position: relative;
  106. width: 100%;
  107. height:300px;
  108. margin: 0 auto;
  109. }
  110. .marcatori{
  111. position:absolute;
  112. width:340px;
  113. height:80px;
  114. top:40%;
  115. left:50%;
  116. margin-left:-170px;
  117. line-height:80px;
  118. }
  119. .timer{
  120. position:absolute;
  121. top:0%;
  122. width:30px;
  123. height:30px;
  124. left:50%;
  125. margin-left:-15px;
  126. margin-top:0;
  127. line-height:30px;
  128. text-align:center;
  129. }
  130. </style>
  131. </head>
  132. <body onload="main()">
  133. <script> var gol1
  134. var gol2
  135. casuale = Math.round(Math.random() * 99);
  136. casuale2 = Math.round(Math.random() * 99);
  137. if(casuale<10){
  138. gol1= 0;
  139. }
  140. else{
  141. if(casuale<25 && casuale>9){
  142. gol1= 1;
  143. }
  144. else{
  145. if(casuale<55 && casuale>24){
  146. gol1 = 2;
  147. }
  148. else{
  149. if(casuale<80 && casuale>54){
  150. gol1= 3;
  151. }
  152. else{
  153. if(casuale<95 && casuale>79){
  154. gol1= 4;
  155. }
  156. else{
  157. gol1 = 5;
  158. }
  159. }
  160. }
  161. }
  162. }
  163. casuale2 = Math.round(Math.random() * 99);
  164. if(casuale2<10){
  165. gol2= 0;
  166. }
  167. else{
  168. if(casuale2<25 && casuale2>9){
  169. gol2= 1;
  170. }
  171. else{
  172. if(casuale2<55 && casuale2>24){
  173. gol2=2;
  174. }
  175. else{
  176. if(casuale2<80 && casuale2>54){
  177. gol2 = 3;
  178. }
  179. else{
  180. if(casuale2<95 && casuale2>79){
  181. gol2= 4;
  182. }
  183. else{
  184. gol2= 5;
  185. }
  186. }
  187. }
  188. }
  189. }
  190. function cas() {
  191. str1=gol1.toString();
  192. str2=gol2.toString();
  193. str="-";
  194. result=str1.concat(str).concat(str2);
  195. document.getElementById("result").innerHTML =result
  196. }
  197. let s = gol1 + gol2;
  198. for (let i = 0; i < s; i++) {
  199. let n = Math.floor(Math.random() * ((i+1)*(90/s) - i*(90/s +1) + i*(90/s)*1));
  200. document.getElementById("marcatori").innerHTML =n
  201. }
  202. var startTime; // to keep track of the start time
  203. var stopwatchInterval; // to keep track of the interval
  204. var elapsedPausedTime = 0; // to keep track of the elapsed time while stopped
  205. function startStopwatch() {
  206. if (!stopwatchInterval) {
  207. startTime = new Date().getTime() - elapsedPausedTime; // get the starting time by subtracting the elapsed paused time from the current time
  208. stopwatchInterval = setInterval(updateStopwatch, 250); // update every second
  209. }
  210. }
  211.  
  212. function updateStopwatch() {
  213. var currentTime = new Date().getTime(); // get current time in milliseconds
  214. var elapsedTime = currentTime - startTime; // calculate elapsed time in milliseconds
  215. var seconds = Math.floor(elapsedTime / 250) % 100; // calculate seconds
  216. var displayTime = seconds; // format display time
  217. document.getElementById("stopwatch").innerHTML = displayTime; // update the display
  218. if(seconds==90){
  219. stopStopwatch()
  220. }
  221. if(seconds==casuale){
  222. document.getElementById("marcatori").innerHTML ="lautaro " + "&nbsp" + seconds + "'"
  223. }
  224. }
  225.  
  226. function stopStopwatch() {
  227. clearInterval(stopwatchInterval); // stop the interval
  228. elapsedPausedTime = new Date().getTime() - startTime; // calculate elapsed paused time
  229. stopwatchInterval = null; // reset the interval variable
  230. }
  231. function main() {
  232. var a, b, d, x, y, z, t;
  233. a=1
  234. b=2
  235. if (a < b) {
  236. t = a;
  237. a = b;
  238. b = t;
  239. i = 1;
  240. }
  241.  
  242. d = a - b;
  243. x = Math.sqrt((6.25 * (4 + d)) / 4);
  244. y = 6.25 / x;
  245. z = (x + y) * 3 / 5;
  246.  
  247. if (i === 1) {
  248. t = x;
  249. x = y;
  250. y = t;
  251. }
  252. x=x.toFixed(2);
  253. y=y.toFixed(2);
  254. z=z.toFixed(2);
  255. document.getElementById("home").innerHTML =x
  256. document.getElementById("draw").innerHTML =z
  257. document.getElementById("away").innerHTML =y
  258. }
  259. </script>
  260. <div class="rel">
  261. <div class="partita">
  262. <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/FC_Internazionale_Milano_2021.svg/512px-FC_Internazionale_Milano_2021.svg.png" class="casa" >
  263. <p id="result" class="risultato"> </p>
  264. <img src="https://www.calcioefinanza.it/wp-content/uploads/2022/06/SerieA_TIM_RGB.jpg" class="tim">
  265. <img src="https://kassiesa.net/uefa/clubs/images/Juventus.png" class="ospite">
  266. </div>
  267. <div class="marcatori" >
  268. <p id="stopwatch" class="timer"></p>
  269. <p id="marcatori"> </p>
  270. </div>
  271. <div class="quote">
  272. <div class="qt">
  273. <button class="button button2 q1" id="home"></button>
  274. <button class="button button2 qx" id="draw"></button>
  275. <button class="button button2 q2"id="away"></button>
  276. </div>
  277. <input type="button" onclick="cas(),startStopwatch()" value="Simula partita" class="b1">
  278. </div>
  279. </div>
  280. </body>
  281. </html>
Advertisement
Add Comment
Please, Sign In to add comment