diff --git a/assets/honkai3rd/weapon-icons/weapon-bow.png b/assets/honkai3rd/weapon-icons/weapon-bow.png new file mode 100644 index 00000000..8ee88ac8 Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-bow.png differ diff --git a/assets/honkai3rd/weapon-icons/weapon-cannon.png b/assets/honkai3rd/weapon-icons/weapon-cannon.png new file mode 100644 index 00000000..e4b8e5a9 Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-cannon.png differ diff --git a/assets/honkai3rd/weapon-icons/weapon-chakram.png b/assets/honkai3rd/weapon-icons/weapon-chakram.png new file mode 100644 index 00000000..65f444c3 Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-chakram.png differ diff --git a/assets/honkai3rd/weapon-icons/weapon-claymore.png b/assets/honkai3rd/weapon-icons/weapon-claymore.png new file mode 100644 index 00000000..972a5ad0 Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-claymore.png differ diff --git a/assets/honkai3rd/weapon-icons/weapon-cross.png b/assets/honkai3rd/weapon-icons/weapon-cross.png new file mode 100644 index 00000000..1c213212 Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-cross.png differ diff --git a/assets/honkai3rd/weapon-icons/weapon-gauntlet.png b/assets/honkai3rd/weapon-icons/weapon-gauntlet.png new file mode 100644 index 00000000..27ce09d1 Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-gauntlet.png differ diff --git a/assets/honkai3rd/weapon-icons/weapon-katana.png b/assets/honkai3rd/weapon-icons/weapon-katana.png new file mode 100644 index 00000000..257a4308 Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-katana.png differ diff --git a/assets/honkai3rd/weapon-icons/weapon-lance.png b/assets/honkai3rd/weapon-icons/weapon-lance.png new file mode 100644 index 00000000..4723132f Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-lance.png differ diff --git a/assets/honkai3rd/weapon-icons/weapon-pistol.png b/assets/honkai3rd/weapon-icons/weapon-pistol.png new file mode 100644 index 00000000..0b472266 Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-pistol.png differ diff --git a/assets/honkai3rd/weapon-icons/weapon-scythe.png b/assets/honkai3rd/weapon-icons/weapon-scythe.png new file mode 100644 index 00000000..ceda90f1 Binary files /dev/null and b/assets/honkai3rd/weapon-icons/weapon-scythe.png differ diff --git a/src/lib/honkai3rd/weapons.ts b/src/lib/honkai3rd/weapons.ts index d976ffc5..3f018c32 100644 --- a/src/lib/honkai3rd/weapons.ts +++ b/src/lib/honkai3rd/weapons.ts @@ -33,3 +33,66 @@ export interface WeaponData { originalWeapons?: string[] sources?: SourceData[] } + +export const weaponCategories = [ + { + value: 'pistol', + label: 'Pistols', + krLabel: '쌍권총', + icon: 'weapon-icons/weapon-pistol', + }, + { + value: 'katana', + label: 'Katanas', + krLabel: '태도', + icon: 'weapon-icons/weapon-katana', + }, + { + value: 'cannon', + label: 'Cannons', + krLabel: '대포', + icon: 'weapon-icons/weapon-cannon', + }, + { + value: 'greatsword', + label: 'Greatswords', + krLabel: '대검', + icon: 'weapon-icons/weapon-claymore', + }, + { + value: 'cross', + label: 'Crosses', + krLabel: '십자가', + icon: 'weapon-icons/weapon-cross', + }, + { + value: 'gauntlet', + label: 'Gauntlets', + krLabel: '건틀릿', + icon: 'weapon-icons/weapon-gauntlet', + }, + { + value: 'scythe', + label: 'Scythes', + krLabel: '낫', + icon: 'weapon-icons/weapon-scythe', + }, + { + value: 'lance', + label: 'Lances', + krLabel: '랜스', + icon: 'weapon-icons/weapon-lance', + }, + { + value: 'bow', + label: 'Bows', + krLabel: '활', + icon: 'weapon-icons/weapon-bow', + }, + { + value: 'chakram', + label: 'Chakram', + krLabel: '차크람', + icon: 'weapon-icons/weapon-chakram', + }, +] diff --git a/src/pages/honkai3rd/prints/weapons/[weaponId].tsx b/src/pages/honkai3rd/prints/weapons/[weaponId].tsx index b1c932fa..a0d90893 100644 --- a/src/pages/honkai3rd/prints/weapons/[weaponId].tsx +++ b/src/pages/honkai3rd/prints/weapons/[weaponId].tsx @@ -1,8 +1,8 @@ /** @jsxImportSource theme-ui */ -import { Box, Card, Heading, Paragraph } from '@theme-ui/components' +import { Flex, Box, Card, Heading, Paragraph } from '@theme-ui/components' import { NextPageContext } from 'next' import SquareImageBox from '../../../../components/atoms/SquareImageBox' -import { WeaponData } from '../../../../lib/honkai3rd/weapons' +import { weaponCategories, WeaponData } from '../../../../lib/honkai3rd/weapons' import { generateI18NPaths, getI18NProps } from '../../../../server/i18n' import { getWeaponById, @@ -30,7 +30,10 @@ const WeaponShowPage = ({ }: WeaponShowPageProps) => { const { t } = useTranslation() - const weaponCategory = t(`weapons-show.${weapon.category}`) + const weaponCategoryName = t(`weapons-show.${weapon.category}`) + const weaponCategory = weaponCategories.find( + (category) => category.value === weapon.category + ) return ( @@ -52,7 +55,17 @@ const WeaponShowPage = ({ query: { filter: weapon.category }, }} > - {weaponCategory} + + {weaponCategory != null && ( + + )} + {weaponCategoryName} + diff --git a/src/pages/honkai3rd/weapons/[weaponId].tsx b/src/pages/honkai3rd/weapons/[weaponId].tsx index f6173f86..a4be9373 100644 --- a/src/pages/honkai3rd/weapons/[weaponId].tsx +++ b/src/pages/honkai3rd/weapons/[weaponId].tsx @@ -1,9 +1,9 @@ /** @jsxImportSource theme-ui */ -import { Box, Card, Heading, Paragraph } from '@theme-ui/components' +import { Flex, Box, Card, Heading, Paragraph } from '@theme-ui/components' import { NextPageContext } from 'next' import SquareImageBox from '../../../components/atoms/SquareImageBox' import Breadcrumb from '../../../components/organisms/Breadcrumb' -import { WeaponData } from '../../../lib/honkai3rd/weapons' +import { weaponCategories, WeaponData } from '../../../lib/honkai3rd/weapons' import { generateI18NPaths, getI18NProps } from '../../../server/i18n' import { getWeaponById, @@ -33,7 +33,10 @@ const WeaponShowPage = ({ }: WeaponShowPageProps) => { const { t } = useTranslation() - const weaponCategory = t(`weapons-show.${weapon.category}`) + const weaponCategoryName = t(`weapons-show.${weapon.category}`) + const weaponCategory = weaponCategories.find( + (category) => category.value === weapon.category + ) return ( @@ -43,7 +46,7 @@ const WeaponShowPage = ({ )}`} description={`${t('common.honkai-3rd')} ${t( 'weapons-show.weapon' - )} / ${'⭐'.repeat(weapon.rarity)} / ${weaponCategory} / ATK : ${ + )} / ${'⭐'.repeat(weapon.rarity)} / ${weaponCategoryName} / ATK : ${ weapon.atk } / CRT : ${weapon.crt}`} /> @@ -75,10 +78,20 @@ const WeaponShowPage = ({ - {weaponCategory} + + {weaponCategory != null && ( + + )} + {weaponCategoryName} + diff --git a/src/pages/honkai3rd/weapons/index.tsx b/src/pages/honkai3rd/weapons/index.tsx index f3fd0f40..4c930d94 100644 --- a/src/pages/honkai3rd/weapons/index.tsx +++ b/src/pages/honkai3rd/weapons/index.tsx @@ -6,7 +6,7 @@ import { pick } from 'ramda' import { useMemo } from 'react' import FilterButton from '../../../components/atoms/FilterButton' import { useRouter } from 'next/router' -import { WeaponData } from '../../../lib/honkai3rd/weapons' +import { weaponCategories, WeaponData } from '../../../lib/honkai3rd/weapons' import WeaponCard from '../../../components/molecules/WeaponCard' import { getI18NProps } from '../../../server/i18n' import { NextPageContext } from 'next' @@ -24,17 +24,8 @@ interface WeaponListPageProps { } const weaponFilterOptions = [ - { value: 'all', label: 'All', krLabel: '전체' }, - { value: 'pistol', label: 'Pistols', krLabel: '쌍권총' }, - { value: 'katana', label: 'Katanas', krLabel: '태도' }, - { value: 'cannon', label: 'Cannons', krLabel: '대포' }, - { value: 'greatsword', label: 'Greatswords', krLabel: '대검' }, - { value: 'cross', label: 'Crosses', krLabel: '십자가' }, - { value: 'gauntlet', label: 'Gauntlets', krLabel: '건틀릿' }, - { value: 'scythe', label: 'Scythes', krLabel: '낫' }, - { value: 'lance', label: 'Lances', krLabel: '랜스' }, - { value: 'bow', label: 'Bows', krLabel: '활' }, - { value: 'chakram', label: 'Chakram', krLabel: '차크람' }, + { value: 'all', label: 'All', krLabel: '전체', icon: undefined }, + ...weaponCategories, ] const WeaponListPage = ({ weaponDataList }: WeaponListPageProps) => { @@ -80,12 +71,13 @@ const WeaponListPage = ({ weaponDataList }: WeaponListPageProps) => { {t('weapons-list.filter-by-category')} - {weaponFilterOptions.map(({ value, label, krLabel }) => { + {weaponFilterOptions.map(({ value, label, krLabel, icon }) => { return (