Merge pull request #186 from jedmund/fix-details-mobile

Fix various visual details on mobile
This commit is contained in:
Justin Edmund 2023-01-28 20:48:38 -08:00 committed by GitHub
commit fb76ca6665
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 137 additions and 27 deletions

View file

@ -22,6 +22,11 @@
max-width: 30vw; max-width: 30vw;
padding: $unit * 4; padding: $unit * 4;
@include breakpoint(phone) {
max-width: inherit;
width: 60vw;
}
.description { .description {
font-size: $font-regular; font-size: $font-regular;
line-height: 1.4; line-height: 1.4;

View file

@ -38,6 +38,15 @@
&:hover { &:hover {
background: none; background: none;
} }
.Text {
font-size: $font-small;
font-weight: $bold;
@include breakpoint(phone) {
display: none;
}
}
} }
&.Contained { &.Contained {
@ -99,6 +108,17 @@
padding: $unit * 1.5; padding: $unit * 1.5;
} }
@include breakpoint(phone) {
&.destructive {
background: $error;
color: $grey-100;
.Accessory svg {
fill: $grey-100;
}
}
}
&.destructive:hover { &.destructive:hover {
background: $error; background: $error;
color: $grey-100; color: $grey-100;

View file

@ -11,8 +11,7 @@
z-index: 15; z-index: 15;
@include breakpoint(phone) { @include breakpoint(phone) {
left: $unit-2x; min-width: 50vw;
right: $unit-2x;
} }
} }

View file

@ -137,7 +137,7 @@
.Properties { .Properties {
.full_auto { .full_auto {
color: var(--full-auto-text); color: var(--full-auto-label-text);
} }
} }

View file

@ -1,10 +1,23 @@
.DetailsWrapper { .DetailsWrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: $unit-2x;
margin: $unit-4x auto 0 auto; margin: $unit-4x auto 0 auto;
max-width: $grid-width; max-width: $grid-width;
@include breakpoint(phone) {
.Button:not(.IconButton) {
justify-content: center;
width: 100%;
.Text {
width: auto;
}
}
}
.PartyDetails { .PartyDetails {
box-sizing: border-box;
display: none; display: none;
margin: 0 auto $unit-2x; margin: 0 auto $unit-2x;
max-width: $unit * 94; max-width: $unit * 94;
@ -24,6 +37,7 @@
&.Visible { &.Visible {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
} }
fieldset { fieldset {
@ -37,6 +51,7 @@
} }
.SelectTrigger { .SelectTrigger {
padding: $unit-2x;
width: 100%; width: 100%;
} }
@ -45,12 +60,16 @@
grid-template-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;
gap: $unit; gap: $unit;
@include breakpoint(phone) {
grid-template-columns: 1fr;
}
.ToggleSection, .ToggleSection,
.InputSection { .InputSection {
align-items: center; align-items: center;
display: flex; display: flex;
background: var(--card-bg); background: var(--card-bg);
border-radius: $card-corner; border-radius: $input-corner;
& > label { & > label {
align-items: center; align-items: center;
@ -133,6 +152,11 @@
flex-direction: row; flex-direction: row;
gap: $unit; gap: $unit;
@include breakpoint(phone) {
flex-direction: column;
width: 100%;
}
.left { .left {
flex-grow: 1; flex-grow: 1;
} }
@ -141,6 +165,12 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: $unit; gap: $unit;
@include breakpoint(phone) {
.Button {
flex-grow: 1;
}
}
} }
} }
} }
@ -167,7 +197,8 @@
.Details { .Details {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: $unit-half; flex-wrap: wrap;
gap: $unit;
margin-bottom: $unit-2x; margin-bottom: $unit-2x;
} }
@ -258,21 +289,21 @@
} }
.PartyInfo { .PartyInfo {
align-items: center;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: $unit; gap: $unit;
margin: 0 auto; margin: 0 auto;
margin-bottom: $unit * 2;
max-width: $unit * 94; max-width: $unit * 94;
width: 100%; width: 100%;
@include breakpoint(phone) { @include breakpoint(phone) {
flex-direction: column;
gap: $unit;
padding: 0 $unit; padding: 0 $unit;
} }
.Left { & > .Left {
flex-grow: 1; flex-grow: 1;
.Header { .Header {

View file

@ -667,15 +667,20 @@ const PartyDetails = (props: Props) => {
const readOnly = ( const readOnly = (
<section className={readOnlyClasses}> <section className={readOnlyClasses}>
<section className="Details"> <section className="Details">
{ <Token className={classNames({ ChargeAttack: true, On: chargeAttack })}>
<Token> {`${t('party.details.labels.charge_attack')} ${
{`${t('party.details.labels.charge_attack')} ${ chargeAttack ? 'On' : 'Off'
chargeAttack ? 'On' : 'Off' }`}
}`} </Token>
</Token>
} <Token className={classNames({ FullAuto: true, On: fullAuto })}>
{fullAuto ? <Token>{t('party.details.labels.full_auto')}</Token> : ''} {`${t('party.details.labels.full_auto')} ${fullAuto ? 'On' : 'Off'}`}
{autoGuard ? <Token>{t('party.details.labels.auto_guard')}</Token> : ''} </Token>
<Token className={classNames({ AutoGuard: true, On: autoGuard })}>
{`${t('party.details.labels.auto_guard')} ${fullAuto ? 'On' : 'Off'}`}
</Token>
{turnCount ? ( {turnCount ? (
<Token> <Token>
{t('party.details.turns.with_count', { {t('party.details.turns.with_count', {
@ -715,6 +720,7 @@ const PartyDetails = (props: Props) => {
<Button <Button
className="IconButton Blended" className="IconButton Blended"
leftAccessoryIcon={<RemixIcon />} leftAccessoryIcon={<RemixIcon />}
text={t('tokens.remix')}
onClick={() => goTo(party.sourceParty?.shortcode)} onClick={() => goTo(party.sourceParty?.shortcode)}
/> />
</Tooltip> </Tooltip>
@ -737,17 +743,17 @@ const PartyDetails = (props: Props) => {
)} )}
</div> </div>
</div> </div>
<div className="Right"> {party.editable ? (
{party.editable ? ( <div className="Right">
<Button <Button
leftAccessoryIcon={<EditIcon />} leftAccessoryIcon={<EditIcon />}
text={t('buttons.show_info')} text={t('buttons.show_info')}
onClick={toggleDetails} onClick={toggleDetails}
/> />
) : ( </div>
<div /> ) : (
)} ''
</div> )}
</div> </div>
{readOnly} {readOnly}
{editable} {editable}

View file

@ -1,10 +1,25 @@
.Token { .Token {
background: var(--input-bg); background: var(--input-bg);
border-radius: 99px; border-radius: 99px;
display: inline; display: inline-flex;
font-size: $font-small; font-size: $font-small;
font-weight: $medium; font-weight: $medium;
min-width: 3rem; min-width: 3rem;
text-align: center; text-align: center;
padding: $unit-half $unit; padding: $unit ($unit * 1.5);
&.ChargeAttack.On {
background: var(--charge-attack-bg);
color: var(--charge-attack-text);
}
&.FullAuto.On {
background: var(--full-auto-bg);
color: var(--full-auto-text);
}
&.AutoGuard.On {
background: var(--auto-guard-bg);
color: var(--auto-guard-text);
}
} }

View file

@ -4,6 +4,10 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
@include breakpoint(phone) {
margin: 0 2px;
}
#MainGrid { #MainGrid {
display: grid; display: grid;
gap: $unit-3x; gap: $unit-3x;

View file

@ -399,6 +399,9 @@
"toasts": { "toasts": {
"copied": "This party's URL was copied to your clipboard" "copied": "This party's URL was copied to your clipboard"
}, },
"tokens": {
"remix": "Remixed"
},
"tooltips": { "tooltips": {
"remix": "Make a copy of this team", "remix": "Make a copy of this team",
"save": "Save this team to your account", "save": "Save this team to your account",

View file

@ -400,6 +400,9 @@
"toasts": { "toasts": {
"copied": "この編成のURLはクリップボードにコピーされました" "copied": "この編成のURLはクリップボードにコピーされました"
}, },
"tokens": {
"remix": "リミックスされた"
},
"tooltips": { "tooltips": {
"remix": "この編成をコピーする", "remix": "この編成をコピーする",
"save": "この編成をアカウントに保存する", "save": "この編成をアカウントに保存する",

View file

@ -9,7 +9,14 @@
--link-text-hover: #{$text--link--hover--light}; --link-text-hover: #{$text--link--hover--light};
--full-auto-text: #{$text--full--auto--light}; --charge-attack-bg: #{$charge--attack--bg};
--charge-attack-text: #{$charge--attack--text};
--full-auto-bg: #{$full--auto--bg};
--full-auto-text: #{$charge--attack--text};
--auto-guard-bg: #{$auto--guard--bg};
--auto-guard-text: #{$auto--guard--text};
--full-auto-label-text: #{$text--full--auto--light};
--separator-bg: #{$separator--bg--light}; --separator-bg: #{$separator--bg--light};
@ -141,7 +148,13 @@
--link-text-hover: #{$text--link--hover--dark}; --link-text-hover: #{$text--link--hover--dark};
--full-auto-text: #{$text--full--auto--dark}; --charge-attack-bg: #{$charge--attack--bg};
--charge-attack-text: #{$charge--attack--text};
--full-auto-bg: #{$full--auto--bg};
--full-auto-text: #{$charge--attack--text};
--full-auto-label-text: #{$text--full--auto--dark};
--separator-bg: #{$separator--bg--dark}; --separator-bg: #{$separator--bg--dark};

View file

@ -65,9 +65,11 @@ $purple-90: #ecebff;
$orange-00: #201710; $orange-00: #201710;
$orange-10: #6b401b; $orange-10: #6b401b;
$orange-30: #825b39; $orange-30: #825b39;
$orange-35: #885243;
$orange-40: #925a2a; $orange-40: #925a2a;
$orange-50: #a8703f; $orange-50: #a8703f;
$orange-70: #d08f57; $orange-70: #d08f57;
$orange-75: #ffb461;
$orange-80: #facea7; $orange-80: #facea7;
$orange-90: #ffebd9; $orange-90: #ffebd9;
@ -254,6 +256,15 @@ $subaura--orange--primary--dark: $orange-00;
$subaura--orange--secondary--dark: $orange-10; $subaura--orange--secondary--dark: $orange-10;
$subaura--orange--text--dark: $orange-70; $subaura--orange--text--dark: $orange-70;
// Color Definitions: Tokens
$charge--attack--bg: $orange-75;
$charge--attack--text: $orange-35;
$full--auto--bg: $yellow-text-20;
$auto--guard--bg: $purple-30;
$auto--guard--text: $purple-10;
// Color Definitions: Element Toggle // Color Definitions: Element Toggle
$toggle--bg--light: $grey-90; $toggle--bg--light: $grey-90;
$toggle--bg--dark: $grey-15; $toggle--bg--dark: $grey-15;