-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile_pic.php
111 lines (83 loc) · 1.92 KB
/
profile_pic.php
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
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="row">
<div class="small-12 medium-2 large-2 columns">
<div class="circle">
<!-- User Profile Image -->
<img class="profile-pic" src="http://cdn.cutestpaw.com/wp-content/uploads/2012/07/l-Wittle-puppy-yawning.jpg">
<!-- Default Image -->
<!-- <i class="fa fa-user fa-5x"></i> -->
</div>
<div class="p-image">
<i class="fa fa-camera upload-button"></i>
<input class="file-upload" type="file" accept="image/*"/>
</div>
</div>
</div>
<style type="text/css">
body {
background-color: #efefef;
}
.profile-pic {
max-width: 200px;
max-height: 200px;
display: block;
}
.file-upload {
display: none;
}
.circle {
border-radius: 1000px !important;
overflow: hidden;
width: 128px;
height: 128px;
border: 8px solid rgba(255, 255, 255, 0.7);
position: absolute;
top: 72px;
}
img {
max-width: 100%;
height: auto;
}
.p-image {
position: absolute;
top: 167px;
right: 30px;
color: #666666;
transition: all .3s cubic-bezier(.175, .885, .32, 1.275);
}
.p-image:hover {
transition: all .3s cubic-bezier(.175, .885, .32, 1.275);
}
.upload-button {
font-size: 1.2em;
}
.upload-button:hover {
transition: all .3s cubic-bezier(.175, .885, .32, 1.275);
color: #999;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
var readURL = function(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('.profile-pic').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$(".file-upload").on('change', function(){
readURL(this);
});
$(".upload-button").on('click', function() {
$(".file-upload").click();
});
});
</script>
</body>
</html>