diff --git a/migrations/archive/2024/20240131_habit_birthday.js b/migrations/archive/2024/20240131_habit_birthday.js new file mode 100644 index 0000000000..a05f7fefce --- /dev/null +++ b/migrations/archive/2024/20240131_habit_birthday.js @@ -0,0 +1,102 @@ +/* eslint-disable no-console */ +import { v4 as uuid } from 'uuid'; +import { model as User } from '../../../website/server/models/user'; + +const MIGRATION_NAME = '20240131_habit_birthday'; +const progressCount = 1000; +let count = 0; + +async function updateUser (user) { + count += 1; + + const inc = { + 'items.food.Cake_Skeleton': 1, + 'items.food.Cake_Base': 1, + 'items.food.Cake_CottonCandyBlue': 1, + 'items.food.Cake_CottonCandyPink': 1, + 'items.food.Cake_Shade': 1, + 'items.food.Cake_White': 1, + 'items.food.Cake_Golden': 1, + 'items.food.Cake_Zombie': 1, + 'items.food.Cake_Desert': 1, + 'items.food.Cake_Red': 1, + 'achievements.habitBirthdays': 1, + }; + const set = {}; + const push = { + notifications: { + type: 'ITEM_RECEIVED', + data: { + icon: 'notif_namingDay_cake', + title: 'Happy Habit Birthday!', + text: 'Habitica turns 11 today! Enjoy free party robes and cake!', + destination: 'inventory/equipment', + }, + seen: false, + }, + }; + + set.migration = MIGRATION_NAME; + + if (typeof user.items.gear.owned.armor_special_birthday2023 !== 'undefined') { + set['items.gear.owned.armor_special_birthday2024'] = true; + } else if (typeof user.items.gear.owned.armor_special_birthday2022 !== 'undefined') { + set['items.gear.owned.armor_special_birthday2023'] = true; + } else if (typeof user.items.gear.owned.armor_special_birthday2021 !== 'undefined') { + set['items.gear.owned.armor_special_birthday2022'] = true; + } else if (typeof user.items.gear.owned.armor_special_birthday2020 !== 'undefined') { + set['items.gear.owned.armor_special_birthday2021'] = true; + } else if (typeof user.items.gear.owned.armor_special_birthday2019 !== 'undefined') { + set['items.gear.owned.armor_special_birthday2020'] = true; + } else if (typeof user.items.gear.owned.armor_special_birthday2018 !== 'undefined') { + set['items.gear.owned.armor_special_birthday2019'] = true; + } else if (typeof user.items.gear.owned.armor_special_birthday2017 !== 'undefined') { + set['items.gear.owned.armor_special_birthday2018'] = true; + } else if (typeof user.items.gear.owned.armor_special_birthday2016 !== 'undefined') { + set['items.gear.owned.armor_special_birthday2017'] = true; + } else if (typeof user.items.gear.owned.armor_special_birthday2015 !== 'undefined') { + set['items.gear.owned.armor_special_birthday2016'] = true; + } else if (typeof user.items.gear.owned.armor_special_birthday !== 'undefined') { + set['items.gear.owned.armor_special_birthday2015'] = true; + } else { + set['items.gear.owned.armor_special_birthday'] = true; + } + + if (count % progressCount === 0) console.warn(`${count} ${user._id}`); + + return await User.updateOne({_id: user._id}, {$inc: inc, $set: set, $push: push}).exec(); +} + +export default async function processUsers () { + let query = { + migration: {$ne: MIGRATION_NAME}, + 'auth.timestamps.loggedin': {$gt: new Date('2023-12-23')}, + }; + + const fields = { + _id: 1, + items: 1, + }; + + while (true) { // eslint-disable-line no-constant-condition + const users = await User // eslint-disable-line no-await-in-loop + .find(query) + .limit(250) + .sort({_id: 1}) + .select(fields) + .lean() + .exec(); + + if (users.length === 0) { + console.warn('All appropriate users found and modified.'); + console.warn(`\n${count} users processed\n`); + break; + } else { + query._id = { + $gt: users[users.length - 1], + }; + } + + await Promise.all(users.map(updateUser)); // eslint-disable-line no-await-in-loop + } +}; diff --git a/website/client/src/assets/css/sprites/spritesmith-main.css b/website/client/src/assets/css/sprites/spritesmith-main.css index ff4bbc7d57..e0085f33bb 100644 --- a/website/client/src/assets/css/sprites/spritesmith-main.css +++ b/website/client/src/assets/css/sprites/spritesmith-main.css @@ -1179,6 +1179,11 @@ width: 141px; height: 147px; } +.background_frozen_blue_pond { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_frozen_blue_pond.png'); + width: 141px; + height: 147px; +} .background_frozen_lake { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_frozen_lake.png'); width: 141px; @@ -1384,6 +1389,11 @@ width: 141px; height: 147px; } +.background_ice_bubble_lake { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_ice_bubble_lake.png'); + width: 141px; + height: 147px; +} .background_ice_cave { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_ice_cave.png'); width: 141px; @@ -2269,6 +2279,11 @@ width: 141px; height: 147px; } +.background_winter_mountain_range { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_winter_mountain_range.png'); + width: 141px; + height: 147px; +} .background_winter_night { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_winter_night.png'); width: 141px; @@ -2985,6 +3000,11 @@ width: 68px; height: 68px; } +.icon_background_frozen_blue_pond { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_frozen_blue_pond.png'); + width: 68px; + height: 68px; +} .icon_background_frozen_lake { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_frozen_lake.png'); width: 68px; @@ -3190,6 +3210,11 @@ width: 68px; height: 68px; } +.icon_background_ice_bubble_lake { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_ice_bubble_lake.png'); + width: 68px; + height: 68px; +} .icon_background_ice_cave { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_ice_cave.png'); width: 68px; @@ -4080,6 +4105,11 @@ width: 68px; height: 68px; } +.icon_background_winter_mountain_range { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_winter_mountain_range.png'); + width: 68px; + height: 68px; +} .icon_background_winter_night { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_winter_night.png'); width: 68px; @@ -19020,6 +19050,16 @@ width: 90px; height: 90px; } +.broad_armor_armoire_schoolUniformPants { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/broad_armor_armoire_schoolUniformPants.png'); + width: 114px; + height: 90px; +} +.broad_armor_armoire_schoolUniformSkirt { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/broad_armor_armoire_schoolUniformSkirt.png'); + width: 114px; + height: 90px; +} .broad_armor_armoire_scribesRobe { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/broad_armor_armoire_scribesRobe.png'); width: 114px; @@ -19975,6 +20015,11 @@ width: 114px; height: 90px; } +.shield_armoire_trustyPencil { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shield_armoire_trustyPencil.png'); + width: 114px; + height: 90px; +} .shield_armoire_trustyUmbrella { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shield_armoire_trustyUmbrella.png'); width: 114px; @@ -20360,6 +20405,16 @@ width: 68px; height: 68px; } +.shop_armor_armoire_schoolUniformPants { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_armor_armoire_schoolUniformPants.png'); + width: 68px; + height: 68px; +} +.shop_armor_armoire_schoolUniformSkirt { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_armor_armoire_schoolUniformSkirt.png'); + width: 68px; + height: 68px; +} .shop_armor_armoire_scribesRobe { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_armor_armoire_scribesRobe.png'); width: 68px; @@ -21375,6 +21430,11 @@ width: 68px; height: 68px; } +.shop_shield_armoire_trustyPencil { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_shield_armoire_trustyPencil.png'); + width: 68px; + height: 68px; +} .shop_shield_armoire_trustyUmbrella { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_shield_armoire_trustyUmbrella.png'); width: 68px; @@ -21820,6 +21880,11 @@ width: 68px; height: 68px; } +.shop_weapon_armoire_scholarlyTextbooks { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_weapon_armoire_scholarlyTextbooks.png'); + width: 68px; + height: 68px; +} .shop_weapon_armoire_shadowMastersMace { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_weapon_armoire_shadowMastersMace.png'); width: 68px; @@ -22245,6 +22310,16 @@ width: 90px; height: 90px; } +.slim_armor_armoire_schoolUniformPants { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/slim_armor_armoire_schoolUniformPants.png'); + width: 114px; + height: 90px; +} +.slim_armor_armoire_schoolUniformSkirt { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/slim_armor_armoire_schoolUniformSkirt.png'); + width: 114px; + height: 90px; +} .slim_armor_armoire_scribesRobe { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/slim_armor_armoire_scribesRobe.png'); width: 114px; @@ -22785,6 +22860,11 @@ width: 114px; height: 90px; } +.weapon_armoire_scholarlyTextbooks { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/weapon_armoire_scholarlyTextbooks.png'); + width: 114px; + height: 90px; +} .weapon_armoire_shadowMastersMace { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/weapon_armoire_shadowMastersMace.png'); width: 114px; @@ -23655,6 +23735,11 @@ width: 114px; height: 90px; } +.broad_armor_special_birthday2024 { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/broad_armor_special_birthday2024.png'); + width: 114px; + height: 90px; +} .eyewear_special_anniversary { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/eyewear_special_anniversary.png'); width: 90px; @@ -23710,6 +23795,11 @@ width: 68px; height: 68px; } +.shop_armor_special_birthday2024 { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_armor_special_birthday2024.png'); + width: 68px; + height: 68px; +} .shop_back_special_anniversary { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_back_special_anniversary.png'); width: 68px; @@ -23775,6 +23865,11 @@ width: 114px; height: 90px; } +.slim_armor_special_birthday2024 { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/slim_armor_special_birthday2024.png'); + width: 114px; + height: 90px; +} .broad_armor_special_fall2015Healer { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/broad_armor_special_fall2015Healer.png'); width: 93px; @@ -28895,6 +28990,41 @@ width: 68px; height: 68px; } +.back_mystery_202401 { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/back_mystery_202401.png'); + width: 117px; + height: 120px; +} +.broad_armor_mystery_202401 { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/broad_armor_mystery_202401.png'); + width: 117px; + height: 120px; +} +.shop_armor_mystery_202401 { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_armor_mystery_202401.png'); + width: 68px; + height: 68px; +} +.shop_back_mystery_202401 { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_back_mystery_202401.png'); + width: 68px; + height: 68px; +} +.shop_set_mystery_202401 { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_set_mystery_202401.png'); + width: 68px; + height: 68px; +} +.shop_weapon_armoire_scholarlyTextbooks { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_weapon_armoire_scholarlyTextbooks.png'); + width: 68px; + height: 68px; +} +.slim_armor_mystery_202401 { + background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/slim_armor_mystery_202401.png'); + width: 117px; + height: 120px; +} .broad_armor_mystery_301404 { background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/broad_armor_mystery_301404.png'); width: 90px; diff --git a/website/client/src/components/creatorIntro.vue b/website/client/src/components/creatorIntro.vue index 0e49b81e80..c0a96681ca 100644 --- a/website/client/src/components/creatorIntro.vue +++ b/website/client/src/components/creatorIntro.vue @@ -121,7 +121,7 @@ v-if="editing" class="menu-container col-2" :class="{active: activeTopPage === 'backgrounds'}" - @click="changeTopPage('backgrounds', '2023')" + @click="changeTopPage('backgrounds', '2024')" >