-
Notifications
You must be signed in to change notification settings - Fork 1
/
name_signs.html
55 lines (45 loc) · 1.45 KB
/
name_signs.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
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<link href="https://fonts.googleapis.com/css2?family=Varela+Round&display=swap" rel="stylesheet">
<style>
* {
font-family: 'Varela Round', sans-serif;
}
button {
cursor: pointer;
background-image: linear-gradient(to right, #00d2ff, #3a7bd5);
border-radius: 10px;
box-shadow: 0 10px 10px -5px #888;
padding: 10px 15px;
margin-top: 15px;
color: white;
border: none;
}
</style>
</head>
<body>
<h1>Load your CSV Below</h1>
<input type='file' accept=".csv, text/csv">
<button>Generate Signs</button>
<p></p>
<script>
document.getElementsByTagName('button')[0].addEventListener('click', _ => {
document.getElementsByTagName('p')[0].innerText = 'Loading...';
const csv = document.querySelector('input[type=file]').files[0];
const reader = new FileReader();
reader.addEventListener('load', e => {
google.script.run.withSuccessHandler(onSuccess).withFailureHandler(onFailure).generateNameSigns(e.target.result);
});
reader.readAsText(csv);
});
function onSuccess() {
document.getElementsByTagName('p')[0].innerText = 'Completed';
}
function onFailure() {
document.getElementsByTagName('p')[0].innerText = 'Failed :(';
}
</script>
</body>
</html>