Skip to content

Commit

Permalink
feat: Update style of wld element (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
thieleju committed Sep 25, 2024
1 parent bb4ce83 commit 49058fe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Shows Win/Lose/Draw and average accuracy for players on chess.com",
"author": "thieleju",
"manifest_version": 3,
"version": "2.6.1",
"version": "2.7.0",
"permissions": ["activeTab", "scripting", "storage"],
"action": {
"default_locale": "en",
Expand All @@ -24,10 +24,11 @@
"matches": [
"https://*.chess.com/play/online*",
"https://*.chess.com/play/online/*",
"https://*.chess.com/play/arena/*",
"https://*.chess.com/game/daily/*",
"https://*.chess.com/game/live/*",
"https://*.chess.com/live/game/*",
"https://*.chess.com/game/*",
"https://*.chess.com/live/game/*",
"https://*.chess.com/analysis/game/live/*"
],
"js": ["src/scripts/insights.ts"]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chess-com-insights",
"private": true,
"version": "2.6.1",
"version": "2.7.0",
"type": "module",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"show_accuracy": true,
"show_stats": true,
"popup_darkmode": true,
"color_highlighting": false
"color_highlighting": true
},
"validGameModes": ["blitz", "rapid", "bullet", "daily"],
"validTimeIntervals": [
Expand Down
2 changes: 1 addition & 1 deletion src/modules/SettingsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class SettingsManager {
!isBoolean(settings.show_accuracy),
!isBoolean(settings.hide_own_stats),
!Array.isArray(settings.game_modes) ||
!settings.game_modes.every(isValidGameMode),
!settings.game_modes.every(isValidGameMode),
!isValidTimeInterval(settings.time_interval),
!isBoolean(settings.color_highlighting)
]
Expand Down
8 changes: 7 additions & 1 deletion src/modules/UiUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ export class UiUpdater {
`<span style="color: ${this.color_loses}">${stats.wld.loses}</span>/` +
`<span style="color: ${this.color_draws}">${stats.wld.draws}</span>` +
`</strong>`
} else str = `${stats.wld.wins}/${stats.wld.loses}/${stats.wld.draws}`
} else {
str =
`<strong>` +
`${stats.wld.wins}/${stats.wld.loses}/${stats.wld.draws}` +
`</strong>`
}

if (stats.accuracy.avg !== 0 && showAccuracy)
str += ` (${stats.accuracy.avg}%)`
Expand Down Expand Up @@ -208,6 +213,7 @@ export class UiUpdater {
createInfoElement(className: string, id: string): HTMLElement {
const infoEl = this.uiWindow.getDocument().createElement("div")
infoEl.classList.add("user-tagline-rating", className)
infoEl.style.color = "var(--color-gray-600)"
infoEl.id = id
infoEl.style.marginLeft = "10px"
return infoEl
Expand Down

0 comments on commit 49058fe

Please sign in to comment.