-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
113 lines (84 loc) · 3.05 KB
/
index.html
File metadata and controls
113 lines (84 loc) · 3.05 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CBDEV • 📄 to 🖼️ Converter</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Nunito&display=swap');
* {
font-family: 'Nunito', sans-serif;
text-align: center;
}
a {
text-decoration: none;
color: gray;
}
/* clear default button style */
button{
all: unset;
cursor: pointer;
}
.vaorra-color {
color: #3ce5a4;
}
/* clear default input style */
input[type="file"] {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
}
input + label {
font-size: 1.2rem;
font-weight: bold;
padding: 15px;
color: black;
background-color: #3ce5a4;
display: inline-block;
cursor: pointer;
}
#UploadButton{
margin: 15px;
font-size: 1.2rem;
font-weight: bold;
padding: 15px;
color: black;
background-color: cornflowerblue;
display: inline-block;
cursor: pointer;
}
</style>
</head>
<body>
<h1>📄 to 🖼️ Converter</h1>
<a href="https://github.com/cbdev-ch" target="_blank"><h3>made by CBDEV.ch</h3></a>
<form id="UploadForm">
<input type="file" id="UploadInput">
<label for="UploadInput">Choose a file</label>
<span id="FileName"></span>
<button type="button" onclick="removeInput()">❌</button><br>
<button type="submit" id="UploadButton">upload</button>
</form>
<script>
function removeInput() {
document.getElementById('FileName').innerHTML = '';
document.getElementById('UploadInput').value = '';
document.getElementById('UploadButton').style.display = 'none';
}
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('UploadButton').style.display = 'none';
document.getElementById('UploadForm').addEventListener('submit', event => {
event.preventDefault();
});
document.getElementById('UploadInput').addEventListener('change', event => {
if(event.target.files.length > 0){
document.getElementById('FileName').innerHTML = event.target.files[0].name;
document.getElementById('UploadButton').style.display = 'inline';
}
});
});
</script>
</body>
</html>