mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
Add OG Account Trophy (#174)
* Update trophy.ts * Update trophy_list.ts
This commit is contained in:
parent
7b8a6a4100
commit
0184955871
3 changed files with 24 additions and 0 deletions
|
|
@ -199,6 +199,23 @@ export class MultipleOrganizationsTrophy extends Trophy{
|
|||
}
|
||||
}
|
||||
|
||||
export class OGAccountTrophy extends Trophy{
|
||||
constructor(score: number){
|
||||
const rankConditions = [
|
||||
new RankCondition(
|
||||
RANK.SECRET,
|
||||
"OG User",
|
||||
1,
|
||||
),
|
||||
];
|
||||
super(score, rankConditions);
|
||||
this.title = "OGUser";
|
||||
this.filterTitles = ["OGUser"];
|
||||
this.bottomMessage = "Joined 2008"
|
||||
this.hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
export class TotalStarTrophy extends Trophy {
|
||||
constructor(score: number) {
|
||||
const rankConditions = [
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import {
|
|||
MultipleLangTrophy,
|
||||
LongTimeAccountTrophy,
|
||||
AncientAccountTrophy,
|
||||
OGAccountTrophy,
|
||||
Joined2020Trophy,
|
||||
AllSuperRankTrophy,
|
||||
MultipleOrganizationsTrophy,
|
||||
|
|
@ -34,6 +35,7 @@ export class TrophyList {
|
|||
new MultipleLangTrophy(userInfo.languageCount),
|
||||
new LongTimeAccountTrophy(userInfo.durationYear),
|
||||
new AncientAccountTrophy(userInfo.ancientAccount),
|
||||
new OGAccountTrophy(userInfo.ogAccount),
|
||||
new Joined2020Trophy(userInfo.joined2020),
|
||||
new MultipleOrganizationsTrophy(userInfo.totalOrganizations),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ export class UserInfo {
|
|||
public readonly durationYear: number;
|
||||
public readonly ancientAccount: number;
|
||||
public readonly joined2020: number;
|
||||
public readonly ogAccount: number;
|
||||
constructor(
|
||||
userActivity: GitHubUserActivity,
|
||||
userIssue: GitHubUserIssue,
|
||||
|
|
@ -85,6 +86,9 @@ export class UserInfo {
|
|||
const joined2020 = new Date(userActivity.createdAt).getFullYear() == 2020
|
||||
? 1
|
||||
: 0;
|
||||
const ogAccount =
|
||||
new Date(userActivity.createdAt).getFullYear() <= 2008 ? 1 : 0;
|
||||
|
||||
this.totalCommits = totalCommits;
|
||||
this.totalFollowers = userActivity.followers.totalCount;
|
||||
this.totalIssues = userIssue.openIssues.totalCount + userIssue.closedIssues.totalCount;
|
||||
|
|
@ -96,5 +100,6 @@ export class UserInfo {
|
|||
this.durationYear = durationYear;
|
||||
this.ancientAccount = ancientAccount;
|
||||
this.joined2020 = joined2020;
|
||||
this.ogAccount = ogAccount;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue