Skip to content

Commit

Permalink
Hide username on screens smaller than 500px (smogon#1973)
Browse files Browse the repository at this point in the history
  • Loading branch information
takeshi-codes authored and MathyFurret committed Mar 25, 2024
1 parent b4f1141 commit 4feae2b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/client-topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if (!app.user.loaded) {
buf = '<button disabled>Loading...</button>';
} else if (app.user.get('named')) {
buf = '<span class="username" data-name="' + BattleLog.escapeHTML(name) + '"' + (away ? ' data-away="true"' : '') + (status ? 'data-status="' + BattleLog.escapeHTML(status) + '"' : '') + ' style="' + color + '"><i class="fa fa-user" style="color:' + (away ? '#888;' : '#779EC5') + '"></i> ' + BattleLog.escapeHTML(name) + '</span>';
buf = '<span class="username" data-name="' + BattleLog.escapeHTML(name) + '"' + (away ? ' data-away="true"' : '') + (status ? 'data-status="' + BattleLog.escapeHTML(status) + '"' : '') + ' style="' + color + '"><i class="fa fa-user" style="color:' + (away ? '#888;' : '#779EC5') + '"></i> <span class="usernametext">' + BattleLog.escapeHTML(name) + '</span></span>';
} else {
buf = '<button name="login">Choose name</button>';
}
Expand Down
2 changes: 1 addition & 1 deletion src/panel-topbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class PSHeader extends preact.Component<{style: {}}> {
}
const userColor = window.BattleLog && {color: BattleLog.usernameColor(PS.user.userid)};
return <span class="username" data-name={PS.user.name} style={userColor}>
<i class="fa fa-user" style="color:#779EC5"></i> {PS.user.name}
<i class="fa fa-user" style="color:#779EC5"></i> <span class="usernametext">{PS.user.name}</span>
</span>;
}
render() {
Expand Down
7 changes: 6 additions & 1 deletion style/client.css
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ select {
.username {
cursor: pointer;
}
@media (max-width: 500px) {
.usernametext {
display: none
}
}
.userbar button.icon {
height: 25px;
width: 27px;
Expand Down Expand Up @@ -2008,7 +2013,7 @@ a.ilink.yours {
white-space: pre;
overflow: hidden;
}
.allyparty button .picon,
.allyparty button .picon,
.switchmenu button .picon {
float: left;
margin: -6px -3px -6px -4px;
Expand Down
5 changes: 5 additions & 0 deletions style/client2.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ body {
.username {
cursor: pointer;
}
@media (max-width: 500px) {
.usernametext {
display: none
}
}
.userbar button.icon {
height: 25px;
width: 27px;
Expand Down

0 comments on commit 4feae2b

Please sign in to comment.