diff --git a/public/assets/honkai3rd/rank-icons/a-rank.png b/public/assets/honkai3rd/rank-icons/a-rank.png new file mode 100644 index 00000000..4a2bd03e Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/a-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/b-rank.png b/public/assets/honkai3rd/rank-icons/b-rank.png new file mode 100644 index 00000000..236a9c19 Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/b-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/s-rank.png b/public/assets/honkai3rd/rank-icons/s-rank.png new file mode 100644 index 00000000..9878fe02 Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/s-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/s1-rank.png b/public/assets/honkai3rd/rank-icons/s1-rank.png new file mode 100644 index 00000000..bd05f975 Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/s1-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/s2-rank.png b/public/assets/honkai3rd/rank-icons/s2-rank.png new file mode 100644 index 00000000..08e1f9ff Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/s2-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/s3-rank.png b/public/assets/honkai3rd/rank-icons/s3-rank.png new file mode 100644 index 00000000..8232bc4b Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/s3-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/ss-rank.png b/public/assets/honkai3rd/rank-icons/ss-rank.png new file mode 100644 index 00000000..943cfa46 Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/ss-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/ss1-rank.png b/public/assets/honkai3rd/rank-icons/ss1-rank.png new file mode 100644 index 00000000..ccd9ae62 Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/ss1-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/ss2-rank.png b/public/assets/honkai3rd/rank-icons/ss2-rank.png new file mode 100644 index 00000000..576e1675 Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/ss2-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/ss3-rank.png b/public/assets/honkai3rd/rank-icons/ss3-rank.png new file mode 100644 index 00000000..65141b55 Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/ss3-rank.png differ diff --git a/public/assets/honkai3rd/rank-icons/sss-rank.png b/public/assets/honkai3rd/rank-icons/sss-rank.png new file mode 100644 index 00000000..427d4b44 Binary files /dev/null and b/public/assets/honkai3rd/rank-icons/sss-rank.png differ diff --git a/src/components/atoms/BattlesuitRankIcon.tsx b/src/components/atoms/BattlesuitRankIcon.tsx new file mode 100644 index 00000000..40dd2f62 --- /dev/null +++ b/src/components/atoms/BattlesuitRankIcon.tsx @@ -0,0 +1,42 @@ +import SquareImageBox from './SquareImageBox' + +interface BattlesuitRankIconProps { + size: number + rank: string + m?: number | string + mx?: number | string + my?: number | string + ml?: number | string + mr?: number | string + mt?: number | string + mb?: number | string +} + +const BattlesuitRankIcon = ({ + size, + rank, + m, + mx, + my, + ml, + mr, + mt, + mb, +}: BattlesuitRankIconProps) => { + return ( + + ) +} + +export default BattlesuitRankIcon diff --git a/src/components/atoms/ValkyrieLabel.tsx b/src/components/atoms/ValkyrieLabel.tsx new file mode 100644 index 00000000..bed1c024 --- /dev/null +++ b/src/components/atoms/ValkyrieLabel.tsx @@ -0,0 +1,54 @@ +import { Text } from '@theme-ui/components' + +interface ValkyrieLabelProps { + valkyrie: string +} + +const ValkyrieLabel = ({ valkyrie }: ValkyrieLabelProps) => { + const { label } = getLabelData(valkyrie) + return {label} +} + +export default ValkyrieLabel + +function getLabelData(valkyrie: string): { label: string; icon?: string } { + switch (valkyrie) { + case 'kiana': + return { icon: 'kiana', label: 'Kiana Kaslana' } + case 'mei': + return { icon: 'mei', label: 'Raiden Mei' } + case 'bronya': + return { icon: 'bronya', label: 'Bronya Zaychik' } + case 'himeko': + return { icon: 'himeko', label: 'Murata Himeko' } + case 'theresa': + return { icon: 'theresa', label: 'Theresa Apocalypse' } + case 'fuhua': + return { icon: 'fuhua', label: 'Fu Hua' } + case 'rita': + return { icon: 'rita', label: 'Rita Rossweisse' } + case 'sakura': + return { icon: 'sakura', label: 'Yae Sakura' } + case 'kallen': + return { icon: 'kallen', label: 'Kallen Kaslana' } + case 'olenyevas': + return { icon: 'olenyevas', label: 'Olenyevas Sisters' } + case 'seele': + return { icon: 'seele', label: 'Seele Vollerei' } + case 'durandal': + return { icon: 'durandal', label: 'Durandal' } + case 'fischl': + return { icon: 'fischl', label: 'Fischl' } + case 'elysia': + return { icon: 'elysia', label: 'Elysia' } + case 'mobius': + return { icon: 'mobius', label: 'Mobius' } + case 'raven': + return { icon: 'raven', label: 'Raven' } + case 'carole': + return { icon: 'carole', label: 'Carole Pepper' } + } + return { + label: valkyrie, + } +} diff --git a/src/lib/safeData.ts b/src/lib/safeData.ts new file mode 100644 index 00000000..a4c10fe2 --- /dev/null +++ b/src/lib/safeData.ts @@ -0,0 +1,20 @@ +export const battlesuitStrengths = [ + { value: 'physical', label: 'Physical' }, + { value: 'fire dmg', label: 'Fire DMG' }, + { value: 'ice dmg', label: 'Ice DMG' }, + { value: 'lightning dmg', label: 'Lightning DMG' }, + { value: 'freeze', label: 'Freeze' }, + { value: 'paralyze', label: 'Paralyze' }, + { value: 'stun', label: 'Stun' }, + { value: 'ignite', label: 'Ignite' }, + { value: 'bleed', label: 'Bleed' }, + { value: 'heavy atk', label: 'Heavy ATK' }, + { value: 'weaken', label: 'Weaken' }, + { value: 'impair', label: 'Impair' }, + { value: 'time mastery', label: 'Time Mastery' }, + { value: 'gather', label: 'Gather' }, + { value: 'heal', label: 'Heal' }, + { value: 'fast atk', label: 'Fast ATK' }, + { value: 'burst', label: 'Burst' }, + { value: 'aerial', label: 'Aerial' }, +] diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index bb393da0..12bba9b1 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -46,14 +46,17 @@ export const theme: Theme = { ], fontWeights: { body: 400, - heading: 500, + heading: 600, bold: 700, light: 300, normal: 400, display: 300, }, + borders: { + default: `1px solid ${colors.gray[5]}`, + }, lineHeights: { - body: 1.5, + body: 1.6, heading: 1.2, }, sizes: { diff --git a/src/pages/honkai3rd/battlesuits/[battlesuitId].tsx b/src/pages/honkai3rd/battlesuits/[battlesuitId].tsx index c4a9396a..b140c278 100644 --- a/src/pages/honkai3rd/battlesuits/[battlesuitId].tsx +++ b/src/pages/honkai3rd/battlesuits/[battlesuitId].tsx @@ -1,14 +1,18 @@ -import { Box, Heading, Paragraph } from '@theme-ui/components' +import { Box, Flex, Heading, Paragraph, Text } from '@theme-ui/components' import { NextPageContext } from 'next' import Image from 'next/image' import React from 'react' +import BattlesuitRankIcon from '../../../components/atoms/BattlesuitRankIcon' +import ValkyrieLabel from '../../../components/atoms/ValkyrieLabel' import Breadcrumb from '../../../components/organisms/Breadcrumb' import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator' import { BattlesuitData, + BattlesuitSkillGroup, getBattlesuitById, listBattlesuits, } from '../../../data/honkai3rd/battlesuits' +import { battlesuitStrengths } from '../../../lib/safeData' interface BattlesuitShowPageProps { battlesuit: BattlesuitData @@ -33,184 +37,89 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => { {battlesuit.name} - - - {battlesuit.name} + + + + {battlesuit.name} + + + + + + + + + {battlesuit.type.replace(/^\w/, (c) => c.toUpperCase())} + + {battlesuit.strengths.map((strength) => { + const strengthData = battlesuitStrengths.find( + (aStrength) => aStrength.value === strength + ) + return ( + + {strengthData != null ? strengthData.label : strength} + + ) + })} - - Leader - - - {battlesuit.leader.core.name} - {battlesuit.leader.core.description} - {battlesuit.leader.subskills.map((subskill, index) => { - return ( - - - {subskill.name} - {subskill.requiredRank != null - ? ` (${subskill.requiredRank})` - : ''} - -

{subskill.description}

-
- ) - })} -
-
-
- - Passive - - - {battlesuit.passive.core.name} - {battlesuit.passive.core.description} - {battlesuit.passive.subskills.map((subskill, index) => { - return ( - - - {subskill.name} - {subskill.requiredRank != null - ? ` (${subskill.requiredRank})` - : ''} - -

{subskill.description}

-
- ) - })} -
-
-
- - Evasion - - - {battlesuit.evasion.core.name} - {battlesuit.evasion.core.description} - {battlesuit.evasion.subskills.map((subskill, index) => { - return ( - - - {subskill.name} - {subskill.requiredRank != null - ? ` (${subskill.requiredRank})` - : ''} - -

{subskill.description}

-
- ) - })} -
-
-
- - Special Attack - - - {battlesuit.special.core.name} - {battlesuit.special.core.description} - {battlesuit.special.subskills.map((subskill, index) => { - return ( - - - {subskill.name} - {subskill.requiredRank != null - ? ` (${subskill.requiredRank})` - : ''} - -

{subskill.description}

-
- ) - })} -
-
-
+ - - Ultimate - - - {battlesuit.ultimate.core.name} - {battlesuit.ultimate.core.description} - {battlesuit.ultimate.subskills.map((subskill, index) => { - return ( - - - {subskill.name} - {subskill.requiredRank != null - ? ` (${subskill.requiredRank})` - : ''} - -

{subskill.description}

-
- ) - })} -
-
-
+ - - Basic Attack - - - {battlesuit.basic.core.name} - {battlesuit.basic.core.description} - {battlesuit.basic.subskills.map((subskill, index) => { - return ( - - - {subskill.name} - {subskill.requiredRank != null - ? ` (${subskill.requiredRank})` - : ''} - -

{subskill.description}

-
- ) - })} -
-
-
+ + + + + + + {battlesuit.sp != null && ( - - SP Skill - - - {battlesuit.sp.core.name} - {battlesuit.sp.core.description} - {battlesuit.sp.subskills.map((subskill, index) => { - return ( - - - {subskill.name} - {subskill.requiredRank != null - ? ` (${subskill.requiredRank})` - : ''} - -

{subskill.description}

-
- ) - })} -
-
-
+ )}
@@ -238,3 +147,78 @@ export async function getStaticPaths() { fallback: false, } } + +interface BattlesuitSkillGroupCardProps { + heading: string + skillGroup: BattlesuitSkillGroup +} + +const BattlesuitSkillGroupCard = ({ + heading, + skillGroup, +}: BattlesuitSkillGroupCardProps) => { + return ( + + + {skillGroup.core.name} +
+ + {heading} + +
+ + {skillGroup.core.description} + + {skillGroup.subskills.map((subskill) => { + return ( + + + + {subskill.name} + {subskill.requiredRank != null ? ( + /^[0-9]/.test(subskill.requiredRank) ? ( + + ⭐{subskill.requiredRank.slice(0, 1)} + + ) : ( + + ) + ) : ( + + )} + + + + {subskill.description} + + + ) + })} +
+ ) +} diff --git a/src/pages/honkai3rd/battlesuits/index.tsx b/src/pages/honkai3rd/battlesuits/index.tsx index 34141c48..7a48d1bf 100644 --- a/src/pages/honkai3rd/battlesuits/index.tsx +++ b/src/pages/honkai3rd/battlesuits/index.tsx @@ -10,6 +10,7 @@ import { BattlesuitData, listBattlesuits, } from '../../../data/honkai3rd/battlesuits' +import { battlesuitStrengths } from '../../../lib/safeData' type BattlesuitListItemData = Pick< BattlesuitData, @@ -22,24 +23,7 @@ interface BattlesuitListPageProps { const featureFilterOptions = [ { value: 'all', label: 'All' }, - { value: 'physical', label: 'Physical' }, - { value: 'fire dmg', label: 'Fire DMG' }, - { value: 'ice dmg', label: 'Ice DMG' }, - { value: 'lightning dmg', label: 'Lightning DMG' }, - { value: 'freeze', label: 'Freeze' }, - { value: 'paralyze', label: 'Paralyze' }, - { value: 'stun', label: 'Stun' }, - { value: 'ignite', label: 'Ignite' }, - { value: 'bleed', label: 'Bleed' }, - { value: 'heavy atk', label: 'Heavy ATK' }, - { value: 'weaken', label: 'Weaken' }, - { value: 'impair', label: 'Impair' }, - { value: 'time mastery', label: 'Time Mastery' }, - { value: 'gather', label: 'Gather' }, - { value: 'heal', label: 'Heal' }, - { value: 'fast atk', label: 'Fast ATK' }, - { value: 'burst', label: 'Burst' }, - { value: 'aerial', label: 'Aerial' }, + ...battlesuitStrengths, ] const valkyrieFilterOptions = [