Spaces:
Running
Running
| <html lang="sr"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Recovery Ulog Kalkulator</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| background: #111827; | |
| color: #f9fafb; | |
| margin: 0; | |
| padding: 20px; | |
| } | |
| .box { | |
| max-width: 480px; | |
| margin: 40px auto; | |
| background: #1f2937; | |
| padding: 24px; | |
| border-radius: 14px; | |
| box-shadow: 0 8px 30px rgba(0,0,0,0.35); | |
| } | |
| h1 { | |
| font-size: 22px; | |
| margin-bottom: 8px; | |
| text-align: center; | |
| } | |
| .subtitle { | |
| text-align: center; | |
| color: #9ca3af; | |
| font-size: 14px; | |
| margin-bottom: 22px; | |
| line-height: 1.5; | |
| } | |
| label { | |
| display: block; | |
| margin-top: 14px; | |
| margin-bottom: 6px; | |
| font-weight: bold; | |
| } | |
| input { | |
| width: 100%; | |
| padding: 12px; | |
| border-radius: 8px; | |
| border: none; | |
| font-size: 18px; | |
| box-sizing: border-box; | |
| } | |
| button { | |
| width: 100%; | |
| margin-top: 20px; | |
| padding: 14px; | |
| border: none; | |
| border-radius: 8px; | |
| font-size: 18px; | |
| font-weight: bold; | |
| cursor: pointer; | |
| background: #22c55e; | |
| color: #052e16; | |
| } | |
| .result { | |
| margin-top: 20px; | |
| background: #0f172a; | |
| padding: 16px; | |
| border-radius: 10px; | |
| line-height: 1.8; | |
| font-size: 16px; | |
| } | |
| .row { | |
| display: flex; | |
| justify-content: space-between; | |
| gap: 12px; | |
| border-bottom: 1px solid #334155; | |
| padding: 7px 0; | |
| } | |
| .row:last-child { | |
| border-bottom: none; | |
| } | |
| .value { | |
| font-weight: bold; | |
| color: #86efac; | |
| text-align: right; | |
| } | |
| .error { | |
| color: #fca5a5; | |
| margin-top: 12px; | |
| font-weight: bold; | |
| } | |
| .small { | |
| font-size: 13px; | |
| color: #9ca3af; | |
| margin-top: 14px; | |
| line-height: 1.5; | |
| } | |
| .warning { | |
| margin-top: 14px; | |
| background: #451a03; | |
| color: #fed7aa; | |
| padding: 12px; | |
| border-radius: 8px; | |
| font-size: 14px; | |
| line-height: 1.5; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="box"> | |
| <h1>Recovery Ulog Kalkulator</h1> | |
| <div class="subtitle"> | |
| Radi za prvi, drugi, treći ili bilo koji pokušaj. | |
| Ako nemaš prethodni gubitak, ostavi to polje prazno. | |
| </div> | |
| <label for="odds">Kvota trenutne opklade</label> | |
| <input | |
| type="number" | |
| id="odds" | |
| step="0.01" | |
| placeholder="npr. 2.50" | |
| oninput="calculate()" | |
| /> | |
| <label for="profit">Željeni profit u €</label> | |
| <input | |
| type="number" | |
| id="profit" | |
| step="0.01" | |
| placeholder="npr. 15" | |
| oninput="calculate()" | |
| /> | |
| <label for="loss">Prethodni gubitak u € — ostavi prazno ako ga nemaš</label> | |
| <input | |
| type="number" | |
| id="loss" | |
| step="0.01" | |
| placeholder="npr. 10" | |
| oninput="calculate()" | |
| /> | |
| <button onclick="calculate()">Izračunaj</button> | |
| <div id="error" class="error"></div> | |
| <div id="result" class="result" style="display:none;"></div> | |
| <div class="small"> | |
| Formula: ulog = (prethodni gubitak + željeni profit) / (kvota - 1) | |
| </div> | |
| </div> | |
| <script> | |
| function formatMoney(value) { | |
| return value.toFixed(2) + " €"; | |
| } | |
| function calculate() { | |
| const oddsRaw = document.getElementById("odds").value.trim(); | |
| const profitRaw = document.getElementById("profit").value.trim(); | |
| const lossRaw = document.getElementById("loss").value.trim(); | |
| const errorDiv = document.getElementById("error"); | |
| const resultDiv = document.getElementById("result"); | |
| errorDiv.textContent = ""; | |
| resultDiv.style.display = "none"; | |
| resultDiv.innerHTML = ""; | |
| // Obavezna su samo dva polja: kvota i željeni profit | |
| if (oddsRaw === "" || profitRaw === "") { | |
| return; | |
| } | |
| const odds = parseFloat(oddsRaw); | |
| const desiredProfit = parseFloat(profitRaw); | |
| // Ako je prethodni gubitak prazan, računa se kao 0 | |
| const previousLoss = lossRaw === "" ? 0 : parseFloat(lossRaw); | |
| if (isNaN(odds) || odds <= 1) { | |
| errorDiv.textContent = "Kvota mora biti veća od 1.00."; | |
| return; | |
| } | |
| if (isNaN(desiredProfit) || desiredProfit <= 0) { | |
| errorDiv.textContent = "Željeni profit mora biti veći od 0."; | |
| return; | |
| } | |
| if (isNaN(previousLoss) || previousLoss < 0) { | |
| errorDiv.textContent = "Prethodni gubitak mora biti 0 ili veći. Ako ga nemaš, ostavi prazno."; | |
| return; | |
| } | |
| const stake = (previousLoss + desiredProfit) / (odds - 1); | |
| const totalReturn = stake * odds; | |
| const netProfit = totalReturn - stake - previousLoss; | |
| const newLossIfBetLoses = previousLoss + stake; | |
| resultDiv.innerHTML = ` | |
| <div class="row"> | |
| <span>Kvota:</span> | |
| <span class="value">${odds.toFixed(2)}</span> | |
| </div> | |
| <div class="row"> | |
| <span>Željeni profit:</span> | |
| <span class="value">${formatMoney(desiredProfit)}</span> | |
| </div> | |
| <div class="row"> | |
| <span>Prethodni gubitak:</span> | |
| <span class="value">${formatMoney(previousLoss)}</span> | |
| </div> | |
| <br> | |
| <div class="row"> | |
| <span>Trebaš uložiti:</span> | |
| <span class="value">${formatMoney(stake)}</span> | |
| </div> | |
| <div class="row"> | |
| <span>Ukupna isplata ako prođe:</span> | |
| <span class="value">${formatMoney(totalReturn)}</span> | |
| </div> | |
| <div class="row"> | |
| <span>Čisti profit nakon vraćenog gubitka:</span> | |
| <span class="value">${formatMoney(netProfit)}</span> | |
| </div> | |
| <div class="warning"> | |
| Ako ova opklada padne, novi ukupni gubitak za sljedeći pokušaj je: | |
| <strong>${formatMoney(newLossIfBetLoses)}</strong>. | |
| </div> | |
| `; | |
| resultDiv.style.display = "block"; | |
| } | |
| </script> | |
| </body> | |
| </html> |