diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index aac5d5e83..fb9a3435a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1095,6 +1095,9 @@ _achievements: _collectAchievements30: title: "実績コレクター" description: "実績を30個以上獲得した" + _viewAchievements3min: + title: "実績好き" + description: "実績一覧を3分以上眺め続けた" _iLoveMisskey: title: "I Love Misskey" description: "\"I ❤ #Misskey\"を投稿した" @@ -1152,6 +1155,9 @@ _achievements: _loggedInOnBirthday: title: "ハッピーバースデー" description: "誕生日にログインした" + _loggedInOnNewYearsDay: + title: "あけましておめでとうございます" + description: "元日にログインした" _cookieClicked: title: "クッキーをクリックするゲーム" description: "クッキーをクリックした" diff --git a/packages/backend/src/core/AchievementService.ts b/packages/backend/src/core/AchievementService.ts index 149974452..26dd356d3 100644 --- a/packages/backend/src/core/AchievementService.ts +++ b/packages/backend/src/core/AchievementService.ts @@ -41,6 +41,7 @@ const ACHIEVEMENT_TYPES = [ 'passedSinceAccountCreated2', 'passedSinceAccountCreated3', 'loggedInOnBirthday', + 'loggedInOnNewYearsDay', 'noteClipped1', 'noteFavorited1', 'profileFilled', @@ -58,6 +59,7 @@ const ACHIEVEMENT_TYPES = [ 'followers500', 'followers1000', 'collectAchievements30', + 'viewAchievements3min', 'iLoveMisskey', 'client30min', 'noteDeletedWithin1min', diff --git a/packages/frontend/src/init.ts b/packages/frontend/src/init.ts index a2723d479..09fb7caf1 100644 --- a/packages/frontend/src/init.ts +++ b/packages/frontend/src/init.ts @@ -346,10 +346,11 @@ import { claimAchievement, claimedAchievements } from './scripts/achievements'; }); } + const now = new Date(); + const m = now.getMonth() + 1; + const d = now.getDate(); + if ($i.birthday) { - const now = new Date(); - const m = now.getMonth() + 1; - const d = now.getDate(); const bm = parseInt($i.birthday.split('-')[1]); const bd = parseInt($i.birthday.split('-')[2]); if (m === bm && d === bd) { @@ -357,6 +358,10 @@ import { claimAchievement, claimedAchievements } from './scripts/achievements'; } } + if (m === 1 && d === 1) { + claimAchievement('loggedInOnNewYearsDay'); + } + if ($i.loggedInDays >= 3) claimAchievement('login3'); if ($i.loggedInDays >= 7) claimAchievement('login7'); if ($i.loggedInDays >= 15) claimAchievement('login15'); diff --git a/packages/frontend/src/pages/achievements.vue b/packages/frontend/src/pages/achievements.vue index b6cd174b4..3cec8f630 100644 --- a/packages/frontend/src/pages/achievements.vue +++ b/packages/frontend/src/pages/achievements.vue @@ -8,11 +8,36 @@