gotosocial/web/source/css/profile.css

276 lines
5.3 KiB
CSS
Raw Permalink Normal View History

/*
GoToSocial
Copyright (C) GoToSocial Authors admin@gotosocial.org
SPDX-License-Identifier: AGPL-3.0-or-later
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
.page {
/*
Profile page can be a little wider than default
page, since we're using a side-by-side column view.
*/
grid-template-columns: 1fr minmax(auto, 60rem) 1fr;
grid-template-columns: 1fr min(92%, 65rem) 1fr;
}
.profile .column-split {
display: flex;
flex-wrap: wrap;
gap: 1rem;
}
.profile .profile-header {
background: $profile-bg;
border-radius: $br;
overflow: hidden;
margin-bottom: 1rem;
.moved-to {
padding: 1rem;
text-align: center;
}
.header-image-wrapper {
position: relative;
padding-top: 33.33%; /* aspect-ratio 1/3 */
img {
position: absolute;
top: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
}
/*
Basic info container has the user's avatar, display- and username, and role
It's partially overlapped over the header image, by a negative margin-top.
*/
$avatar-size: 8.5rem;
$name-size: 3rem;
$username-size: 2rem;
$overlap: calc($avatar-size - $name-size - $username-size);
.basic-info {
position: relative;
display: grid;
box-sizing: border-box;
grid-template-columns: $avatar-size auto 1fr;
grid-template-rows: $overlap $name-size auto;
grid-template-areas:
"avatar . ."
"avatar namerole namerole"
"avatar namerole namerole";
margin: 1rem;
margin-top: calc(-1 * $overlap);
gap: 0 1rem;
.avatar {
grid-area: avatar;
height: $avatar-size;
width: $avatar-size;
[frontend] Unified panels (#812) * settings panel restructuring * clean up old Gin handlers * colorscheme redesign, some other small css tweaks * basic router layout, error boundary * colorscheme redesign, some other small css tweaks * kebab-case consistency * superfluous padding on applist * remove unused consts * redux, whitespace changes.. * use .jsx extensions for components * login flow up till app registration * full redux oauth implementation, with basic error handling * split oauth api functions * oauth api revocation handling * basic profile change submission * move old dir * profile overview * fix keeping track of the wrong instance url (for different instance/api domains) * use redux state for profile form * delete old/index.js, old/basic.js, fully implemented * implement old/user/profile.js * implement password change * remove debug logging * support future api for removing files * customize profile css * remove unneeded wrapper components * restructure form fields * start on admin pages * admin panel settings * admin settings panel * remove old/admin files * add top-level redirect * refactor/cleanup forms * only do API checks on logged-in state * admin-status based routing * federation block routing * federation blocks * upgrade dependencies * react 18 changes * media cleanup * fix useEffect hooks * remove unused require * custom emoji base * emoji uploader * delete last old panel files * sidebar styling, remove unused page * refactor submit functions * fix sidebar boxshadow-border * fix old css variables * fix fake-toot avatar * fix non-square emoji * fix user settings redux keys * properly get admin account contact from instance response * Account.source default values * source.status_format key * mobile responsiveness * mobile element tweaks * proper redirect after removing block * add redirects for old setting panel urls * deletes * fix mobile overflow * clean up debug logging calls
2022-09-29 10:02:41 +00:00
border: 0.2rem solid $avatar-border;
border-radius: $br;
overflow: hidden; /* prevents image extending beyond rounded borders */
img {
height: 100%;
width: 100%;
object-fit: cover;
}
}
.namerole {
grid-area: namerole;
display: grid;
gap: 0 1rem;
box-sizing: border-box;
grid-template-columns: auto 1fr;
grid-template-rows: $name-size auto;
grid-template-areas:
"displayname displayname"
"username role";
.displayname {
grid-area: displayname;
line-height: $name-size;
font-size: 1.5rem;
font-weight: bold;
}
.username {
min-width: 0;
grid-area: username;
line-height: $username-size;
font-size: 1rem;
font-weight: bold;
color: $fg-accent;
user-select: all;
}
.role {
background: $bg;
color: $fg;
border: 0.13rem solid $bg;
grid-area: role;
align-self: center;
justify-self: start;
border-radius: $br;
padding: 0.3rem;
line-height: 1.1rem;
font-size: 0.9rem;
font-variant: small-caps;
font-weight: bold;
&.admin {
color: $role-admin;
border-color: $role-admin;
}
&.moderator {
color: $role-mod;
border-color: $role-mod;
}
}
}
}
}
@media screen and (max-width: 750px) {
.profile .profile-header {
.basic-info {
grid-template-columns: auto 1fr;
grid-template-rows: $avatar-size $name-size auto;
grid-template-areas:
"avatar avatar"
"namerole namerole"
"namerole namerole";
.namerole {
grid-template-columns: 1fr;
grid-template-rows: $name-size auto;
grid-template-areas:
"displayname displayname"
"username role";
.displayname {
font-size: 1.4rem;
}
}
}
}
}
.profile .statuses-wrapper {
flex: 65 25rem;
display: flex;
flex-direction: column;
gap: 0.4rem;
min-width: 0%;
}
.profile .statuses {
display: flex;
flex-direction: column;
gap: 0.4rem;
.rss-icon {
display: block;
margin: -0.25rem 0;
.fa {
font-size: 2rem;
object-fit: contain;
vertical-align: middle;
color: $orange2;
/*
Can't size a single-color background, so we use
a linear-gradient that's effectively white.
*/
background: linear-gradient(to right, $white1 100%, transparent 0) no-repeat center center;
background-size: 1.2rem 1.4rem;
}
}
.backnextlinks {
display: flex;
justify-content: space-between;
.next {
margin-left: auto;
}
}
}
.profile .about-user {
flex: 35 14rem;
border-radius: $br;
overflow: hidden;
.col-header {
margin-bottom: -0.25rem;
}
dt {
font-weight: bold;
}
.fields {
background: $profile-bg;
display: flex;
flex-direction: column;
padding: 0 0.5rem;
padding-top: 0.25rem;
.field {
padding: 0.25rem;
display: flex;
flex-direction: column;
border-bottom: 0.1rem solid $gray2;
> dt, > dd {
word-break: break-word;
}
&:first-child {
border-top: 0.1rem solid $gray2;
}
}
}
.bio {
background: $profile-bg;
padding: 1rem 0.75rem;
padding-bottom: 1.25rem;
}
.accountstats {
background: $bg-accent;
padding: 0.75rem;
display: grid;
grid-template-columns: auto 1fr;
gap: 0.25rem 1rem;
}
}