Add boss table

This commit is contained in:
Sakura Knoll
2022-07-21 11:15:33 +09:00 Unverified
parent b4d3e39f83
commit f536718260
53 changed files with 302 additions and 45 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

+82
View File
@@ -11,6 +11,18 @@
- vill-v-pri-weapon - vill-v-pri-weapon
- vill-v-weapon - vill-v-weapon
description: '' description: ''
superstring:
- - label: qua
boss: qc
- label: img
boss: ofg
ma:
- - label: sss
boss: kosma
- label: sss
boss: jizo-sss
- label: ss
boss: hpt
supplyEvents: [] supplyEvents: []
- previousVersion: '5.7' - previousVersion: '5.7'
version: '5.8' version: '5.8'
@@ -26,6 +38,68 @@
- griseo-pri-weapon - griseo-pri-weapon
- griseo-weapon - griseo-weapon
description: '' description: ''
superstring:
- - label: physical
boss: jizo
- label: paralyze
boss: jk
- - label: type
boss: hos
- label: img
boss: hod
- - label: lightning
boss: bke
- label: bleed
boss: nk
- - label: lightning
boss: rpc
- label: lightning (paralyze)
boss: husk
- - label: ice
boss: mpe
- label: lightning (hit count)
boss: husk2
- - label: type
boss: wolf
- label: type
boss: hdl
ma:
- - label: sss
boss: hod
- label: ss
boss: hov
- label: ss
boss: homu
- - label: sss
boss: bke-sss
- label: ss
boss: hpt
- label: ss
boss: hdl
- - label: sss
boss: ofg
- label: ss
boss: dj
- label: ss
boss: hm
- - label: sss
boss: hod
- label: ss
boss: kasumi
- label: ss
boss: ana
- - label: sss
boss: bke-sss
- label: ss
boss: hm
- label: ss
boss: ask
- - label: sss
boss: ofg
- label: ss
boss: dd
- label: ss
boss: bns
supplyEvents: supplyEvents:
- name: Nue of the Shadow Supply B - name: Nue of the Shadow Supply B
duration: duration:
@@ -628,6 +702,8 @@
- lost-conviction - lost-conviction
- echo-of-paradise - echo-of-paradise
description: '' description: ''
superstring: []
ma: []
supplyEvents: supplyEvents:
- name: Key of Reason Focused Supply B - name: Key of Reason Focused Supply B
duration: duration:
@@ -1342,6 +1418,8 @@
- gilded-librae - gilded-librae
- cerulean-flare - cerulean-flare
description: '' description: ''
superstring: []
ma: []
supplyEvents: supplyEvents:
- name: Nue of the Shadow Focused Supply B - name: Nue of the Shadow Focused Supply B
duration: duration:
@@ -2315,6 +2393,8 @@
- astral-divide-pisces - astral-divide-pisces
- astral-rend-white-dwarf - astral-rend-white-dwarf
description: '' description: ''
superstring: []
ma: []
supplyEvents: supplyEvents:
- name: Skaldi Ondurgud Supply B - name: Skaldi Ondurgud Supply B
duration: duration:
@@ -3793,6 +3873,8 @@
- falcon-flare-0019 - falcon-flare-0019
- falcon-flare-final - falcon-flare-final
description: '' description: ''
superstring: []
ma: []
supplyEvents: supplyEvents:
- name: Eos Gloria Focused Supply B - name: Eos Gloria Focused Supply B
duration: duration:
+164
View File
@@ -0,0 +1,164 @@
import { addDays } from 'date-fns'
import { Box, Flex, Image, Text } from 'theme-ui'
import { assetsBucketBaseUrl } from '../../lib/consts'
import { VersionData } from '../../lib/honkai3rd/versions'
interface BossTableProps {
versionData: VersionData
today: Date | null
}
const BossTable = ({ versionData, today }: BossTableProps) => {
const versionStartDate = new Date(versionData.duration[0])
return (
<Flex>
<Box
sx={{
borderLeft: 'default',
borderTop: 'default',
}}
>
<Box
sx={{
fontWeight: 700,
borderRight: 'default',
px: 2,
borderBottom: 'default',
}}
>
Super String
</Box>
{versionData.superstring.map(([first, second], index) => {
const firstDuration = [
addDays(versionStartDate, index * 7),
addDays(versionStartDate, index * 7 + 2),
]
const secondDuration = [
addDays(versionStartDate, index * 7 + 3),
addDays(versionStartDate, index * 7 + 6),
]
return (
<Flex key={`superstring-${index}`} sx={{ borderBottom: 'default' }}>
<Box sx={{ borderRight: 'default' }}>
<BossCard
boss={first.boss}
label={first.label}
active={
today != null &&
today >= firstDuration[0] &&
today <= firstDuration[1]
}
/>
</Box>
<Box sx={{ borderRight: 'default' }}>
<BossCard
boss={second.boss}
label={second.label}
active={
today != null &&
today >= secondDuration[0] &&
today <= secondDuration[1]
}
/>
</Box>
</Flex>
)
})}
</Box>
<Box sx={{ borderTop: 'default' }}>
<Box
sx={{
fontWeight: 700,
px: 2,
borderRight: 'default',
borderBottom: 'default',
}}
>
Memorial Arena
</Box>
{versionData.ma.map(([first, second, third], index) => {
const durations = [
addDays(versionStartDate, index * 7 + 3),
addDays(versionStartDate, (index + 1) * 7 + 2),
]
const active =
today != null && today >= durations[0] && today <= durations[1]
return (
<Flex key={`superstring-${index}`} sx={{ borderBottom: 'default' }}>
<Box sx={{ borderRight: 'default' }}>
<BossCard
boss={first.boss}
label={first.label}
active={active}
/>
</Box>
<Box sx={{ borderRight: 'default' }}>
<BossCard
boss={second.boss}
label={second.label}
active={active}
/>
</Box>
<Box sx={{ borderRight: 'default' }}>
<BossCard
boss={third.boss}
label={third.label}
active={active}
/>
</Box>
</Flex>
)
})}
</Box>
</Flex>
)
}
const BossCard = ({
label,
boss,
active,
}: {
label?: string
boss: string
active?: boolean
}) => {
return (
<Box
sx={{ position: 'relative', '&.active': { bg: 'primary' } }}
className={active ? 'active' : ''}
>
{label != null && (
<Flex
sx={{
background: 'rgba(0,0,0,0.7)',
position: 'absolute',
bottom: 0,
width: '100%',
}}
>
<Text
sx={{
lineHeight: '10px',
fontWeight: 700,
py: 0,
px: 1,
fontSize: '10px',
color: 'white',
}}
>
{label?.toUpperCase()}
</Text>
</Flex>
)}
<Image
width={140}
alt={boss}
src={`${assetsBucketBaseUrl}/honkai3rd/bosses/${boss}.png`}
/>
</Box>
)
}
export default BossTable
+10 -8
View File
@@ -21,7 +21,7 @@ export interface GanttChartItem {
interface GanttChartProps { interface GanttChartProps {
startDate: string startDate: string
endDate: string endDate: string
today: string today: Date | null
items: GanttChartItem[] items: GanttChartItem[]
} }
@@ -33,14 +33,14 @@ const itemHeight = 30
const GanttChart = ({ const GanttChart = ({
startDate: startDateString, startDate: startDateString,
endDate: endDateString, endDate: endDateString,
today: todayDateString, today,
items, items,
}: GanttChartProps) => { }: GanttChartProps) => {
const startDate = new Date(startDateString) const startDate = new Date(startDateString)
const endDate = new Date(endDateString) const endDate = new Date(endDateString)
const firstDateToRender = startDate const firstDateToRender = startDate
const lastDateToRender = endDate const lastDateToRender = endDate
const todayDate = new Date(todayDateString) const todayDate = today
const daysToRender = differenceInCalendarDays( const daysToRender = differenceInCalendarDays(
lastDateToRender, lastDateToRender,
@@ -103,11 +103,13 @@ const GanttChart = ({
) )
}, daysToRender + 2)} }, daysToRender + 2)}
<TodayBox {todayDate != null && (
totalRow={totalRow} <TodayBox
todayDate={todayDate} totalRow={totalRow}
firstDateToRender={firstDateToRender} todayDate={todayDate}
/> firstDateToRender={firstDateToRender}
/>
)}
<Box <Box
sx={{ sx={{
+9
View File
@@ -8,6 +8,15 @@ export interface VersionData {
newWeapons: string[] newWeapons: string[]
description: string description: string
supplyEvents: SupplyEventData[] supplyEvents: SupplyEventData[]
superstring: [
{ label: string; boss: string },
{ label: string; boss: string }
][]
ma: [
{ label: string; boss: string },
{ label: string; boss: string },
{ label: string; boss: string }
][]
} }
export interface SupplyEventData { export interface SupplyEventData {
+15 -1
View File
@@ -23,6 +23,8 @@ import Head from '../../../components/atoms/Head'
import PageLink from '../../../components/atoms/PageLink' import PageLink from '../../../components/atoms/PageLink'
import { assetsBucketBaseUrl } from '../../../lib/consts' import { assetsBucketBaseUrl } from '../../../lib/consts'
import Honkai3rdLayout from '../../../components/layouts/Honkai3rdLayout' import Honkai3rdLayout from '../../../components/layouts/Honkai3rdLayout'
import { useEffect, useState } from 'react'
import BossTable from '../../../components/organisms/BossTable'
interface VersionShowPageProps { interface VersionShowPageProps {
versionData: VersionData versionData: VersionData
@@ -36,6 +38,10 @@ const VersionShowPage = ({
weapons, weapons,
}: VersionShowPageProps) => { }: VersionShowPageProps) => {
const { t } = useTranslation() const { t } = useTranslation()
const [today, setToday] = useState<Date | null>(null)
useEffect(() => {
setToday(new Date(getDateString(new Date())))
}, [])
return ( return (
<Honkai3rdLayout> <Honkai3rdLayout>
<Head <Head
@@ -148,6 +154,14 @@ const VersionShowPage = ({
</Box> </Box>
</Box> </Box>
<Heading as='h3' mb={2}>
Bosses
</Heading>
<Box sx={{ mb: 3 }}>
<BossTable versionData={versionData} today={today} />
</Box>
<Heading as='h3' mb={2}> <Heading as='h3' mb={2}>
{t('versions.supply-events')} {t('versions.supply-events')}
</Heading> </Heading>
@@ -178,7 +192,7 @@ const VersionShowPage = ({
row: supplyEventData.track, row: supplyEventData.track,
} }
})} })}
today={getDateString(new Date())} today={today}
startDate={versionData.duration[0]} startDate={versionData.duration[0]}
endDate={ endDate={
versionData.duration[1] != null versionData.duration[1] != null
+22 -36
View File
@@ -23,6 +23,10 @@ import Head from '../../../components/atoms/Head'
import PageLink from '../../../components/atoms/PageLink' import PageLink from '../../../components/atoms/PageLink'
import { assetsBucketBaseUrl } from '../../../lib/consts' import { assetsBucketBaseUrl } from '../../../lib/consts'
import Honkai3rdLayout from '../../../components/layouts/Honkai3rdLayout' import Honkai3rdLayout from '../../../components/layouts/Honkai3rdLayout'
import WeaponCard from '../../../components/molecules/WeaponCard'
import BattlesuitCard from '../../../components/molecules/BattlesuitCard'
import { useEffect, useState } from 'react'
import BossTable from '../../../components/organisms/BossTable'
interface VersionIndexPageProps { interface VersionIndexPageProps {
versionDataList: VersionData[] versionDataList: VersionData[]
@@ -38,6 +42,10 @@ const VersionIndexPage = ({
currentVersionNewWeapons, currentVersionNewWeapons,
}: VersionIndexPageProps) => { }: VersionIndexPageProps) => {
const { t } = useTranslation() const { t } = useTranslation()
const [today, setToday] = useState<Date | null>(null)
useEffect(() => {
setToday(new Date(getDateString(new Date())))
}, [])
return ( return (
<Honkai3rdLayout> <Honkai3rdLayout>
@@ -93,23 +101,11 @@ const VersionIndexPage = ({
<Box mb={3} sx={{ display: 'inline-block' }}> <Box mb={3} sx={{ display: 'inline-block' }}>
{currentVersionNewBattlesuits.map((battlesuit) => { {currentVersionNewBattlesuits.map((battlesuit) => {
return ( return (
<NextLink <BattlesuitCard
key={battlesuit.id} key={battlesuit.id}
href={`/honkai3rd/battlesuits/${battlesuit.id}`} battlesuit={battlesuit}
passHref size='sm'
> />
<Link>
<Flex sx={{ alignItems: 'center' }} mb={2}>
<SquareImageBox
size={40}
src={`${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
alt={`${battlesuit.name}`}
mr={2}
/>
<Text>{battlesuit.name}</Text>
</Flex>
</Link>
</NextLink>
) )
})} })}
</Box> </Box>
@@ -119,29 +115,19 @@ const VersionIndexPage = ({
</Heading> </Heading>
<Box mb={3} sx={{ display: 'inline-block' }}> <Box mb={3} sx={{ display: 'inline-block' }}>
{currentVersionNewWeapons.map((weapon) => { {currentVersionNewWeapons.map((weapon) => {
return ( return <WeaponCard key={weapon.id} weapon={weapon} size='sm' />
<NextLink
key={weapon.id}
href={`/honkai3rd/weapons/${weapon.id}`}
passHref
>
<Link>
<Flex sx={{ alignItems: 'center' }} mb={2}>
<SquareImageBox
size={40}
src={`${assetsBucketBaseUrl}/honkai3rd/weapons/${weapon.id}.png`}
alt={`${weapon.name}`}
mr={2}
/>
<Text>{weapon.name}</Text>
</Flex>
</Link>
</NextLink>
)
})} })}
</Box> </Box>
</Box> </Box>
<Heading as='h3' mb={2}>
Bosses
</Heading>
<Box sx={{ mb: 3 }}>
<BossTable versionData={currentVersionData} today={today} />
</Box>
<Heading as='h3' mb={2}> <Heading as='h3' mb={2}>
{t('versions.supply-events')} {t('versions.supply-events')}
</Heading> </Heading>
@@ -176,7 +162,7 @@ const VersionIndexPage = ({
} }
} }
)} )}
today={getDateString(new Date())} today={today}
startDate={currentVersionData.duration[0]} startDate={currentVersionData.duration[0]}
endDate={ endDate={
currentVersionData.duration[1] != null currentVersionData.duration[1] != null