-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
194 lines (188 loc) · 5.39 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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<html>
<head>
<title>CTRL+ALT+TEC Kiwi</title>
<meta name="viewport" content="width=device-width, initial-scale=0.75">
<script src="https://www.gstatic.com/firebasejs/5.4.2/firebase.js"></script>
<link href="https://fonts.googleapis.com/css?family=Share+Tech+Mono" rel="stylesheet">
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyCTC5VTiUENrzDSVstB5ex98BxCDP9tMB4",
authDomain: "kiwi-d38bd.firebaseapp.com",
databaseURL: "https://kiwi-d38bd.firebaseio.com",
projectId: "kiwi-d38bd",
storageBucket: "kiwi-d38bd.appspot.com",
messagingSenderId: "296898111291"
};
firebase.initializeApp(config);
function generateUID() {
// I generate the UID from two parts here
// to ensure the random number provide enough bits.
/*var firstPart = (Math.random() * 46656) | 0;
var secondPart = (Math.random() * 46656) | 0;
firstPart = ("000" + firstPart.toString(36)).slice(-3);
secondPart = ("000" + secondPart.toString(36)).slice(-3);
return firstPart + secondPart;*/
var i,
key = "",
characters = "ABCD1234567890",
charactersLength = characters.length;
for(i=0; i<6; i++){
key+=characters.substr(Math.floor((Math.random() * charactersLength) + 1), 1);
}
return key;
}
</script>
<style>
*{
margin: 0;
padding: 0;
}
#main{
overflow: auto;
padding-bottom: 100px;
padding-top: 24px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
align-content: center;
flex-grow: 1;
padding: 16px
}
body{
padding: 0;
margin: 0;
display: flex;
flex-direction: column
}
h1{
font-family: 'Arial';
font-weight: 800;
font-size: 24px;
}
h2{
font-family: 'Share Tech Mono', monospace;
text-transform: uppercase;
font-weight: 900;
font-size: 48px;
color: black;
}
.logo{
height: 56px;
}
footer .logo{
margin-left: auto;
margin-right: auto;
height: 70px;
}
.header{
display: flex;
flex-direction: row;
align-items: center;
align-content: center;
position: sticky;
margin: 0;
background-color: #64bc00;
width: 100%;
padding: 16px;
font-family: 'Arial';
font-size: 16;
top: 0;
box-sizing: border-box;
justify-content: space-between;
}
.header *{
display: flex;
text-align: center;
align-items: center;
justify-content: space-between
}
/*.header * :hover{
background-color: rgba(160,160,160,0.5)
}*/
.sign-out{
padding: 24px
}
footer{
width: 100%;
display: flex;
justify-content: center;
padding: 16px;
bottom: 0;
box-sizing: border-box
}
footer *{
display: flex;
text-align: center;
align-items:center;
justify-content: space-between
}
.input-button-wrapper{
overflow: hidden;
position: relative
}
.input-button{
width: auto;
background-color: #84BB22;
border-radius: 16px;
padding: 16px;
font-size: 16px;
color: white;
font-weight: 600;
font-family: arial;
border: none;
margin: 16px;
min-width: 150px
}
#file-upload{
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
opacity: 0;
}
.confirmation-label{
max-width: 150px;
font-family: 'Share Tech Mono', monospace;
font-size: 16px;
margin: 16px;
}
</style>
</head>
<body>
<div class='header'>
<div style="flex-wrap: nowrap">
<a href="http://ctrl-alt-tec.github.io/Website" style="margin-right: 8px"><img src='https://ctrl-alt-tec.github.io/Website/img/LOGO-INLINE.png' height="48px"/></a>
<img class="logo" src="logo-name.png">
</div>
</div>
<div id= 'main' >
<div class='input-button-wrapper'>
<input type='file' id='file-upload'/>
<div class="input-button">SELECCIONAR ARCHIVO</div>
</div>
</div>
<footer>
<img src="HechoConAmor.png" height="80px">
</footer>
<script>
document.getElementById("file-upload").addEventListener("change", function(e){
var file = e.target.files[0];
var fileUID = generateUID();
firebase.storage().ref(fileUID).put(file);
firebase.database().ref("files/"+fileUID).set({
NAME: fileUID,
DATE: new Date(),
PERMANENT: false
})
document.querySelector('#main').innerHTML =
"<div class='confirmation-label'>ARCHIVO SUBIDO CON ÉXITO</div>"+
"<image id='qrcode' src='https://api.qrserver.com/v1/create-qr-code/?size=150x150&data="+fileUID+"'>"+
"<h2>"+fileUID+"</h2>"+
"<input type='button' value='OK!' class='input-button' onClick='window.location.reload(true)'/>"
})
</script>
</body>
</html>