mirror of
https://github.com/djdevin/recflare.git
synced 2026-10-27 07:58:55 -07:00
[www] add photos to account page, WIP player profile page/search (#104)
* Add player search and public profiles * just hide player search for now --------- Co-authored-by: Devin Zuczek <devin.zuczek@gmail.com>
This commit is contained in:
@@ -1584,3 +1584,271 @@ button[type='submit']:disabled {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- Player search ------------------------------------------------------ */
|
||||
|
||||
.player-search {
|
||||
position: relative;
|
||||
width: min(280px, 100%);
|
||||
}
|
||||
|
||||
.player-search input {
|
||||
margin: 0;
|
||||
height: 40px;
|
||||
padding: 8px 12px;
|
||||
border-radius: 999px;
|
||||
background: var(--surface);
|
||||
border-color: var(--line);
|
||||
transition:
|
||||
border-color 0.15s ease,
|
||||
background 0.15s ease,
|
||||
box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.player-search input:focus {
|
||||
border-color: var(--accent);
|
||||
background: var(--surface-hi);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.player-search-bubble {
|
||||
position: absolute;
|
||||
z-index: 20;
|
||||
top: calc(100% + 8px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 6px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 12px 30px rgb(0 0 0 / 28%);
|
||||
}
|
||||
|
||||
.player-search-result {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
gap: 10px;
|
||||
padding: 8px;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
font-family: var(--body);
|
||||
}
|
||||
|
||||
.player-search-result:hover,
|
||||
.player-search-result:focus-visible {
|
||||
background: var(--surface-hi);
|
||||
}
|
||||
|
||||
.player-search-avatar {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
flex: none;
|
||||
object-fit: cover;
|
||||
border-radius: 50%;
|
||||
border: 1px solid var(--line);
|
||||
background: var(--surface-hi);
|
||||
}
|
||||
|
||||
.player-search-name {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.player-search-handle {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
color: var(--muted);
|
||||
font-size: 0.78rem;
|
||||
line-height: 1.2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
/* The search bar is a third thing in a row built for two, so the nav wraps when it runs
|
||||
out of room rather than overflowing. No breakpoint: wrapping only happens when the row
|
||||
doesn't fit, so wide screens are untouched. */
|
||||
.nav {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* ---- Public player profiles -------------------------------------------- */
|
||||
|
||||
.player-hero {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin-bottom: 16px;
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.player-banner {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 220px;
|
||||
object-fit: cover;
|
||||
border-bottom: 1px solid var(--line);
|
||||
background:
|
||||
radial-gradient(
|
||||
circle at 80% 20%,
|
||||
color-mix(in srgb, var(--accent) 24%, transparent),
|
||||
transparent 45%
|
||||
),
|
||||
linear-gradient(
|
||||
135deg,
|
||||
var(--surface-hi),
|
||||
var(--surface)
|
||||
);
|
||||
}
|
||||
|
||||
.player-hero-body {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 18px;
|
||||
padding: 0 24px 24px;
|
||||
min-height: 112px;
|
||||
}
|
||||
|
||||
.player-hero:not(:has(.player-banner)) .player-hero-body {
|
||||
align-items: center;
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.player-avatar {
|
||||
width: 112px;
|
||||
height: 112px;
|
||||
flex: none;
|
||||
object-fit: cover;
|
||||
margin-top: -56px;
|
||||
border: 4px solid var(--surface);
|
||||
border-radius: 50%;
|
||||
background: var(--surface-hi);
|
||||
box-shadow: 0 5px 20px rgb(0 0 0 / 30%);
|
||||
}
|
||||
|
||||
/* The negative margin hangs the avatar over the banner's bottom edge. With no banner
|
||||
there is nothing to hang over, and the card's `overflow: hidden` clips the top off. */
|
||||
.player-hero:not(:has(.player-banner)) .player-avatar {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.player-hero-body h1 {
|
||||
margin: 0;
|
||||
font-size: clamp(1.5rem, 4vw, 2.1rem);
|
||||
line-height: 1.05;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.player-hero-body .handle {
|
||||
margin: 6px 0 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.player-hero + .card {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.photo-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
/* The thumbnail's click target: a real button, for the keyboard, with none of its looks. */
|
||||
.photo-button {
|
||||
display: block;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 9px;
|
||||
background: none;
|
||||
cursor: zoom-in;
|
||||
}
|
||||
|
||||
.photo-thumb {
|
||||
display: block;
|
||||
width: 100%;
|
||||
aspect-ratio: 1 / 1;
|
||||
object-fit: cover;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 9px;
|
||||
background: var(--surface-hi);
|
||||
transition:
|
||||
transform 0.15s ease,
|
||||
border-color 0.15s ease,
|
||||
box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.photo-thumb:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
|
||||
box-shadow: 0 6px 18px rgb(0 0 0 / 22%);
|
||||
}
|
||||
|
||||
/* The full-size popup. The dialog itself is invisible — just the photo, fitted to the
|
||||
viewport, over the dimmed page. */
|
||||
.photo-modal {
|
||||
max-width: 94vw;
|
||||
max-height: 94vh;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: none;
|
||||
overflow: visible;
|
||||
cursor: zoom-out;
|
||||
}
|
||||
|
||||
.photo-modal::backdrop {
|
||||
background: rgb(0 0 0 / 80%);
|
||||
}
|
||||
|
||||
.photo-modal img {
|
||||
display: block;
|
||||
max-width: 94vw;
|
||||
max-height: 94vh;
|
||||
border-radius: 9px;
|
||||
box-shadow: 0 10px 40px rgb(0 0 0 / 50%);
|
||||
}
|
||||
|
||||
@media (max-width: 620px) {
|
||||
.player-banner {
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.player-hero-body {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 0 18px 20px;
|
||||
}
|
||||
|
||||
.player-hero:not(:has(.player-banner)) .player-hero-body {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.player-avatar {
|
||||
width: 92px;
|
||||
height: 92px;
|
||||
margin-top: -46px;
|
||||
border-width: 3px;
|
||||
}
|
||||
|
||||
.player-hero-body h1 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.photo-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user