-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
91 lines (78 loc) · 2.39 KB
/
index2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="js/jquery.min.js"></script>
<title>Preview images</title>
</head>
<body>
<style>
body{
background-color: #001935;
}
h3{
color: hsla(0, 0%, 100%, 0.6);
text-align: center;
}
.main{
text-align: center;
}
img{
max-width: 120px;
border-radius:6px;
}
.filePrev{
background: rgba(0,0,0,.3);
border: 1px solid rgba(0,0,0,.5);
text-align: center;
border-radius: 3px;
margin: 0 auto 15px;
margin-top: 20px;
padding: 10px;
width: 30%;
}
.footer {
position: fixed;
bottom: 0px;
width: 100%;
overflow: visible;
z-index: 99;
clear: both;
background-color: rgba(0, 0, 0, 0.6);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#99000000',endColorstr='#99000000');
}
span{
color: #fff;
font-size: 12px;
line-height: 30px;
float:right;
margin-right:40px;
}
</style>
<br><br><br>
<h3>Preview images</h3>
<div class="main">
<input type="file" name="" id="fileload">
</div>
<div class="filePrev">
<img src="#" id="blah" alt="">
</div>
<div class="footer"> <a href="https://boukernineabdellatif.netlify.com" target="_blank" rel="noopener noreferrer"><span>by Boukernine abdellatif</span></a> </div>
<script>
function readUrl(input){
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e){
$('#blah').attr('src',e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#fileload").change(function(){
readUrl(this);
});
</script>
</body>
</html>