Update v5.6 ER data and improve ER pages
This commit is contained in:
@@ -12,6 +12,7 @@ interface BattlesuitCardProps {
|
||||
hidden?: boolean
|
||||
size?: 'sm' | 'default'
|
||||
href?: string
|
||||
m?: number
|
||||
}
|
||||
|
||||
const BattlesuitCard = ({
|
||||
@@ -19,6 +20,7 @@ const BattlesuitCard = ({
|
||||
hidden,
|
||||
size,
|
||||
href,
|
||||
m,
|
||||
}: BattlesuitCardProps) => {
|
||||
const { locale } = useRouter()
|
||||
|
||||
@@ -37,33 +39,31 @@ const BattlesuitCard = ({
|
||||
<Card
|
||||
className={hidden ? 'hidden' : ''}
|
||||
sx={{
|
||||
width: 'fit-content',
|
||||
p: 1,
|
||||
m: 1,
|
||||
m: m == undefined ? 1 : m,
|
||||
'&.hidden': {
|
||||
display: 'none',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<PageLink href={href}>
|
||||
<Flex>
|
||||
<Flex sx={{ alignItems: 'center' }}>
|
||||
<SquareImageBox
|
||||
mr={2}
|
||||
alt={battlesuitName}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
|
||||
size={30}
|
||||
/>
|
||||
<Box
|
||||
<Text
|
||||
sx={{
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
width: '100%',
|
||||
whiteSpace: 'nowrap',
|
||||
textAlign: 'center',
|
||||
}}
|
||||
>
|
||||
<Text sx={{ lineHeight: '30px' }}>{battlesuitName}</Text>
|
||||
</Box>
|
||||
{battlesuitName}
|
||||
</Text>
|
||||
</Flex>
|
||||
</PageLink>
|
||||
</Card>
|
||||
@@ -76,7 +76,7 @@ const BattlesuitCard = ({
|
||||
sx={{
|
||||
width: 120,
|
||||
padding: 2,
|
||||
margin: 2,
|
||||
m: m == undefined ? 2 : m,
|
||||
'&.hidden': {
|
||||
display: 'none',
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Card, Box, Paragraph, Heading, Flex, Text } from '@theme-ui/components'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { SignetData } from '../../lib/honkai3rd/elysianRealm'
|
||||
import { parseSignetId, SignetData } from '../../lib/honkai3rd/elysianRealm'
|
||||
import SquareImageBox from '../atoms/SquareImageBox'
|
||||
|
||||
interface SignetCardProps {
|
||||
@@ -12,7 +12,8 @@ interface SignetCardProps {
|
||||
}
|
||||
|
||||
const SignetCard = ({ signet, headingLevel = 3, m = 2 }: SignetCardProps) => {
|
||||
const [signetGroupId] = signet.id.split('-')
|
||||
const [signetGroupId] = parseSignetId(signet.id)
|
||||
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<Card sx={{ mb: 2 }}>
|
||||
|
||||
@@ -124,7 +124,6 @@ const NavItem = ({ target }: NavItemProps) => {
|
||||
}}
|
||||
>
|
||||
{t(`common.${target}`)}
|
||||
{target === 'elysian-realm' ? ` (${t('common.wip')})` : ''}
|
||||
</Text>
|
||||
</NavLink>
|
||||
</NextLink>
|
||||
|
||||
@@ -7,13 +7,7 @@ import { translate } from '../../lib/i18n'
|
||||
import PageLink from '../atoms/PageLink'
|
||||
import SquareImageBox from '../atoms/SquareImageBox'
|
||||
|
||||
interface SignetGroupNavigatorProps {
|
||||
size?: 'sm' | 'default'
|
||||
}
|
||||
|
||||
const SignetGroupNavigator = ({
|
||||
size = 'default',
|
||||
}: SignetGroupNavigatorProps) => {
|
||||
const SignetGroupNavigator = () => {
|
||||
const { locale } = useRouter()
|
||||
return (
|
||||
<Flex sx={{ flexWrap: 'wrap' }}>
|
||||
@@ -23,23 +17,33 @@ const SignetGroupNavigator = ({
|
||||
{ ['ko-KR']: signet.krName },
|
||||
signet.name
|
||||
)
|
||||
const signetAltName = translate(
|
||||
locale,
|
||||
{ ['ko-KR']: signet.krAltName },
|
||||
signet.altName
|
||||
)
|
||||
return (
|
||||
<Card key={signet.id} sx={{ p: 1, m: 1 }}>
|
||||
<Card key={signet.id} sx={{ p: 1, m: 1, width: [135, 135, 200] }}>
|
||||
<PageLink href={`/honkai3rd/elysian-realm/signets/${signet.id}`}>
|
||||
<Flex
|
||||
sx={{
|
||||
flexDirection: size === 'default' ? 'column' : 'row',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<SquareImageBox
|
||||
size={size === 'default' ? 70 : 30}
|
||||
size={30}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/elysian-realm/signets/${signet.id}.png`}
|
||||
/>
|
||||
<Text
|
||||
sx={{ textAlign: 'center', ml: size === 'default' ? 0 : 1 }}
|
||||
sx={{
|
||||
ml: 2,
|
||||
overflow: 'hidden',
|
||||
width: '100%',
|
||||
whiteSpace: 'nowrap',
|
||||
textOverflow: 'ellipsis',
|
||||
}}
|
||||
>
|
||||
{signetName}
|
||||
{signetAltName}({signetName})
|
||||
</Text>
|
||||
</Flex>
|
||||
</PageLink>
|
||||
|
||||
@@ -23,6 +23,10 @@ export const erVersions = [
|
||||
version: '5.5',
|
||||
battlesuits: ['pe', 'spa'],
|
||||
},
|
||||
{
|
||||
version: '5.6',
|
||||
battlesuits: ['rc', 'fr'],
|
||||
},
|
||||
].reverse()
|
||||
|
||||
export const erBattlesuits = erVersions.reduce<string[]>((list, version) => {
|
||||
@@ -39,6 +43,9 @@ export const supportBattlesuitIds = [
|
||||
'bke',
|
||||
'ae',
|
||||
'br',
|
||||
'hb',
|
||||
'ma',
|
||||
'rc',
|
||||
]
|
||||
|
||||
export const remembranceSigilIds = [
|
||||
@@ -62,6 +69,30 @@ export const remembranceSigilIds = [
|
||||
'stained-sakura',
|
||||
'the-first-scale',
|
||||
'resolve',
|
||||
'veil-of-tears',
|
||||
'pseudo-miracle',
|
||||
'fragile-friend',
|
||||
'rainbow-of-absence',
|
||||
'feast-of-emptiness',
|
||||
'it-will-be-written',
|
||||
'dreamful-gold',
|
||||
'an-old-pal-s-legacy',
|
||||
'empty-like-shala',
|
||||
'tsukimi-himiko',
|
||||
'boundless-logos',
|
||||
'hometown',
|
||||
'proof-of-good-and-evil',
|
||||
'faraway-ship',
|
||||
'ravenous-gully',
|
||||
'grey-scale-rainbow',
|
||||
'nine-lives',
|
||||
'because-of-you',
|
||||
'boundless-feeling',
|
||||
'falling-in-past-light',
|
||||
'out-of-reach',
|
||||
'the-lonely-moon',
|
||||
'awakening',
|
||||
'key-to-the-deep',
|
||||
]
|
||||
|
||||
export interface SignetData {
|
||||
@@ -86,6 +117,8 @@ export const signetGroups = [
|
||||
id: 'elysia',
|
||||
name: 'Elysia',
|
||||
krName: '엘리시아',
|
||||
altName: '■■',
|
||||
krAltName: '■■',
|
||||
setIds: erBattlesuits.map((battlesuitId) => {
|
||||
return `elysia-${battlesuitId}`
|
||||
}),
|
||||
@@ -94,46 +127,108 @@ export const signetGroups = [
|
||||
id: 'eden',
|
||||
name: 'Eden',
|
||||
krName: '에덴',
|
||||
altName: 'Gold',
|
||||
krAltName: '황금',
|
||||
setIds: ['eden-normal', 'eden-nexus-1', 'eden-nexus-2'],
|
||||
},
|
||||
{
|
||||
id: 'hua',
|
||||
name: 'Hua',
|
||||
krName: '화',
|
||||
altName: 'Vicissitude',
|
||||
krAltName: '부생',
|
||||
setIds: ['hua-normal', 'hua-nexus-1', 'hua-nexus-2'],
|
||||
},
|
||||
{
|
||||
id: 'kalpas',
|
||||
name: 'Kalpas',
|
||||
krName: '칼파스',
|
||||
altName: 'Decimation',
|
||||
krAltName: '오멸',
|
||||
setIds: ['kalpas-normal', 'kalpas-nexus-1', 'kalpas-nexus-2'],
|
||||
},
|
||||
{
|
||||
id: 'kevin',
|
||||
name: 'Kevin',
|
||||
krName: '케빈',
|
||||
altName: 'Deliverance',
|
||||
krAltName: '구원',
|
||||
setIds: ['kevin-normal', 'kevin-nexus-1', 'kevin-nexus-2'],
|
||||
},
|
||||
{
|
||||
id: 'mobius',
|
||||
name: 'Mobius',
|
||||
krName: '뫼비우스',
|
||||
altName: 'Infinity',
|
||||
krAltName: '무한',
|
||||
setIds: ['mobius-normal', 'mobius-nexus-1', 'mobius-nexus-2'],
|
||||
},
|
||||
{
|
||||
id: 'sakura',
|
||||
name: 'Sakura',
|
||||
krName: '사쿠라',
|
||||
altName: 'Setsuna',
|
||||
krAltName: '찰나',
|
||||
setIds: ['sakura-normal', 'sakura-nexus-1', 'sakura-nexus-2'],
|
||||
},
|
||||
{
|
||||
id: 'su',
|
||||
name: 'Su',
|
||||
krName: '수',
|
||||
altName: 'Bodhi',
|
||||
krAltName: '천혜',
|
||||
setIds: ['su-normal', 'su-nexus-1', 'su-nexus-2'],
|
||||
},
|
||||
{
|
||||
id: 'pardofelis',
|
||||
name: 'Pardofelis',
|
||||
krName: '파르도 필리스',
|
||||
altName: 'Reverie',
|
||||
krAltName: '환몽',
|
||||
setIds: ['pardofelis-normal', 'pardofelis-nexus-1'],
|
||||
},
|
||||
{
|
||||
id: 'vill-v',
|
||||
name: 'Vill-V',
|
||||
krName: '빌-브이',
|
||||
altName: 'Helix',
|
||||
krAltName: '나선',
|
||||
setIds: ['vill-v-normal', 'vill-v-nexus-1'],
|
||||
},
|
||||
{
|
||||
id: 'aponia',
|
||||
name: 'Aponia',
|
||||
krName: '아포니아',
|
||||
altName: 'Discipline',
|
||||
krAltName: '계율',
|
||||
setIds: ['aponia-normal', 'aponia-nexus-1'],
|
||||
},
|
||||
{
|
||||
id: 'kosma',
|
||||
name: 'Kosma',
|
||||
krName: '코스마',
|
||||
altName: 'Daybreak',
|
||||
krAltName: '욱광',
|
||||
setIds: ['kosma-normal', 'kosma-nexus-1'],
|
||||
},
|
||||
{
|
||||
id: 'griseo',
|
||||
name: 'Griseo',
|
||||
krName: '그리세오',
|
||||
altName: 'Stars',
|
||||
krAltName: '번성',
|
||||
setIds: ['griseo-normal', 'griseo-nexus-1'],
|
||||
},
|
||||
]
|
||||
|
||||
export function parseSignetId(id: string) {
|
||||
if (id.startsWith('vill-v')) {
|
||||
return ['vill-v', ...id.split('-').slice(2)]
|
||||
}
|
||||
|
||||
return id.split('-')
|
||||
}
|
||||
|
||||
export const signetGroupMap = signetGroups.reduce((map, group) => {
|
||||
map.set(group.id, group)
|
||||
return map
|
||||
@@ -148,6 +243,7 @@ export interface SignetSet {
|
||||
export interface PopulatedSignetGroup {
|
||||
id: string
|
||||
name: string
|
||||
altName: string
|
||||
sets: SignetSet[]
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Box, Heading, Flex, Card } from '@theme-ui/components'
|
||||
import { Box, Heading, Flex, Card, Text } from '@theme-ui/components'
|
||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||
import { getBattlesuitMapByIds } from '../../../server/data/honkai3rd/battlesuits'
|
||||
import { BattlesuitData } from '../../../lib/honkai3rd/battlesuits'
|
||||
@@ -58,9 +58,7 @@ const ElysianRealmIndexPage = ({
|
||||
]}
|
||||
/>
|
||||
|
||||
<Heading as='h1'>
|
||||
{t('common.elysian-realm')} ({t('common.wip')})
|
||||
</Heading>
|
||||
<Heading as='h1'>{t('common.elysian-realm')}</Heading>
|
||||
|
||||
<Heading as='h2'>{t('common.battlesuits')}</Heading>
|
||||
|
||||
@@ -74,12 +72,17 @@ const ElysianRealmIndexPage = ({
|
||||
<Flex sx={{ flexWrap: 'wrap' }}>
|
||||
{erVersion.battlesuits.map((battlesuitId) => {
|
||||
return (
|
||||
<BattlesuitCard
|
||||
<Box
|
||||
key={battlesuitId}
|
||||
battlesuit={battlesuitMap[battlesuitId]}
|
||||
size='sm'
|
||||
href={`/honkai3rd/elysian-realm/battlesuits/${battlesuitId}`}
|
||||
/>
|
||||
sx={{ width: [135, 135, 200], m: 1 }}
|
||||
>
|
||||
<BattlesuitCard
|
||||
m={0}
|
||||
battlesuit={battlesuitMap[battlesuitId]}
|
||||
size={'sm'}
|
||||
href={`/honkai3rd/elysian-realm/battlesuits/${battlesuitId}`}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
})}
|
||||
</Flex>
|
||||
@@ -98,19 +101,16 @@ const ElysianRealmIndexPage = ({
|
||||
<Heading as='h2'>{t('elysian-realm.supports')}</Heading>
|
||||
|
||||
<Flex sx={{ flexWrap: 'wrap' }}>
|
||||
{supportBattlesuits.map(({ id, name }) => {
|
||||
{supportBattlesuits.map((battlesuit) => {
|
||||
return (
|
||||
<Card key={id} sx={{ p: 1, m: 1 }} title={name}>
|
||||
<PageLink
|
||||
href={`/honkai3rd/elysian-realm/support-battlesuits#${id}`}
|
||||
>
|
||||
<SquareImageBox
|
||||
size={70}
|
||||
alt={name}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${id}.png`}
|
||||
/>
|
||||
</PageLink>
|
||||
</Card>
|
||||
<Box key={battlesuit.id} sx={{ width: [135, 135, 200], m: 1 }}>
|
||||
<BattlesuitCard
|
||||
m={0}
|
||||
battlesuit={battlesuit}
|
||||
size={'sm'}
|
||||
href={`/honkai3rd/elysian-realm/support-battlesuits#${battlesuit.id}`}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
})}
|
||||
</Flex>
|
||||
@@ -122,14 +122,30 @@ const ElysianRealmIndexPage = ({
|
||||
<Flex sx={{ flexWrap: 'wrap' }}>
|
||||
{remembranceSigils.map(({ id, name }) => {
|
||||
return (
|
||||
<Card key={id} sx={{ p: 1, m: 1 }} title={name}>
|
||||
<Card
|
||||
key={id}
|
||||
sx={{ p: 1, m: 1, width: [135, 135, 200] }}
|
||||
title={name}
|
||||
>
|
||||
<PageLink
|
||||
href={`/honkai3rd/elysian-realm/remembrance-sigils#${id}`}
|
||||
>
|
||||
<SquareImageBox
|
||||
size={70}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/elysian-realm/remembrance-sigils/${id}.png`}
|
||||
/>
|
||||
<Flex sx={{ alignItems: 'center' }}>
|
||||
<SquareImageBox
|
||||
size={30}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/elysian-realm/remembrance-sigils/${id}.png`}
|
||||
/>
|
||||
<Text
|
||||
sx={{
|
||||
ml: 2,
|
||||
overflow: 'hidden',
|
||||
whiteSpace: 'nowrap',
|
||||
textOverflow: 'ellipsis',
|
||||
}}
|
||||
>
|
||||
{name}
|
||||
</Text>
|
||||
</Flex>
|
||||
</PageLink>
|
||||
</Card>
|
||||
)
|
||||
|
||||
@@ -53,7 +53,7 @@ const SignetShowPage = ({ signetId, signetGroup }: SignetShowPageProps) => {
|
||||
/>
|
||||
|
||||
<Box sx={{ mb: 4 }}>
|
||||
<SignetGroupNavigator size={'sm'} />
|
||||
<SignetGroupNavigator />
|
||||
</Box>
|
||||
<Heading as='h1' sx={{ mb: 4, display: 'flex', alignItems: 'center' }}>
|
||||
<SquareImageBox
|
||||
@@ -62,7 +62,7 @@ const SignetShowPage = ({ signetId, signetGroup }: SignetShowPageProps) => {
|
||||
alt={signetGroup.name}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/elysian-realm/signets/${signetGroup.id}.png`}
|
||||
/>{' '}
|
||||
{signetGroup.name} {t('elysian-realm.signets')}
|
||||
{signetGroup.altName}({signetGroup.name}) {t('elysian-realm.signets')}
|
||||
</Heading>
|
||||
|
||||
{signetGroup.sets.map((set) => {
|
||||
|
||||
@@ -76,7 +76,9 @@ const ElysianRealmIndexPage = ({
|
||||
{name} - {skillName}
|
||||
</Heading>
|
||||
<Badge variant='secondary'>Cooldown: {cooldown}s</Badge>
|
||||
<Paragraph>{description}</Paragraph>
|
||||
<Paragraph sx={{ whiteSpace: 'pre-wrap' }}>
|
||||
{description}
|
||||
</Paragraph>
|
||||
</Box>
|
||||
</Flex>
|
||||
</Card>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { readFileSync, readJsonFileSync } from '../fs'
|
||||
import {
|
||||
parseSignetId,
|
||||
PopulatedSignetGroup,
|
||||
RemembranceSigil,
|
||||
remembranceSigilIds,
|
||||
@@ -19,6 +20,7 @@ const signetGroupMap = signetGroups.reduce<{
|
||||
populatedGroup = {
|
||||
id: group.id,
|
||||
name: group.name,
|
||||
altName: group.altName,
|
||||
sets: [],
|
||||
}
|
||||
}
|
||||
@@ -28,7 +30,7 @@ const signetGroupMap = signetGroups.reduce<{
|
||||
`honkai3rd/elysianRealm/signets/${setId}.md`
|
||||
).toString()
|
||||
|
||||
const [, setType, setIndex] = setId.split('-')
|
||||
const [, setType, setIndex] = parseSignetId(setId)
|
||||
|
||||
const name =
|
||||
group.id === 'elysia'
|
||||
@@ -65,6 +67,7 @@ const krSignetGroupMap = signetGroups.reduce<{
|
||||
populatedGroup = {
|
||||
id: group.id,
|
||||
name: group.krName,
|
||||
altName: group.krAltName,
|
||||
sets: [],
|
||||
}
|
||||
}
|
||||
@@ -74,7 +77,7 @@ const krSignetGroupMap = signetGroups.reduce<{
|
||||
`honkai3rd/ko-KR/elysianRealm/signets/${setId}.md`
|
||||
).toString()
|
||||
|
||||
const [, setType, setIndex] = setId.split('-')
|
||||
const [, setType, setIndex] = parseSignetId(setId)
|
||||
|
||||
const name =
|
||||
group.id === 'elysia'
|
||||
|
||||
Reference in New Issue
Block a user