-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
230 lines (188 loc) · 6.26 KB
/
index.html
File metadata and controls
230 lines (188 loc) · 6.26 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sorteio Mega-Sena</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #000000;
margin: 0;
padding: 0;
}
h1 {
text-align: center;
color: #00c74c;
margin: 2em 0;
}
.container {
max-width: 90%;
margin: 0 auto;
padding: 2em;
background-color: #000;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
button {
font-size: 1.2em;
margin-top: 1em;
padding: 0.5em 1em;
background-color: #007bff;
color: #000000;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #0056b3;
}
#numeros-sorteio {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-top: 2em;
transition: transform 0.5s ease-in-out;
}
.numero {
font-size: 2.5em;
font-weight: bold;
border: 2px solid #007bff;
border-radius: 50%;
width: 10vw;
height: 10vw;
display: flex;
justify-content: center;
align-items: center;
margin: 1em;
background: linear-gradient(to right, #00ff00, #007bff);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s, transform 0.3s;
color: #000;
}
.numero:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.numero.pulsar {
animation: pulsar 0.5s ease-in-out;
}
@keyframes pulsar {
0% { transform: scale(1); }
50% { transform: scale(1.2); }
100% { transform: scale(1); }
}
#numeros-anteriores {
margin-top: 2em;
}
#numeros-anteriores h2 {
font-size: 1.2em;
margin-bottom: 0.5em;
color: #00ff00;
}
#numeros-anteriores ul {
list-style: none;
padding: 0;
margin: 0;
}
#numeros-anteriores li {
font-size: 1.2em;
margin-bottom: 0.5em;
color: #00ff00;
}
@media only screen and (max-width: 600px) {
.container {
padding: 1em;
}
.numero {
width: 18vw;
height: 18vw;
font-size: 2em;
}
.imagem-aleatoria {
width: 100%;
height: auto;
margin-bottom: 1em;
}
}
footer {
background-color: #000;
color: #fff;
text-align: center;
padding: 1em;
position: fixed;
bottom: 0;
width: 100%;
}
footer a { color: #fff; }
</style>
<script type="text/javascript">
// NÍVEIS DE PESO
const nivelA = [5, 10, 23, 33, 53, 4, 27, 42, 37, 30]; // peso 3
const nivelB = [54, 24, 28, 44, 17, 52, 32, 29, 36, 41]; // peso 2
// Criar pool ponderado
let pool = [];
nivelA.forEach(n => pool.push(n, n, n)); // peso 3
nivelB.forEach(n => pool.push(n, n)); // peso 2
for (let i = 1; i <= 60; i++) {
if (!nivelA.includes(i) && !nivelB.includes(i)) {
pool.push(i); // peso 1
}
}
function sortearNumeros() {
let resultado = [];
while (resultado.length < 6) {
let n = pool[Math.floor(Math.random() * pool.length)];
if (!resultado.includes(n)) resultado.push(n);
}
resultado.sort((a, b) => a - b);
// EXIBIR NÚMEROS
const numerosSorteio = document.getElementById("numeros-sorteio");
numerosSorteio.innerHTML = "";
resultado.forEach(num => {
const elemento = document.createElement("div");
elemento.classList.add("numero", "pulsar");
elemento.textContent = num;
numerosSorteio.appendChild(elemento);
});
// HISTÓRICO
const lista = document.querySelector("#numeros-anteriores ul");
const item = document.createElement("li");
item.textContent = resultado.join(", ");
lista.prepend(item);
}
function adicionarImagensAleatorias() {
const imagens = [
'https://i.postimg.cc/G26RfTVx/images-removebg-preview.png',
'https://i.postimg.cc/hPSZBtnL/10433124-removebg-preview.png',
'https://i.postimg.cc/g2hZt37N/f5488f7af15452c26a5cd481f3501dfe-removebg-preview.png'
];
const containerImagens = document.getElementById('imagens-aleatorias');
imagens.forEach(src => {
const img = document.createElement('img');
img.src = src;
img.className = 'imagem-aleatoria';
containerImagens.appendChild(img);
});
}
adicionarImagensAleatorias();
</script>
</head>
<body>
<div class="container">
<h1>Sorteio Mega-Sena</h1>
<button onclick="sortearNumeros()">Sortear</button>
<div id="numeros-sorteio"></div>
<div id="numeros-anteriores">
<h2>Números sorteados anteriormente:</h2>
<ul></ul>
</div>
<div id="imagens-aleatorias"></div>
</div>
<br><br><br><br><br><br>
<footer>
<a href="https://github.com/GleisonAmorim" target="_blank">
<img src="https://img.shields.io/badge/GitHub-GleisonAmorim-green">
</a>
</footer>
</body>
</html>