HighlightingLogic - IEEE-Team-3/map GitHub Wiki
The leaderboard will include highlighting logic to visually distinguish top performers, recent changes, or other notable achievements. These highlights improve user engagement and highlight top players.
- Top Performers: Users in the top 10 will have their rank highlighted with a distinct color.
- Recent Changes: Users who have recently improved their rank or points will be highlighted.
- Milestones: Users who achieve specific milestones (e.g., 100 tasks completed) will be highlighted.
- Penalty: Users who lose points will have their score highlighted with a warning color.
function highlightLeaderboardEntries() {
Leaderboard.find({ rank: { $lte: 10 } })
.then(entries => {
entries.forEach(entry => {
entry.highlight = 'top-performer';
entry.save();
});
});
}
function applyMilestoneHighlight(userId) {
const user = Leaderboard.findOne({ userId });
if (user.completedTasks >= 100) {
user.highlight = 'milestone';
user.save();
}
}
Highlights will be visually represented in the frontend with special colors or badges. For example, users in the top 10 could have their names displayed in gold.