-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeraAlunos.html
97 lines (90 loc) · 2.72 KB
/
geraAlunos.html
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
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
</head>
<script>
var students = [
"Ademir Barbosa Junior",
"Alessandra Herminia Spioni Estevao",
"Andre Celestino Dos Santos",
"Breno Jose Franzini Silva",
"Bruna Duarte",
"Bruno Caio Dias",
"Caio Cesar Almeida Guimaraes",
"Cleverson Saraiva Pires",
"Denes Leal Dos Santos",
"Elaine Kubagawa Ramos",
"Francini Da Silva Glinglani",
"Geanderson Vieira Galdino",
"Giovanni Montezano",
"Henrique Alves De Oliveira Carvalho",
"Italo Di Palma Junior",
"Leonardo Zandomenico Vasconcellos",
"Marcella De Jesus Melero",
"Marcos Vinicius Mendes Caldeira",
"Oswaldo Massao Otake",
"Paloma Gouvea Leandro",
"Rafael Rodrigues De Assis",
"Renato Da Silva Teixeira",
"Rodrigo Puzzello Novo",
"Tamires Lopes Rivera",
"Tainara Trausi",
"Willy Leocadio Da Silva",
"Yasmin Cipelli De Barros",
];
var gone = [];
function generate() {
let student = pickOne();
if(student) {
students = students.filter((al) => {
return al != student;
});
document.getElementById('gerado').innerHTML = " - " + student;
gone.push(student);
updateGone();
}else{
alert("chegamos ao fim!");
}
}
function pickOne() {
if(students.length > 0) {
return students[parseInt(Math.random() * students.length)];
}
}
function updateGone() {
let result = '';
for(al of gone) {
result += '<li>' + al + '</li>';
}
document.getElementById('gerados').innerHTML = result;
}
</script>
<style>
* {
margin: 0;
padding: 0;
font-family: 'Roboto', sans-serif;
}
li {
font-weight: bold;
}
</style>
<body style="float: left">
<div style="width: 100VW; height: 30VH; float: left">
<h3>O sortudo da vez foi:</h3>
<h1 id="gerado"></h1>
</div>
<div style="width: 100VW; height: 700VH; float: left">
<div style="width: 50VW; height: 100VH; float: left">
<button onclick="generate()" style = "background-color: #FF3333; padding: 30px; color: #FFF; font-weight: bold; font-size: 4em;">
Gera alguém
</button>
</div>
<div style="width: 50VW; height: 100VH; float: left">
<h3>Já foram:</h3>
<ul id="gerados">
</ul>
</div>
</div>
</body>
</html>