Add profile photo uploads and custom difficulty support
This commit is contained in:
@@ -177,6 +177,29 @@
|
||||
box-shadow: 0 12px 30px #0002;
|
||||
min-width: 0;
|
||||
}
|
||||
.account-avatar-control {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 18px;
|
||||
margin: 24px 0;
|
||||
}
|
||||
.account-avatar-preview {
|
||||
width: 84px;
|
||||
height: 84px;
|
||||
object-fit: cover;
|
||||
box-shadow: 3px 3px #03070b;
|
||||
}
|
||||
.account-avatar-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.account-avatar-input .field {
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
.account-avatar-input .field input {
|
||||
min-height: 40px;
|
||||
padding: 8px;
|
||||
}
|
||||
.settings-heading {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
@@ -18,7 +18,7 @@ export default async function DashboardPage() {
|
||||
? required(
|
||||
await admin()
|
||||
.from("game_sessions")
|
||||
.select("id,difficulty,created_at,current_round")
|
||||
.select("id,difficulty,difficulty_settings,created_at,current_round")
|
||||
.eq("owner_id", account.id)
|
||||
.gte("created_at", historyCutoff)
|
||||
.order("created_at", { ascending: false })
|
||||
@@ -52,7 +52,17 @@ export default async function DashboardPage() {
|
||||
<div className="draft-row" key={s.id}>
|
||||
<span>
|
||||
{formatDate(s.created_at)} ·{" "}
|
||||
{t(s.difficulty[0].toUpperCase() + s.difficulty.slice(1))}{" "}
|
||||
{s.difficulty_settings &&
|
||||
typeof s.difficulty_settings === "object" &&
|
||||
!Array.isArray(s.difficulty_settings) &&
|
||||
typeof s.difficulty_settings.name === "string"
|
||||
? ["easy", "normal", "hard"].includes(s.difficulty)
|
||||
? t(s.difficulty_settings.name)
|
||||
: s.difficulty_settings.name
|
||||
: t(
|
||||
s.difficulty[0].toUpperCase() +
|
||||
s.difficulty.slice(1),
|
||||
)}{" "}
|
||||
· {s.current_round}
|
||||
{t("/5 rounds")}
|
||||
</span>
|
||||
|
||||
@@ -801,7 +801,7 @@ nav a:hover,
|
||||
}
|
||||
.difficulty-options {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||
gap: 10px;
|
||||
margin: 25px 0;
|
||||
}
|
||||
@@ -829,6 +829,51 @@ nav a:hover,
|
||||
font-size: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.difficulty-library {
|
||||
margin: -12px 0 24px;
|
||||
}
|
||||
.difficulty-builder {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
max-width: 430px;
|
||||
margin-top: 12px;
|
||||
padding: 18px;
|
||||
border: 1px solid var(--line);
|
||||
background: #0d160f;
|
||||
}
|
||||
.difficulty-builder label {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
.difficulty-builder > input,
|
||||
.difficulty-builder-time input {
|
||||
min-height: 42px;
|
||||
padding: 9px 11px;
|
||||
border: 1px solid #34452e;
|
||||
background: var(--panel);
|
||||
color: var(--text);
|
||||
font: inherit;
|
||||
}
|
||||
.difficulty-builder-time {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 9px;
|
||||
}
|
||||
.difficulty-builder-time input {
|
||||
width: 120px;
|
||||
}
|
||||
.difficulty-builder-time span {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
.difficulty-builder .difficulty-builder-zoom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 9px;
|
||||
}
|
||||
.difficulty-builder-zoom input {
|
||||
accent-color: var(--green);
|
||||
}
|
||||
.prose {
|
||||
max-width: 850px;
|
||||
}
|
||||
|
||||
@@ -238,6 +238,8 @@ input:focus-visible {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
flex-shrink: 0;
|
||||
display: block;
|
||||
object-fit: cover;
|
||||
background: #314034;
|
||||
box-shadow: 2px 2px #03070b;
|
||||
}
|
||||
|
||||
@@ -83,6 +83,10 @@
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.multiplayer-avatar {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
.multiplayer-table-wrap {
|
||||
overflow-x: auto;
|
||||
margin: 28px 0;
|
||||
@@ -99,6 +103,13 @@
|
||||
.multiplayer-final .multiplayer-you {
|
||||
background: #8dce6614;
|
||||
}
|
||||
.multiplayer-final-avatar {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: 6px;
|
||||
}
|
||||
.multiplayer-scoreboard {
|
||||
position: absolute;
|
||||
z-index: 20;
|
||||
@@ -139,6 +150,10 @@
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.multiplayer-scoreboard .multiplayer-avatar {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
}
|
||||
.multiplayer-scoreboard li small {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
|
||||
@@ -82,8 +82,10 @@ export default async function Settings({
|
||||
</section>
|
||||
{active && (
|
||||
<AccountSettings
|
||||
accountId={account.id}
|
||||
email={account.email ?? ""}
|
||||
displayName={profile.display_name}
|
||||
avatarPath={profile.avatar_path}
|
||||
appearance={profile}
|
||||
passwordUpdated={query.password === "updated"}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user