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