"Basic Profile for Blog Purpose"
Bootstrap 4.1.1 Snippet by Jamsshhayd

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
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<link rel="stylesheet" href="https://bootswatch.com/4/simplex/bootstrap.min.css"/>
<div class="container">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="card-title mb-4">
<div class="d-flex justify-content-start">
<div class="image-container">
<img src="http://placehold.it/150x150" id="imgProfile" style="width: 150px; height: 150px" class="img-thumbnail" />
<div class="middle">
<input type="button" class="btn btn-secondary" id="btnChangePicture" value="Change" />
<input type="file" style="display: none;" id="profilePicture" name="file" />
</div>
</div>
<div class="userData ml-3">
<h2 class="d-block" style="font-size: 1.5rem; font-weight: bold"><a href="javascript:void(0);">Some Name</a></h2>
<h6 class="d-block"><a href="javascript:void(0)">1,500</a> Video Uploads</h6>
<h6 class="d-block"><a href="javascript:void(0)">300</a> Blog Posts</h6>
</div>
<div class="ml-auto">
<input type="button" class="btn btn-primary d-none" id="btnDiscard" value="Discard Changes" />
</div>
</div>
</div>
<div class="row">
<div class="col-12">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
body{
padding-top: 68px;
padding-bottom: 50px;
}
.image-container {
position: relative;
}
.image {
opacity: 1;
display: block;
width: 100%;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
}
.middle {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
}
.image-container:hover .image {
opacity: 0.3;
}
.image-container:hover .middle {
opacity: 1;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
$(document).ready(function () {
$imgSrc = $('#imgProfile').attr('src');
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#imgProfile').attr('src', e.target.result);
};
reader.readAsDataURL(input.files[0]);
}
}
$('#btnChangePicture').on('click', function () {
// document.getElementById('profilePicture').click();
if (!$('#btnChangePicture').hasClass('changing')) {
$('#profilePicture').click();
}
else {
// change
}
});
$('#profilePicture').on('change', function () {
readURL(this);
$('#btnChangePicture').addClass('changing');
$('#btnChangePicture').attr('value', 'Confirm');
$('#btnDiscard').removeClass('d-none');
// $('#imgProfile').attr('src', '');
});
$('#btnDiscard').on('click', function () {
// if ($('#btnDiscard').hasClass('d-none')) {
$('#btnChangePicture').removeClass('changing');
$('#btnChangePicture').attr('value', 'Change');
$('#btnDiscard').addClass('d-none');
$('#imgProfile').attr('src', $imgSrc);
$('#profilePicture').val('');
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

When I press connected service, there is no information that should come. I don't know how to solve it.

cokunutkanim () - 1 year ago - Reply 0


When I press connected service, there is no information that should come. I don't know how to solve it.

cokunutkanim () - 1 year ago - Reply 0


When I press connected service, there is no information that should come. I don't know how to solve it.

cokunutkanim () - 1 year ago - Reply 0


When I press connected service, there is no information that should come. I don't know how to solve it.

cokunutkanim () - 1 year ago - Reply 0