Skip to content

feat: Add "HARD_CARRY" Gamification Badge to User Profile #334#340

Open
yashvi-3106 wants to merge 1 commit into
codepvg:mainfrom
yashvi-3106:feature/hard-carry-badge
Open

feat: Add "HARD_CARRY" Gamification Badge to User Profile #334#340
yashvi-3106 wants to merge 1 commit into
codepvg:mainfrom
yashvi-3106:feature/hard-carry-badge

Conversation

@yashvi-3106

Copy link
Copy Markdown
Contributor

Description

This PR implements the new "HARD_CARRY" Gamification Badge for user profiles. The badge is awarded dynamically based on a user's problem-solving history over the last 7 days.

Linked Issue

Fixes #334

Changes Made

  • frontend/js/user/badges.js:
    • Registered HARD_CARRY to the ALL_BADGES configuration list.
    • Implemented the badge unlock condition in loadBadges() to check the last 8 snapshots (past 7 days) for $\ge 5$ solved Hard problems and exactly $0$ solved Easy problems.
  • frontend/user.html:
    • Added CSS style declarations for .badge-hardcarry implementing a visually distinct, aggressive crimson-red neon theme (#ff003c) to match the terminal styling.

Type of Change

  • Bug fix
  • New feature
  • UI/Visual update
  • Documentation update
  • Refactor

Testing

  • Tested locally
  • Tested on mobile viewport (if applicable)
  • No console errors introduced

Checklist

  • My code follows the project's coding style
  • I have formatted my code locally by running npx prettier --write . before submitting
  • I am submitting my PR from a dedicated feature/* branch, not the main branch
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have updated documentation if required
  • I have linked the relevant issue

Screenshots / Screen Recording

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for submitting a pull request.

Please ensure your changes comply with the project's contribution guidelines and that all workflow checks pass successfully.

Formatting and Branching

  • Please confirm you have formatted your code locally using npx prettier --write . before requesting a review.
  • Ensure this PR is made from a feature/* branch and not main.

Note: This project is currently maintained by a solo maintainer, so reviews and responses may sometimes take a little time. Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "HARD_CARRY" Gamification Badge to User Profile

1 participant