-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
106 lines (93 loc) · 2.78 KB
/
index.html
File metadata and controls
106 lines (93 loc) · 2.78 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
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSV Upload</title>
<style>
body {
font-family: 'Arial', sans-serif;
margin: 20px;
}
input[type="file"] {
display: none;
}
label {
display: inline-block;
background-color: #3498db;
color: #fff;
padding: 10px 15px;
cursor: pointer;
border-radius: 5px;
font-size: 14px;
}
label:hover {
background-color: #2980b9;
}
button {
display: inline-block;
background-color: #2ecc71;
color: #fff;
padding: 10px 15px;
cursor: pointer;
border: none;
border-radius: 5px;
margin-top: 10px;
font-size: 14px;
}
button:hover {
background-color: #27ae60;
}
#result-table {
margin-top: 20px;
}
table {
border-collapse: collapse;
width: 100%;
margin-top: 10px;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
background-color: #fff; /* Set cell color to white */
}
th {
background-color: #3498db;
color: #fff;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
.file-indicator {
display: none;
color: #27ae60;
margin-top: 10px;
}
</style>
</head>
<body>
<label for="csv-file" id="upload-csv-label">Upload CSV</label>
<input type="file" id="csv-file" accept=".csv" onchange="showFileIndicator()" />
<button onclick="processCSV()">Generate</button>
<div id="file-indicator" class="file-indicator">CSV file uploaded: <span id="file-name"></span></div>
<div id="result-table"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script>
<script src="app.js"></script>
<script>
function showFileIndicator() {
const fileInput = document.getElementById("csv-file");
const fileIndicator = document.getElementById("file-indicator");
const fileNameSpan = document.getElementById("file-name");
if (fileInput.files.length > 0) {
const fileName = fileInput.files[0].name;
fileNameSpan.textContent = fileName;
fileIndicator.style.display = "block";
} else {
fileIndicator.style.display = "none";
}
}
</script>
</body>
</html>