-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
61 lines (56 loc) · 2.42 KB
/
index.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
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="style.css" rel="stylesheet" type="text/css" />
<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=Inter:wght@100..900&display=swap" rel="stylesheet" />
<link rel="icon" type="image/png" href="img/favicon.webp">
<script src="https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.3.0/exceljs.min.js"></script>
<title>EnGrup.ar</title>
</head>
<body>
<div class="container">
<div class="header">
<img src="img/arg.webp" alt="Argentina Flag" />
<h1>EnGrup.ar🧉</h1>
</div>
<form>
<div class="input-field">
<textarea class="custom-input" id="personas" placeholder="Ingresa los nombres, uno por línea"></textarea>
<span class="error" id="personas-error"></span>
</div>
<div class="input-field">
<input type="number" class="custom-input" id="numero" name="numero" min="1" max="8" placeholder="Número de grupos">
<span class="error" id="numero-error"></span>
</div>
<div class="input-field">
<input type="file" class="custom-input" id="fileInput" accept=".txt" />
</div>
<div class="linitas"></div>
</br>
<div class="radio-group">
<label><input class="soyRadio" type="radio" name="order" value="random" checked/> Orden aleatorio</label>
<label><input class="soyRadio" type="radio" name="order" value="sequential" /> Orden de ingreso</label>
</div>
<button class="submit-button" type="button" onclick="processForm()" style="width: 40%;">Engrup.ar</button>
</form>
</div>
<script>
document.getElementById('fileInput').addEventListener('change', function (e) {
const file = e.target.files[0];
const reader = new FileReader();
reader.onload = function (e) {
const existingNames = document.getElementById('personas').value.split('\n').map(p => p.trim()).filter(p => p);
const newNames = e.target.result.split('\n').map(p => p.trim()).filter(p => p);
const allNames = [...existingNames, ...newNames].join('\n');
document.getElementById('personas').value = allNames;
};
reader.readAsText(file);
});
</script>
<script src="script.js"></script>
</body>
</html>