Merge pull request #151 from hellcp/patch-6

Make user images square and not dependant on aspect ratio
This commit is contained in:
daniel 2018-06-02 19:32:00 -06:00 committed by GitHub
commit fb3c45943f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 6 deletions

View file

@ -153,3 +153,23 @@ body, button, input, textarea {
.font-weight-ultralight {
font-weight: 200 !important;
}
.square {
position: relative;
width: 100%;
}
.square::after {
content: "";
display: block;
padding-bottom: 100%;
}
.square-content {
position: absolute;
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-size: cover;
background-position: 50%;
}

View file

@ -101,12 +101,14 @@
@foreach($timeline as $status)
<div class="col-12 col-md-4 mb-4">
<a class="card info-overlay" href="{{$status->url()}}">
<img class="card-img-top" src="{{$status->thumb()}}" width="300px" height="300px">
<div class="info-overlay-text">
<h5 class="text-white m-auto">
<span class="icon-heart">{{$item->likes()->count()}}</span>
<span class="icon-speech">{{$item->comments()->count()}}</span>
</h5>
<div class="square">
<div class="square-content" style="background-image: url('{{$status->thumb()}}')"></div>
<div class="info-overlay-text">
<h5 class="text-white m-auto">
<span class="icon-heart">{{$item->likes()->count()}}</span>
<span class="icon-speech">{{$item->comments()->count()}}</span>
</h5>
</div>
</div>
</a>
</div>