diff --git a/frontend/js/user/badges.js b/frontend/js/user/badges.js index 4053331a..813fb944 100644 --- a/frontend/js/user/badges.js +++ b/frontend/js/user/badges.js @@ -6,6 +6,10 @@ const ALL_BADGES = [ id: "HARD_CARRY", title: "Solved 5+ Hard problems and 0 Easy problems over the past 7 days", }, + { + id: "CENTURION", + title: "Solved a grand total of 100 or more problems", + }, ]; async function loadBadges(username) { @@ -47,6 +51,15 @@ async function loadBadges(username) { } } + if (history.length >= 1) { + const latest = history[history.length - 1]; + const totalSolved = + (latest.easy || 0) + (latest.medium || 0) + (latest.hard || 0); + if (totalSolved >= 100) { + earnedSet.add("CENTURION"); + } + } + if (ranks.overall && parseInt(ranks.overall.change, 10) >= 5) { earnedSet.add("UP_LINK"); } diff --git a/frontend/user.html b/frontend/user.html index ab7c0be5..8c27a926 100644 --- a/frontend/user.html +++ b/frontend/user.html @@ -217,6 +217,13 @@ text-shadow: 0 0 8px rgba(255, 0, 60, 0.5); } + .badge-centurion { + color: #ff9f1c; + background: rgba(255, 159, 28, 0.15); + border-color: rgba(255, 159, 28, 0.4); + text-shadow: 0 0 8px rgba(255, 159, 28, 0.5); + } + .badge-uplink { color: var(--cyan); background: rgba(0, 229, 255, 0.1);