-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
115 lines (104 loc) · 3.2 KB
/
Copy pathindex.html
File metadata and controls
115 lines (104 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
<title>FLOR AMARILLA :)</title>
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: sans-serif;
}
body {
display: flex;
width: 100%;
height: 100vh;
justify-content: center;
align-items: center;
background-color: #fce4ec;
}
.container {
width: 300px;
text-align: center;
padding: 20px;
background-color: #fff;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}
.container h2 {
font-size: 1.7rem;
}
.input-display {
text-align: center;
margin: 0;
font-size: 30px;
margin: 10px 0;
}
.keypad {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.keypad button {
padding: 15px;
font-size: 25px;
background-color: #f8bbd0;
border: 1px black solid;
outline: none;
cursor: pointer;
transition: background 0.2s;
}
.key:hover {
background-color: #f48fb1;
}
.keypad button:last-child {
grid-column: 2/3;
}
</style>
</head>
<body>
<div class="container">
<h2>
🔒<br />
Ingrese la contraseña
</h2>
<div class="input-display" id="inputDisplay">••••</div>
<div class="keypad">
<button class="key" onclick="enterDigit('1')">1</button>
<button class="key" onclick="enterDigit('2')">2</button>
<button class="key" onclick="enterDigit('3')">3</button>
<button class="key" onclick="enterDigit('4')">4</button>
<button class="key" onclick="enterDigit('5')">5</button>
<button class="key" onclick="enterDigit('6')">6</button>
<button class="key" onclick="enterDigit('7')">7</button>
<button class="key" onclick="enterDigit('9')">9</button>
<button class="key" onclick="enterDigit('8')">8</button>
<button class="key" onclick="enterDigit('0')">0</button>
</div>
</div>
<script>
const correctPassword = "0101";
const display = document.getElementById("inputDisplay");
let input = "";
function enterDigit(digit) {
if (input.length < 4) {
input += digit;
}
display.textContent = input.padEnd(4, "•");
if (input.length === 4) {
if (input === correctPassword) {
window.location.href = "flower.html";
} else {
alert("Contraseña incorecta, intenta de nuevo");
input = "";
display.textContent = "••••";
}
}
}
</script>
</body>
</html>