mobile UX tweaks, fix blink animation

This commit is contained in:
Jeff Colombo 2019-05-10 16:33:49 -04:00
parent 9f71834269
commit c88a6f6485
8 changed files with 41 additions and 27 deletions

2
dist/app.css vendored
View File

@ -12,7 +12,7 @@
.LeagueSelector__wrapper__fxmRz{font-size:0.8em;display:flex;justify-content:space-around;margin:0 0 0.5rem 0}.LeagueSelector__leagueRadioLabel__3aPV9{display:flex;align-items:center}.LeagueSelector__leagueRadio__3hY7B{display:none} .LeagueSelector__wrapper__fxmRz{font-size:0.8em;display:flex;justify-content:space-around;margin:0 0 0.5rem 0}.LeagueSelector__leagueRadioLabel__3aPV9{display:flex;align-items:center}.LeagueSelector__leagueRadio__3hY7B{display:none}
.LeagueStatsList__selectList__1FBIL{flex-grow:1;display:flex;overflow:hidden}.LeagueStatsList__selectList__1FBIL>*{flex:1;overflow:auto}.LeagueStatsList__listItem__oCOvr{position:relative;display:flex;justify-content:space-evenly}.LeagueStatsList__listItem__oCOvr.list-item.active::before,.LeagueStatsList__listItem__oCOvr.list-item:hover::before{top:8px;left:10px} .LeagueStatsList__selectList__1FBIL{flex-grow:1;display:flex;overflow:hidden}.LeagueStatsList__selectList__1FBIL>*{flex:1;overflow:auto}.LeagueStatsList__listItem__oCOvr{position:relative;display:flex;justify-content:space-evenly}.LeagueStatsList__listItem__oCOvr.list-item.active::before,.LeagueStatsList__listItem__oCOvr.list-item:hover::before{top:8px}@media only screen and (max-width: 767px){.LeagueStatsList__listItem__oCOvr.list-item.active::before,.LeagueStatsList__listItem__oCOvr.list-item:hover::before{left:3px}}
.StatDisplay__baseStatRow__1B60A{display:flex;align-items:center}.StatDisplay__baseStatRow__1B60A>*{flex-shrink:0}.StatDisplay__baseStatRow__1B60A>progress{flex-shrink:1;margin:0 0 0 1em;width:5em;height:1em;border-image-outset:1;padding:2px}@media only screen and (max-width: 767px){.StatDisplay__baseStatRow__1B60A>progress{height:1.2em}}@media only screen and (max-width: 359px){.StatDisplay__baseStatRow__1B60A>progress{height:1.3em}} .StatDisplay__baseStatRow__1B60A{display:flex;align-items:center}.StatDisplay__baseStatRow__1B60A>*{flex-shrink:0}.StatDisplay__baseStatRow__1B60A>progress{flex-shrink:1;margin:0 0 0 1em;width:5em;height:1em;border-image-outset:1;padding:2px}@media only screen and (max-width: 767px){.StatDisplay__baseStatRow__1B60A>progress{height:1.2em}}@media only screen and (max-width: 359px){.StatDisplay__baseStatRow__1B60A>progress{height:1.3em}}

2
dist/global.css vendored

File diff suppressed because one or more lines are too long

12
dist/main-bundle.js vendored

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,17 @@
@import './sprites.scss'; @import './sprites.scss';
@import '~nes.css/scss/utilities/icon-mixin'; @import '~nes.css/scss/utilities/icon-mixin';
@mixin hover-arrow {
position: absolute;
top: 3px;
left: 4px;
content: "";
@media only screen and (max-width: $max-mobile-width) {
left: 0;
}
}
html, html,
body { body {
margin: 0; margin: 0;
@ -94,19 +105,18 @@ a.list-item {
); );
$colors: ($main-font-primary-color, $main-active-font-color); $colors: ($main-font-primary-color, $main-active-font-color);
&.active, // prevent iOS bug needing to click twice on hovered links
&:hover { @media (hover) {
&::before { &:hover::before {
position: absolute; @include hover-arrow;
top: 3px;
left: 4px;
content: "";
@include pixelize(2px, $radio, $colors); @include pixelize(2px, $radio, $colors);
}
}
@media only screen and (max-width: $max-mobile-width) { &.active {
left: 0; &::before {
} @include hover-arrow;
@include pixelize(2px, $radio-checked-focus, $colors);
} }
} }
@ -116,10 +126,6 @@ a.list-item {
animation: blink 1s infinite steps(1); animation: blink 1s infinite steps(1);
} }
} }
&.active::before {
@include pixelize(2px, $radio-checked-focus, $colors);
}
} }
.nes-container { .nes-container {

View File

@ -22,7 +22,7 @@ $small-scale: 2;
.pokedex { .pokedex {
$pokedex-scale: $scale; $pokedex-scale: $scale;
@keyframes blink { @keyframes led-blink {
from { background-position-x: -6px * $pokedex-scale; } from { background-position-x: -6px * $pokedex-scale; }
to { background-position-x: -18px * $pokedex-scale; } to { background-position-x: -18px * $pokedex-scale; }
} }
@ -36,7 +36,7 @@ $small-scale: 2;
&:hover, &:hover,
&.active { &.active {
background-position-x: -6px * $pokedex-scale; background-position-x: -6px * $pokedex-scale;
animation: blink 500ms steps(2) infinite; animation: led-blink 500ms steps(2) infinite;
} }
} }

View File

@ -147,6 +147,7 @@ class PokemonApp extends React.Component<IConnectedPokemonAppProps> {
filterTerm={ this.props.pokemonSelectListState.filterTerm } filterTerm={ this.props.pokemonSelectListState.filterTerm }
handleActivatePokemon={ this.handleActivatePokemon } handleActivatePokemon={ this.handleActivatePokemon }
handleChangeFilter={ this.handleChangeFilter } handleChangeFilter={ this.handleChangeFilter }
handleOpenList={ this.handlePokedexClick }
/> />
<Media query={ { minWidth: MIN_TABLET_WIDTH } }> <Media query={ { minWidth: MIN_TABLET_WIDTH } }>
<button className={ pokedexButtonCss } onClick={ this.handlePokedexClick }><i className={ pokedexCss } /></button> <button className={ pokedexButtonCss } onClick={ this.handlePokedexClick }><i className={ pokedexCss } /></button>
@ -224,6 +225,7 @@ class PokemonApp extends React.Component<IConnectedPokemonAppProps> {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch(ActionsPokemonExplorer.setIsLoading(true)); dispatch(ActionsPokemonExplorer.setIsLoading(true));
this.handleInterruption(false, 'pokedex');
try { try {
const leaguePokemon = await dispatch(ActionsPokemonApp.fetchPokemonLeagueStats(pokemonId, form)); const leaguePokemon = await dispatch(ActionsPokemonApp.fetchPokemonLeagueStats(pokemonId, form));
dispatch(ActionsPokemonExplorer.reset(leaguePokemon)); dispatch(ActionsPokemonExplorer.reset(leaguePokemon));
@ -233,7 +235,6 @@ class PokemonApp extends React.Component<IConnectedPokemonAppProps> {
dispatch(ActionsPokemonExplorer.setLeaguePokemon(null)); dispatch(ActionsPokemonExplorer.setLeaguePokemon(null));
} }
dispatch(ActionsPokemonExplorer.setIsLoading(false)); dispatch(ActionsPokemonExplorer.setIsLoading(false));
this.handleInterruption(false, 'pokedex');
} }
private readonly handleChangeFilter = (filterTerm : string) => { private readonly handleChangeFilter = (filterTerm : string) => {

View File

@ -26,7 +26,12 @@
&:hover { &:hover {
&::before { &::before {
top: 8px; top: 8px;
left: 10px; }
@media only screen and (max-width: $max-mobile-width) {
&::before {
left: 3px;
}
} }
} }
} }

View File

@ -24,6 +24,7 @@ export interface IPokemonSelectListProps {
handleActivatePokemon : (pokemonId : PVPogoProtos.PokemonId, form : PVPogoProtos.PokemonForm) => void; handleActivatePokemon : (pokemonId : PVPogoProtos.PokemonId, form : PVPogoProtos.PokemonForm) => void;
handleChangeFilter : (filterTerm : string) => Promise<void>; handleChangeFilter : (filterTerm : string) => Promise<void>;
handleOpenList : () => void;
} }
interface IState { interface IState {
@ -124,6 +125,7 @@ export class PokemonSelectList extends React.Component<IPokemonSelectListProps,
name="filter" name="filter"
type="text" type="text"
className={ inputTextCss } className={ inputTextCss }
onFocus={ this.props.handleOpenList }
onChange={ this.handleChangeFilter } onChange={ this.handleChangeFilter }
value={ this.props.filterTerm } value={ this.props.filterTerm }
placeholder="Search" placeholder="Search"