Commit 2dace895 authored by Rodrigo Diez's avatar Rodrigo Diez

Añadido Bootstrap

parent e9a424c8
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html lang="es">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.1/mini-default.min.css">
<title>Simulacion Loteria</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<header class="sticky">
<!--
<a href="#" role="button">Home</a>
<a href="#" role="button">About</a>
<a href="#" role="button">Contact</a>
-->
</header>
<br />
<div class="container">
<div class="row">
<div class="col-sm">
<div class="input-group fluid">
<label for="numero">Numero</label>
<input type="text" value="12345" id="numero" placeholder="Numero">
<body class="bg-light">
<header>
<!-- Fixed navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<a class="navbar-brand" href="#">Loteria</a>
</nav>
<div class="container mt-5">
<div class="row">
<div class="col-md-4 order-md-2 mb-4">
<h4 class="d-flex justify-content-between align-items-center mb-3">
<span class="text-muted">Premios Totales</span>
<span class="badge badge-secondary badge-pill">3</span>
</h4>
<ul class="list-group mb-3">
<li class="list-group-item d-flex justify-content-between lh-condensed">
<div>
<h6 class="my-0">Primer Premio</h6>
<small class="text-muted">Numero exacto</small>
</div>
<span class="text-muted" id="primeros">0€</span>
</li>
<li class="list-group-item d-flex justify-content-between lh-condensed">
<div>
<h6 class="my-0">Segundo Premio</h6>
<small class="text-muted">Mismas cifras en orden diferente</small>
</div>
<span class="text-muted" id="segundos">0€</span>
</li>
<li class="list-group-item d-flex justify-content-between lh-condensed">
<div>
<h6 class="my-0">Tercer Premio</h6>
<small class="text-muted">Dos ultimas o primeras cifras</small>
</div>
<span class="text-muted" id="terceros"></span>
</li>
<li class="list-group-item d-flex justify-content-between lh-condensed">
<div>
<h6 class="my-0">Reintegro</h6>
<small class="text-muted">Empiece o final</small>
</div>
<span class="text-muted" id="reintegros">0€</span>
</li>
<li class="list-group-item d-flex justify-content-between bg-light">
<div class="text-success">
<h6 class="my-0">Total Premiado</h6>
<small>EXAMPLECODE</small>
</div>
<span class="text-success" id="total">0 €</span>
</li>
</ul>
</div>
<div class="col-md-8 order-md-1 text-center">
<h4 class="mb-3 text-center">Numero Sorteado</h4>
<div class="row">
<div class="offset-md-1 col-md-3 mb-3">
<input type="text" class="form-control text-center" id="sorteado0" placeholder="" value="" disabled>
</div>
<div class="col-md-3 mb-3 text-center">
<input type="text" class="form-control text-center" id="sorteado1" placeholder="" value="" disabled>
</div>
<div class="col-md-3 mb-3 text-center">
<input type="text" class="form-control text-center" id="sorteado2" placeholder="" value="" disabled>
</div>
<div class="input-group fluid">
<a type="button" class="primary" id="generar">Generar</a>
</div>
<h4 class="mb-3 text-center mt-5">Numero Jugado</h4>
<div class="row">
<div class="offset-md-1 col-md-3 mb-3">
<input type="text" class="form-control text-center" id="firstName" placeholder="" value="" required>
</div>
<div class="col-md-3 mb-3">
<input type="text" class="form-control text-center" id="lastName" placeholder="" value="" required>
</div>
<div class="col-md-3 mb-3">
<input type="text" class="form-control text-center" id="lastName" placeholder="" value="" required>
</div>
</div>
</div>
<div class="col-sm-12 col-md-8 col-lg-6" style="height: calc(100vh - 10.25rem); display: flex; align-items: center; flex: 0 1 auto;">
<form>
<fieldset>
<legend>Generar numero</legend>
<div class="input-group fluid">
<label for="numero">Numero</label>
<input type="text" value="12345" id="numero" placeholder="Numero">
</div>
<div class="input-group fluid">
<a type="button" class="primary" id="generar">Generar</a>
</div>
</fieldset>
</form>
</div>
<div class="col-sm">
</div>
</div>
</div>
</div>
<footer>
<p>Copyright &copy; DiezRoFer 2019</p>
</footer>
<script src="js/script.js"></script>
</body>
</header>
</body>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" crossorigin="anonymous"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/script.js"></script>
</html>
\ No newline at end of file
This diff is collapsed.
let primeros = 0;
let segundos = 0;
let terceros = 0;
let reintegros = 0;
/**
......@@ -51,16 +54,25 @@ function comprobarTriplex(numeroSorteado,numeroPropio){
if(stringSorteado == stringPropio){
premios += 150;
repartoPremios[0]++;
primeros+=150;
document.getElementById("primeros").textContent = `${primeros} €`;
}else if(comprobarMezcla(stringSorteado, numeroPropio)){
premios += 10;
repartoPremios[1]++;
segundos+=10;
document.getElementById("segundos").textContent = `${segundos} €`;
}else if((numeroSorteado[0] == numeroPropio[0] && numeroSorteado[1] == numeroPropio[1]) || (numeroSorteado[1] == numeroPropio[1] && numeroSorteado[2] == numeroPropio[2])){
premios += 2;
repartoPremios[2]++;
terceros+=2;
document.getElementById("terceros").textContent = `${terceros} €`;
}else if(numeroSorteado[0] == numeroPropio[0] || numeroSorteado[2] == numeroPropio[2]){
premios += 0.5;
repartoPremios[3]++;
reintegros+=0.5;
document.getElementById("reintegros").textContent = `${reintegros} €`;
}
document.getElementById("total").textContent = `${premios} €`;
}
function sorteo(cifras, veces){
......@@ -68,6 +80,7 @@ function sorteo(cifras, veces){
gastos += 0.5;
let numeroPropio = [4,6,8];
let numeroSorteado = numeroAleatorio(cifras);
mostrarSortado(numeroSorteado);
console.log(numeroSorteado);
comprobarTriplex(numeroSorteado, numeroPropio);
console.log(`Dinero Gastado ${gastos} Dinero Ganado ${premios} Reparto de premios ${repartoPremios}`);
......@@ -90,6 +103,16 @@ function iniciarTemporizador(tiempo, veces, cifras){
temp = setInterval(()=>{sorteo(cifras, veces)}, tiempo);
}
function mostrarSortado(numero){
document.getElementById("sorteado0").value = numero[0];
document.getElementById("sorteado1").value = numero[1];
document.getElementById("sorteado2").value = numero[2];
}
function mostrarPropio(numero){
document.getElementById("propio0").value = numero[0];
document.getElementById("propio1").value = numero[1];
document.getElementById("propio2").value = numero[2];
}
iniciarTemporizador(2, 1000, 3);
iniciarTemporizador(20, 1000, 3);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment