Improved ladder appearance on mobile

This commit is contained in:
2019-06-05 22:10:15 +10:00
parent bd3b30fffd
commit 73fe349936
5 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ The best way to gain gold in this game is to attack other players. You can do th
<div class="break" /> <div class="break" />
Untrained recruits gain you 1 gold piece evey 5 minutes - the only unit type that grants a passive income. They also act as a defense force when your soldiers are away, but they have lower combat skills. When recriuts are attacked, it is marked as "undefended" in the combat log. Recruits can still use equipment. Untrained recruits gain you 1 gold piece evey 10 minutes - the only unit type that grants a passive income. They also act as a defense force when your soldiers are away, but they have lower combat skills. When recriuts are attacked, it is marked as "undefended" in the combat log. Recruits can still use equipment.
<div class="break" /> <div class="break" />
+1 -1
View File
@@ -313,7 +313,7 @@ pre {
@media screen and (max-width: 480px) { @media screen and (max-width: 480px) {
.show.mobile { .show.mobile {
display: block; display: inline-block;
} }
.hide.mobile { .hide.mobile {
+1 -1
View File
@@ -370,7 +370,7 @@ const ladderRequest = (connection) => (req, res) => {
}; };
const runGoldTick = (connection) => { const runGoldTick = (connection) => {
let goldTickJob = new CronJob('0 */5 * * * *', () => { let goldTickJob = new CronJob('0 */10 * * * *', () => {
let query = 'UPDATE profiles SET gold = gold + recruits;'; let query = 'UPDATE profiles SET gold = gold + recruits;';
connection.query(query, (err) => { connection.query(query, (err) => {
if (err) throw err; if (err) throw err;
+3 -1
View File
@@ -37,7 +37,9 @@ class Ladder extends React.Component {
<div className='mainPanel'> <div className='mainPanel'>
<h1 className='centered'>Game Ladder</h1> <h1 className='centered'>Game Ladder</h1>
<ButtonHeader /> <ButtonHeader />
<br />
<div className='half break mobile hide' />
<PagedLadder <PagedLadder
start={this.state.start} start={this.state.start}
length={this.state.length} length={this.state.length}
+4 -4
View File
@@ -17,7 +17,7 @@ class PagedLadder extends React.Component {
render() { render() {
return ( return (
<div className='table'> <div className='table'>
<div className='row'> <div className='row mobile hide'>
<p className='col centered'>Username</p> <p className='col centered'>Username</p>
<p className='col centered'>Soldiers</p> <p className='col centered'>Soldiers</p>
<p className='col centered'>Recruits</p> <p className='col centered'>Recruits</p>
@@ -28,9 +28,9 @@ class PagedLadder extends React.Component {
<div className='break' /> <div className='break' />
<div className={'row'}> <div className={'row'}>
<p className={'col centered truncate'}><Link to={`/profile?username=${this.state[key].username}`}>{this.state[key].username}</Link></p> <p className={'col centered truncate'}><Link to={`/profile?username=${this.state[key].username}`}>{this.state[key].username}</Link></p>
<p className={'col centered truncate'}>{this.state[key].soldiers}</p> <p className={'col centered truncate'}><span className='mobile show' style={{whiteSpace: 'pre'}}>Soldiers: </span>{this.state[key].soldiers}</p>
<p className={'col centered truncate'}>{this.state[key].recruits}</p> <p className={'col centered truncate'}><span className='mobile show' style={{whiteSpace: 'pre'}}>Recruits: </span>{this.state[key].recruits}</p>
<p className={'col centered truncate'}>{this.state[key].gold}</p> <p className={'col centered truncate'}><span className='mobile show' style={{whiteSpace: 'pre'}}>Gold: </span>{this.state[key].gold}</p>
</div> </div>
</div>)} </div>)}
</div> </div>