mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 16:53:17 +00:00
Merge pull request #151 from hellcp/patch-6
Make user images square and not dependant on aspect ratio
This commit is contained in:
commit
fb3c45943f
2 changed files with 28 additions and 6 deletions
20
resources/assets/sass/custom.scss
vendored
20
resources/assets/sass/custom.scss
vendored
|
@ -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%;
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue