/
img10.html
87 lines (87 loc) · 4.27 KB
/
img10.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>img10 - Temporary Image Hosting</title>
<link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.indigo-pink.min.css" type="text/css" media="screen" title="no title" charset="utf-8"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" media="screen" title="no title" charset="utf-8"/>
<link rel="shortcut icon" href="/favicon.ico"/>
<script defer src="https://code.getmdl.io/1.1.3/material.min.js"></script>
<style type="text/css" media="screen">
body {
text-align: center;
}
@media screen and (min-width: 35.5em) {
div.main {
padding-top: 120px;
}
}
.img-ten-upload-card.mdl-card {
margin: 0 auto;
width: 100%;
max-width: 512px;
text-align: left;
}
.img-ten-upload-card > .mdl-card__title {
color: #fff;
height: 176px;
background: url('/img10.png') bottom right 5% no-repeat #3E4EB8;
}
.img-ten-upload-card > .mdl-card__menu {
color: #fff;
}
</style>
</head>
<body>
<div class="main">
<form action="/upload" enctype="multipart/form-data" method="post" id="uploadform">
<div class="img-ten-upload-card mdl-card mdl-shadow--2dp">
<div class="mdl-card__title">
<h1 class="mdl-card__title-text">Temporary Image Hosting</h1>
</div>
<div class="mdl-card__supporting-text">
{% if error %}
<p><strong>{{ error }}</strong></p>
{% endif %}
{% if not img_id %}
Your image will be hosted for a day and will be removed.
{% endif %}
{% if img_id %}
<a href="{{img_url}}"><img src="/t/{{ img_id }}.jpg" alt=""/></a>
{% endif %}
</div>
<div class="mdl-card__actions mdl-card--border">
{% if img_url %}
<p><a href="{{img_url}}">{{ img_url }}</a></p>
{% endif %}
<input type="file" name="img" id="inputfile" accept=".jpg,.png" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">
<script type="text/javascript" charset="utf-8">
// hide file input with javascript
// input will be visible if javascript is disabled
document.getElementById("inputfile").style.display = "none";
</script>
<input type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary" id="upload-button" value="Upload">
<div id="upload-progress" class="mdl-progress mdl-js-progress mdl-progress__indeterminate" style="display: none;"></div>
</div>
<div class="mdl-card__menu">
<a href="https://github.com/onur/img10" class="mdl-button mdl-button--icon mdl-js-button mdl-js-ripple-effect">
<i class="fa fa-github" aria-hidden="true"></i>
</a>
</div>
</div>
</form>
</div>
</body>
<script type="text/javascript" charset="utf-8">
document.getElementById("upload-button").onclick = function() {
document.getElementById("inputfile").click();
return false;
};
document.getElementById("inputfile").onchange = function() {
document.getElementById("upload-button").style.display = "none";
document.getElementById("upload-progress").style.display = "block";
document.getElementById("uploadform").submit();
};
</script>
</html>