mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-26 05:36:38 +00:00
[frontend] Reduce width of profile img with screen width (#615)
The commit makes the profile image on the profile page reduce in width if the screen width is less then it's normal width while maintaining it's 1:1 aspect ration. Signed-off-by: Sashanoraa <sasha@noraa.gay>
This commit is contained in:
parent
8de9b7a34b
commit
323dbca4f7
|
@ -34,11 +34,31 @@ main {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile .basic .avatar img {
|
.profile .basic .avatar-container {
|
||||||
height: 25em;
|
position: relative;
|
||||||
width: 25em;
|
width: 100%;
|
||||||
|
max-width: 25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile .basic .avatar-container .avatar {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile .basic .avatar-container .avatar img {
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile .basic .avatar-container:before {
|
||||||
|
content: "";
|
||||||
|
float: left;
|
||||||
|
padding-top: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile .basic .displayname {
|
.profile .basic .displayname {
|
||||||
|
|
|
@ -34,14 +34,33 @@ main {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.avatar-container {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 25em;
|
||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
height: 25em;
|
|
||||||
width: 25em;
|
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-container:before {
|
||||||
|
content: "";
|
||||||
|
float: left;
|
||||||
|
padding-top: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.displayname {
|
.displayname {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
|
@ -5,8 +5,10 @@
|
||||||
<div class="basic">
|
<div class="basic">
|
||||||
<a href="{{.account.URL}}" class="displayname">{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}</a>
|
<a href="{{.account.URL}}" class="displayname">{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}</a>
|
||||||
<a href="{{.account.URL}}" class="username">@{{.account.Username}}</a>
|
<a href="{{.account.URL}}" class="username">@{{.account.Username}}</a>
|
||||||
|
<div class="avatar-container">
|
||||||
<a href="{{.account.Avatar}}" class="avatar"><img src="{{.account.Avatar}}"></a>
|
<a href="{{.account.Avatar}}" class="avatar"><img src="{{.account.Avatar}}"></a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="detailed">
|
<div class="detailed">
|
||||||
<h2>About @{{.account.Username}}</h2>
|
<h2>About @{{.account.Username}}</h2>
|
||||||
<div class="bio">
|
<div class="bio">
|
||||||
|
|
Loading…
Reference in a new issue