Separate serve lib
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { Flex, Text } from '@theme-ui/components'
|
import { Flex, Text } from '@theme-ui/components'
|
||||||
import { battlesuitStrengths } from '../../lib/safeData'
|
import { battlesuitStrengths } from '../../lib/honkai3rd/battlesuits'
|
||||||
import SquareImageBox from './SquareImageBox'
|
import SquareImageBox from './SquareImageBox'
|
||||||
|
|
||||||
interface BattlesuitFeatureLabelProps {
|
interface BattlesuitFeatureLabelProps {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Flex, Text } from '@theme-ui/components'
|
import { Flex, Text } from '@theme-ui/components'
|
||||||
|
import { valkyries } from '../../lib/honkai3rd/battlesuits'
|
||||||
import SquareImageBox from './SquareImageBox'
|
import SquareImageBox from './SquareImageBox'
|
||||||
|
|
||||||
interface ValkyrieLabelProps {
|
interface ValkyrieLabelProps {
|
||||||
@@ -6,13 +7,16 @@ interface ValkyrieLabelProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ValkyrieLabel = ({ valkyrie }: ValkyrieLabelProps) => {
|
const ValkyrieLabel = ({ valkyrie }: ValkyrieLabelProps) => {
|
||||||
const { icon, label } = getLabelData(valkyrie)
|
const { icon, label } = valkyries.find(
|
||||||
|
(aValkyrie) => aValkyrie.value === valkyrie
|
||||||
|
) || { label: valkyrie }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex sx={{ alignItems: 'center' }}>
|
<Flex sx={{ alignItems: 'center' }}>
|
||||||
{icon && (
|
{icon && (
|
||||||
<SquareImageBox
|
<SquareImageBox
|
||||||
size={30}
|
size={30}
|
||||||
src={`/assets/honkai3rd/valkyrie-icons/${icon}.png`}
|
src={`/assets/honkai3rd/${icon}.png`}
|
||||||
alt={label}
|
alt={label}
|
||||||
mr={1}
|
mr={1}
|
||||||
/>
|
/>
|
||||||
@@ -23,45 +27,3 @@ const ValkyrieLabel = ({ valkyrie }: ValkyrieLabelProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default ValkyrieLabel
|
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' }
|
|
||||||
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,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Box, Card, Text } from '@theme-ui/components'
|
import { Box, Card, Text } from '@theme-ui/components'
|
||||||
import { BattlesuitData } from '../../server/data/honkai3rd/battlesuits'
|
import { BattlesuitData } from '../../lib/honkai3rd/battlesuits'
|
||||||
import PageLink from '../atoms/PageLink'
|
import PageLink from '../atoms/PageLink'
|
||||||
import SquareImageBox from '../atoms/SquareImageBox'
|
import SquareImageBox from '../atoms/SquareImageBox'
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
export interface BattlesuitSkill {
|
||||||
|
name: string
|
||||||
|
description: string
|
||||||
|
requiredRank: string
|
||||||
|
}
|
||||||
|
export interface BattlesuitSkillGroup {
|
||||||
|
core: BattlesuitSkill
|
||||||
|
subskills: BattlesuitSkill[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BattlesuitData {
|
||||||
|
id: string
|
||||||
|
version?: string
|
||||||
|
name: string
|
||||||
|
type: string
|
||||||
|
valkyrie: string
|
||||||
|
strengths: string[]
|
||||||
|
leader: BattlesuitSkillGroup
|
||||||
|
special: BattlesuitSkillGroup
|
||||||
|
evasion: BattlesuitSkillGroup
|
||||||
|
passive: BattlesuitSkillGroup
|
||||||
|
ultimate: BattlesuitSkillGroup
|
||||||
|
basic: BattlesuitSkillGroup
|
||||||
|
sp?: BattlesuitSkillGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
export const battlesuitStrengths = [
|
||||||
|
{ icon: 'feature-icons/physical', value: 'physical', label: 'Physical' },
|
||||||
|
{ icon: 'feature-icons/fire-dmg', value: 'fire-dmg', label: 'Fire DMG' },
|
||||||
|
{ icon: 'feature-icons/ice-dmg', value: 'ice-dmg', label: 'Ice DMG' },
|
||||||
|
{
|
||||||
|
icon: 'feature-icons/lightning-dmg',
|
||||||
|
value: 'lightning-dmg',
|
||||||
|
label: 'Lightning DMG',
|
||||||
|
},
|
||||||
|
{ icon: 'feature-icons/freeze', value: 'freeze', label: 'Freeze' },
|
||||||
|
{ icon: 'feature-icons/paralyze', value: 'paralyze', label: 'Paralyze' },
|
||||||
|
{ icon: 'feature-icons/stun', value: 'stun', label: 'Stun' },
|
||||||
|
{ icon: 'feature-icons/ignite', value: 'ignite', label: 'Ignite' },
|
||||||
|
{ icon: 'feature-icons/bleed', value: 'bleed', label: 'Bleed' },
|
||||||
|
{ icon: 'feature-icons/heavy-atk', value: 'heavy-atk', label: 'heavy-atk' },
|
||||||
|
{ icon: 'feature-icons/weaken', value: 'weaken', label: 'Weaken' },
|
||||||
|
{ icon: 'feature-icons/impair', value: 'impair', label: 'Impair' },
|
||||||
|
{
|
||||||
|
icon: 'feature-icons/time-mastery',
|
||||||
|
value: 'time mastery',
|
||||||
|
label: 'Time Mastery',
|
||||||
|
},
|
||||||
|
{ icon: 'feature-icons/gather', value: 'gather', label: 'Gather' },
|
||||||
|
{ icon: 'feature-icons/heal', value: 'heal', label: 'Heal' },
|
||||||
|
{ icon: 'feature-icons/fast-atk', value: 'fast atk', label: 'Fast ATK' },
|
||||||
|
{ icon: 'feature-icons/burst', value: 'burst', label: 'Burst' },
|
||||||
|
{ icon: 'feature-icons/aerial', value: 'aerial', label: 'Aerial' },
|
||||||
|
]
|
||||||
|
|
||||||
|
export const battlesuitTypes = [
|
||||||
|
{ value: 'mecha', icon: 'type-icons/mecha', label: 'Mecha' },
|
||||||
|
{ value: 'biologic', icon: 'type-icons/biologic', label: 'Biologic' },
|
||||||
|
{ value: 'psychic', icon: 'type-icons/psychic', label: 'Psychic' },
|
||||||
|
{ value: 'quantum', icon: 'type-icons/quantum', label: 'Quantum' },
|
||||||
|
{ value: 'imaginary', icon: 'type-icons/imaginary', label: 'Imaginary' },
|
||||||
|
]
|
||||||
|
|
||||||
|
export const valkyries = [
|
||||||
|
{ value: 'kiana', icon: 'valkyrie-icons/kiana', label: 'Kiana' },
|
||||||
|
{ value: 'mei', icon: 'valkyrie-icons/mei', label: 'Mei' },
|
||||||
|
{ value: 'bronya', icon: 'valkyrie-icons/bronya', label: 'Bronya' },
|
||||||
|
{ value: 'himeko', icon: 'valkyrie-icons/himeko', label: 'Himeko' },
|
||||||
|
{ value: 'theresa', icon: 'valkyrie-icons/theresa', label: 'Theresa' },
|
||||||
|
{ value: 'fuhua', icon: 'valkyrie-icons/fuhua', label: 'Fu Hua' },
|
||||||
|
{ value: 'rita', icon: 'valkyrie-icons/rita', label: 'Rita' },
|
||||||
|
{ value: 'sakura', icon: 'valkyrie-icons/sakura', label: 'Sakura' },
|
||||||
|
{ value: 'kallen', icon: 'valkyrie-icons/kallen', label: 'Kallen' },
|
||||||
|
{ value: 'olenyevas', icon: 'valkyrie-icons/olenyevas', label: 'Olenyevas' },
|
||||||
|
{ value: 'seele', icon: 'valkyrie-icons/seele', label: 'Seele' },
|
||||||
|
{ value: 'durandal', icon: 'valkyrie-icons/durandal', label: 'Durandal' },
|
||||||
|
{ value: 'fischl', icon: 'valkyrie-icons/fischl', label: 'Fischl' },
|
||||||
|
{ value: 'elysia', icon: 'valkyrie-icons/elysia', label: 'Elysia' },
|
||||||
|
{ value: 'mobius', icon: 'valkyrie-icons/mobius', label: 'Mobius' },
|
||||||
|
{ value: 'raven', icon: 'valkyrie-icons/raven', label: 'Raven' },
|
||||||
|
{ value: 'carole', icon: 'valkyrie-icons/carole', label: 'Carole' },
|
||||||
|
]
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
export interface ElfSkill {
|
||||||
|
type: 'passive' | 'basic' | 'ultimate' | 'team'
|
||||||
|
name: string
|
||||||
|
requiredRank: number
|
||||||
|
description: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ElfData {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
baseRank: number
|
||||||
|
strengths: string[]
|
||||||
|
skillRows: [ElfSkill[], ElfSkill[], ElfSkill[], ElfSkill[]]
|
||||||
|
version: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
export interface StigmataSkill {
|
||||||
|
name: string
|
||||||
|
description: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StigmataData {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
skill: StigmataSkill
|
||||||
|
ttk: number
|
||||||
|
def: number
|
||||||
|
crt: number
|
||||||
|
set?: string
|
||||||
|
type: 'top' | 'mid' | 'bot'
|
||||||
|
hp: number
|
||||||
|
rarity: 3 | 4 | 5
|
||||||
|
version?: string
|
||||||
|
hidden?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StigmataSet {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
altName: string
|
||||||
|
twoSetSkill: StigmataSkill
|
||||||
|
threeSetSkill: StigmataSkill
|
||||||
|
version?: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
export interface SupplyEventData {
|
||||||
|
id: string
|
||||||
|
verified: boolean
|
||||||
|
track: number
|
||||||
|
name: string
|
||||||
|
type: string
|
||||||
|
token: string
|
||||||
|
featured: {
|
||||||
|
type: string
|
||||||
|
id: string
|
||||||
|
}[]
|
||||||
|
extra: string[]
|
||||||
|
version: number
|
||||||
|
duration: [string, string]
|
||||||
|
guarantees: {
|
||||||
|
count: number
|
||||||
|
recurring: boolean
|
||||||
|
rewards: { type: string; id: string; amount: number | [number, number] }[]
|
||||||
|
}[]
|
||||||
|
mileages: {
|
||||||
|
count: number
|
||||||
|
rewardOptions: {
|
||||||
|
type: string
|
||||||
|
id: string
|
||||||
|
amount: number
|
||||||
|
}[]
|
||||||
|
}[]
|
||||||
|
drops: {
|
||||||
|
type: string
|
||||||
|
id: string
|
||||||
|
rate: number
|
||||||
|
amount: number | [number, number]
|
||||||
|
}[]
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
export interface VersionData {
|
||||||
|
version: string
|
||||||
|
previousVersion?: string
|
||||||
|
nextVersion?: string
|
||||||
|
name: string
|
||||||
|
duration: [string, string]
|
||||||
|
verified: boolean
|
||||||
|
newBattlesuits: string[]
|
||||||
|
newWeapons: string[]
|
||||||
|
description: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
export interface WeaponSkill {
|
||||||
|
name: string
|
||||||
|
description: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WeaponData {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
atk: number
|
||||||
|
crt: number
|
||||||
|
category:
|
||||||
|
| 'pistol'
|
||||||
|
| 'cannon'
|
||||||
|
| 'katana'
|
||||||
|
| 'cross'
|
||||||
|
| 'greatsword'
|
||||||
|
| 'scythe'
|
||||||
|
| 'lance'
|
||||||
|
| 'gauntlet'
|
||||||
|
| 'bow'
|
||||||
|
rarity: number
|
||||||
|
skills: WeaponSkill[]
|
||||||
|
version?: string
|
||||||
|
}
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
export const battlesuitStrengths = [
|
|
||||||
{ icon: 'feature-icons/physical', value: 'physical', label: 'Physical' },
|
|
||||||
{ icon: 'feature-icons/fire-dmg', value: 'fire-dmg', label: 'Fire DMG' },
|
|
||||||
{ icon: 'feature-icons/ice-dmg', value: 'ice-dmg', label: 'Ice DMG' },
|
|
||||||
{
|
|
||||||
icon: 'feature-icons/lightning-dmg',
|
|
||||||
value: 'lightning-dmg',
|
|
||||||
label: 'Lightning DMG',
|
|
||||||
},
|
|
||||||
{ icon: 'feature-icons/freeze', value: 'freeze', label: 'Freeze' },
|
|
||||||
{ icon: 'feature-icons/paralyze', value: 'paralyze', label: 'Paralyze' },
|
|
||||||
{ icon: 'feature-icons/stun', value: 'stun', label: 'Stun' },
|
|
||||||
{ icon: 'feature-icons/ignite', value: 'ignite', label: 'Ignite' },
|
|
||||||
{ icon: 'feature-icons/bleed', value: 'bleed', label: 'Bleed' },
|
|
||||||
{ icon: 'feature-icons/heavy-atk', value: 'heavy-atk', label: 'heavy-atk' },
|
|
||||||
{ icon: 'feature-icons/weaken', value: 'weaken', label: 'Weaken' },
|
|
||||||
{ icon: 'feature-icons/impair', value: 'impair', label: 'Impair' },
|
|
||||||
{
|
|
||||||
icon: 'feature-icons/time-mastery',
|
|
||||||
value: 'time mastery',
|
|
||||||
label: 'Time Mastery',
|
|
||||||
},
|
|
||||||
{ icon: 'feature-icons/gather', value: 'gather', label: 'Gather' },
|
|
||||||
{ icon: 'feature-icons/heal', value: 'heal', label: 'Heal' },
|
|
||||||
{ icon: 'feature-icons/fast-atk', value: 'fast atk', label: 'Fast ATK' },
|
|
||||||
{ icon: 'feature-icons/burst', value: 'burst', label: 'Burst' },
|
|
||||||
{ icon: 'feature-icons/aerial', value: 'aerial', label: 'Aerial' },
|
|
||||||
]
|
|
||||||
@@ -12,6 +12,8 @@ import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator
|
|||||||
import {
|
import {
|
||||||
BattlesuitData,
|
BattlesuitData,
|
||||||
BattlesuitSkillGroup,
|
BattlesuitSkillGroup,
|
||||||
|
} from '../../../lib/honkai3rd/battlesuits'
|
||||||
|
import {
|
||||||
getBattlesuitById,
|
getBattlesuitById,
|
||||||
listBattlesuits,
|
listBattlesuits,
|
||||||
} from '../../../server/data/honkai3rd/battlesuits'
|
} from '../../../server/data/honkai3rd/battlesuits'
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ import { useMemo } from 'react'
|
|||||||
import FilterButton from '../../../components/atoms/FilterButton'
|
import FilterButton from '../../../components/atoms/FilterButton'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
||||||
|
import { listBattlesuits } from '../../../server/data/honkai3rd/battlesuits'
|
||||||
import {
|
import {
|
||||||
BattlesuitData,
|
BattlesuitData,
|
||||||
listBattlesuits,
|
battlesuitStrengths,
|
||||||
} from '../../../server/data/honkai3rd/battlesuits'
|
battlesuitTypes,
|
||||||
import { battlesuitStrengths } from '../../../lib/safeData'
|
valkyries,
|
||||||
|
} from '../../../lib/honkai3rd/battlesuits'
|
||||||
import BattlesuitCard from '../../../components/molecules/BattlesuitCard'
|
import BattlesuitCard from '../../../components/molecules/BattlesuitCard'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
|
|
||||||
@@ -24,31 +26,8 @@ interface BattlesuitListPageProps {
|
|||||||
const featureFilterOptions: { value: string; label: string; icon?: string }[] =
|
const featureFilterOptions: { value: string; label: string; icon?: string }[] =
|
||||||
[{ value: 'all', label: 'All' }, ...battlesuitStrengths]
|
[{ value: 'all', label: 'All' }, ...battlesuitStrengths]
|
||||||
|
|
||||||
const valkyrieFilterOptions = [
|
const valkyrieFilterOptions: { value: string; label: string; icon?: string }[] =
|
||||||
{ value: 'all', label: 'All' },
|
[{ value: 'all', label: 'All' }, ...battlesuitTypes, ...valkyries]
|
||||||
{ value: 'mecha', icon: 'type-icons/mecha', label: 'Mecha' },
|
|
||||||
{ value: 'biologic', icon: 'type-icons/biologic', label: 'Biologic' },
|
|
||||||
{ value: 'psychic', icon: 'type-icons/psychic', label: 'Psychic' },
|
|
||||||
{ value: 'quantum', icon: 'type-icons/quantum', label: 'Quantum' },
|
|
||||||
{ value: 'imaginary', icon: 'type-icons/imaginary', label: 'Imaginary' },
|
|
||||||
{ value: 'kiana', icon: 'valkyrie-icons/kiana', label: 'Kiana' },
|
|
||||||
{ value: 'mei', icon: 'valkyrie-icons/mei', label: 'Mei' },
|
|
||||||
{ value: 'bronya', icon: 'valkyrie-icons/bronya', label: 'Bronya' },
|
|
||||||
{ value: 'himeko', icon: 'valkyrie-icons/himeko', label: 'Himeko' },
|
|
||||||
{ value: 'theresa', icon: 'valkyrie-icons/theresa', label: 'Theresa' },
|
|
||||||
{ value: 'fuhua', icon: 'valkyrie-icons/fuhua', label: 'Fu Hua' },
|
|
||||||
{ value: 'rita', icon: 'valkyrie-icons/rita', label: 'Rita' },
|
|
||||||
{ value: 'sakura', icon: 'valkyrie-icons/sakura', label: 'Sakura' },
|
|
||||||
{ value: 'kallen', icon: 'valkyrie-icons/kallen', label: 'Kallen' },
|
|
||||||
{ value: 'olenyevas', icon: 'valkyrie-icons/olenyevas', label: 'Olenyevas' },
|
|
||||||
{ value: 'seele', icon: 'valkyrie-icons/seele', label: 'Seele' },
|
|
||||||
{ value: 'durandal', icon: 'valkyrie-icons/durandal', label: 'Durandal' },
|
|
||||||
{ value: 'fischl', icon: 'valkyrie-icons/fischl', label: 'Fischl' },
|
|
||||||
{ value: 'elysia', icon: 'valkyrie-icons/elysia', label: 'Elysia' },
|
|
||||||
{ value: 'mobius', icon: 'valkyrie-icons/mobius', label: 'Mobius' },
|
|
||||||
{ value: 'raven', icon: 'valkyrie-icons/raven', label: 'Raven' },
|
|
||||||
{ value: 'carole', icon: 'valkyrie-icons/carole', label: 'Carole' },
|
|
||||||
]
|
|
||||||
|
|
||||||
const BattlesuitListPage = ({ battlesuits }: BattlesuitListPageProps) => {
|
const BattlesuitListPage = ({ battlesuits }: BattlesuitListPageProps) => {
|
||||||
const { query } = useRouter()
|
const { query } = useRouter()
|
||||||
|
|||||||
@@ -4,11 +4,8 @@ import Image from 'next/image'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
||||||
import {
|
import { ElfData } from '../../../lib/honkai3rd/elfs'
|
||||||
ElfData,
|
import { getElfById, listElfs } from '../../../server/data/honkai3rd/elfs'
|
||||||
getElfById,
|
|
||||||
listElfs,
|
|
||||||
} from '../../../server/data/honkai3rd/elfs'
|
|
||||||
|
|
||||||
interface ElfShowPageProps {
|
interface ElfShowPageProps {
|
||||||
elf: ElfData
|
elf: ElfData
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import { pick } from 'ramda'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
||||||
import { ElfData, listElfs } from '../../../server/data/honkai3rd/elfs'
|
import { ElfData } from '../../../lib/honkai3rd/elfs'
|
||||||
|
import { listElfs } from '../../../server/data/honkai3rd/elfs'
|
||||||
|
|
||||||
interface ElfListPageProps {
|
interface ElfListPageProps {
|
||||||
elfs: Pick<ElfData, 'id' | 'name'>[]
|
elfs: Pick<ElfData, 'id' | 'name'>[]
|
||||||
|
|||||||
@@ -5,13 +5,12 @@ import Link from 'next/link'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
||||||
|
import { StigmataData, StigmataSet } from '../../../lib/honkai3rd/stigmata'
|
||||||
import {
|
import {
|
||||||
StigmataData,
|
|
||||||
listStigmata,
|
listStigmata,
|
||||||
getStigmataById,
|
getStigmataById,
|
||||||
getStigmataListBySetId,
|
getStigmataListBySetId,
|
||||||
getStigmataSetBySetId,
|
getStigmataSetBySetId,
|
||||||
StigmataSet,
|
|
||||||
} from '../../../server/data/honkai3rd/stigmata'
|
} from '../../../server/data/honkai3rd/stigmata'
|
||||||
|
|
||||||
interface StigmataShowPageProps {
|
interface StigmataShowPageProps {
|
||||||
|
|||||||
@@ -5,10 +5,8 @@ import NextLink from 'next/link'
|
|||||||
import { pick } from 'ramda'
|
import { pick } from 'ramda'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
||||||
import {
|
import { StigmataData } from '../../../lib/honkai3rd/stigmata'
|
||||||
StigmataData,
|
import { listStigmata } from '../../../server/data/honkai3rd/stigmata'
|
||||||
listStigmata,
|
|
||||||
} from '../../../server/data/honkai3rd/stigmata'
|
|
||||||
|
|
||||||
interface StigmataListPageProps {
|
interface StigmataListPageProps {
|
||||||
stigmataDataList: Pick<StigmataData, 'id' | 'name' | 'rarity'>[]
|
stigmataDataList: Pick<StigmataData, 'id' | 'name' | 'rarity'>[]
|
||||||
|
|||||||
@@ -7,25 +7,19 @@ import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator
|
|||||||
import {
|
import {
|
||||||
getVersion,
|
getVersion,
|
||||||
listVersionData,
|
listVersionData,
|
||||||
VersionData,
|
|
||||||
} from '../../../server/data/honkai3rd/versions'
|
} from '../../../server/data/honkai3rd/versions'
|
||||||
import { format as formatDate } from 'date-fns'
|
import { format as formatDate } from 'date-fns'
|
||||||
import {
|
import { getBattlesuitById } from '../../../server/data/honkai3rd/battlesuits'
|
||||||
BattlesuitData,
|
|
||||||
getBattlesuitById,
|
|
||||||
} from '../../../server/data/honkai3rd/battlesuits'
|
|
||||||
import NextLink from 'next/link'
|
import NextLink from 'next/link'
|
||||||
import SquareImageBox from '../../../components/atoms/SquareImageBox'
|
import SquareImageBox from '../../../components/atoms/SquareImageBox'
|
||||||
import {
|
import { getWeaponById } from '../../../server/data/honkai3rd/weapons'
|
||||||
getWeaponById,
|
|
||||||
WeaponData,
|
|
||||||
} from '../../../server/data/honkai3rd/weapons'
|
|
||||||
import ScrollContainer from 'react-indiana-drag-scroll'
|
import ScrollContainer from 'react-indiana-drag-scroll'
|
||||||
import {
|
import { listSupplyEventsByVersion } from '../../../server/data/honkai3rd/supplyEvents'
|
||||||
listSupplyEventsByVersion,
|
|
||||||
SupplyEventData,
|
|
||||||
} from '../../../server/data/honkai3rd/supply-events'
|
|
||||||
import { addDateToDateString, getDateString } from '../../../lib/string'
|
import { addDateToDateString, getDateString } from '../../../lib/string'
|
||||||
|
import { BattlesuitData } from '../../../lib/honkai3rd/battlesuits'
|
||||||
|
import { WeaponData } from '../../../lib/honkai3rd/weapons'
|
||||||
|
import { SupplyEventData } from '../../../lib/honkai3rd/supplyEvents'
|
||||||
|
import { VersionData } from '../../../lib/honkai3rd/versions'
|
||||||
|
|
||||||
interface VersionShowPageProps {
|
interface VersionShowPageProps {
|
||||||
versionData: VersionData
|
versionData: VersionData
|
||||||
|
|||||||
@@ -5,26 +5,20 @@ import SquareImageBox from '../../../components/atoms/SquareImageBox'
|
|||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import GanttChart from '../../../components/organisms/GanttChart'
|
import GanttChart from '../../../components/organisms/GanttChart'
|
||||||
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
||||||
import {
|
import { getBattlesuitById } from '../../../server/data/honkai3rd/battlesuits'
|
||||||
BattlesuitData,
|
import { listSupplyEventsByVersion } from '../../../server/data/honkai3rd/supplyEvents'
|
||||||
getBattlesuitById,
|
|
||||||
} from '../../../server/data/honkai3rd/battlesuits'
|
|
||||||
import {
|
|
||||||
listSupplyEventsByVersion,
|
|
||||||
SupplyEventData as SupplyEventData,
|
|
||||||
} from '../../../server/data/honkai3rd/supply-events'
|
|
||||||
import {
|
import {
|
||||||
getCurrentVersion,
|
getCurrentVersion,
|
||||||
listVersionData,
|
listVersionData,
|
||||||
VersionData,
|
|
||||||
} from '../../../server/data/honkai3rd/versions'
|
} from '../../../server/data/honkai3rd/versions'
|
||||||
import {
|
import { getWeaponById } from '../../../server/data/honkai3rd/weapons'
|
||||||
getWeaponById,
|
|
||||||
WeaponData,
|
|
||||||
} from '../../../server/data/honkai3rd/weapons'
|
|
||||||
import { addDateToDateString, getDateString } from '../../../lib/string'
|
import { addDateToDateString, getDateString } from '../../../lib/string'
|
||||||
import ScrollContainer from 'react-indiana-drag-scroll'
|
import ScrollContainer from 'react-indiana-drag-scroll'
|
||||||
import { format as formatDate } from 'date-fns'
|
import { format as formatDate } from 'date-fns'
|
||||||
|
import { BattlesuitData } from '../../../lib/honkai3rd/battlesuits'
|
||||||
|
import { WeaponData } from '../../../lib/honkai3rd/weapons'
|
||||||
|
import { VersionData } from '../../../lib/honkai3rd/versions'
|
||||||
|
import { SupplyEventData } from '../../../lib/honkai3rd/supplyEvents'
|
||||||
|
|
||||||
interface VersionIndexPageProps {
|
interface VersionIndexPageProps {
|
||||||
versionDataList: VersionData[]
|
versionDataList: VersionData[]
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import { NextPageContext } from 'next'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
||||||
|
import { WeaponData } from '../../../lib/honkai3rd/weapons'
|
||||||
import {
|
import {
|
||||||
getWeaponById,
|
getWeaponById,
|
||||||
listWeapons,
|
listWeapons,
|
||||||
WeaponData,
|
|
||||||
} from '../../../server/data/honkai3rd/weapons'
|
} from '../../../server/data/honkai3rd/weapons'
|
||||||
|
|
||||||
interface WeaponShowPageProps {
|
interface WeaponShowPageProps {
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ import { Text, Box, Heading, Flex, Link } from '@theme-ui/components'
|
|||||||
import NextLink from 'next/link'
|
import NextLink from 'next/link'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
|
||||||
import { listWeapons, WeaponData } from '../../../server/data/honkai3rd/weapons'
|
import { listWeapons } from '../../../server/data/honkai3rd/weapons'
|
||||||
import { pick } from 'ramda'
|
import { pick } from 'ramda'
|
||||||
import SquareImageBox from '../../../components/atoms/SquareImageBox'
|
import SquareImageBox from '../../../components/atoms/SquareImageBox'
|
||||||
import { useMemo } from 'react'
|
import { useMemo } from 'react'
|
||||||
import FilterButton from '../../../components/atoms/FilterButton'
|
import FilterButton from '../../../components/atoms/FilterButton'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
|
import { WeaponData } from '../../../lib/honkai3rd/weapons'
|
||||||
|
|
||||||
type WeaponListItemData = Pick<
|
type WeaponListItemData = Pick<
|
||||||
WeaponData,
|
WeaponData,
|
||||||
|
|||||||
@@ -1,31 +1,6 @@
|
|||||||
import { readdirSync, readJsonFileSync } from '../../../lib/data'
|
import { readdirSync, readJsonFileSync } from '../fs'
|
||||||
import { compareVersion } from '../../../lib/string'
|
import { compareVersion } from '../../../lib/string'
|
||||||
|
import { BattlesuitData } from '../../../lib/honkai3rd/battlesuits'
|
||||||
export interface BattlesuitSkill {
|
|
||||||
name: string
|
|
||||||
description: string
|
|
||||||
requiredRank: string
|
|
||||||
}
|
|
||||||
export interface BattlesuitSkillGroup {
|
|
||||||
core: BattlesuitSkill
|
|
||||||
subskills: BattlesuitSkill[]
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BattlesuitData {
|
|
||||||
id: string
|
|
||||||
version?: string
|
|
||||||
name: string
|
|
||||||
type: string
|
|
||||||
valkyrie: string
|
|
||||||
strengths: string[]
|
|
||||||
leader: BattlesuitSkillGroup
|
|
||||||
special: BattlesuitSkillGroup
|
|
||||||
evasion: BattlesuitSkillGroup
|
|
||||||
passive: BattlesuitSkillGroup
|
|
||||||
ultimate: BattlesuitSkillGroup
|
|
||||||
basic: BattlesuitSkillGroup
|
|
||||||
sp?: BattlesuitSkillGroup
|
|
||||||
}
|
|
||||||
|
|
||||||
const battlesuitsFileNameList = readdirSync('honkai3rd/battlesuits')
|
const battlesuitsFileNameList = readdirSync('honkai3rd/battlesuits')
|
||||||
const battlesuitDataList = battlesuitsFileNameList
|
const battlesuitDataList = battlesuitsFileNameList
|
||||||
|
|||||||
@@ -1,21 +1,6 @@
|
|||||||
import { readdirSync, readJsonFileSync } from '../../../lib/data'
|
import { readdirSync, readJsonFileSync } from '../fs'
|
||||||
import { compareVersion } from '../../../lib/string'
|
import { compareVersion } from '../../../lib/string'
|
||||||
|
import { ElfData } from '../../../lib/honkai3rd/elfs'
|
||||||
export interface ElfSkill {
|
|
||||||
type: 'passive' | 'basic' | 'ultimate' | 'team'
|
|
||||||
name: string
|
|
||||||
requiredRank: number
|
|
||||||
description: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ElfData {
|
|
||||||
id: string
|
|
||||||
name: string
|
|
||||||
baseRank: number
|
|
||||||
strengths: string[]
|
|
||||||
skillRows: [ElfSkill[], ElfSkill[], ElfSkill[], ElfSkill[]]
|
|
||||||
version: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const elfFileNameList = readdirSync('honkai3rd/elfs')
|
const elfFileNameList = readdirSync('honkai3rd/elfs')
|
||||||
const elfDataList = elfFileNameList
|
const elfDataList = elfFileNameList
|
||||||
|
|||||||
@@ -1,34 +1,6 @@
|
|||||||
import { readdirSync, readJsonFileSync } from '../../../lib/data'
|
import { readdirSync, readJsonFileSync } from '../fs'
|
||||||
import { compareVersion } from '../../../lib/string'
|
import { compareVersion } from '../../../lib/string'
|
||||||
|
import { StigmataData, StigmataSet } from '../../../lib/honkai3rd/stigmata'
|
||||||
export interface StigmataSkill {
|
|
||||||
name: string
|
|
||||||
description: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StigmataData {
|
|
||||||
id: string
|
|
||||||
name: string
|
|
||||||
skill: StigmataSkill
|
|
||||||
ttk: number
|
|
||||||
def: number
|
|
||||||
crt: number
|
|
||||||
set?: string
|
|
||||||
type: 'top' | 'mid' | 'bot'
|
|
||||||
hp: number
|
|
||||||
rarity: 3 | 4 | 5
|
|
||||||
version?: string
|
|
||||||
hidden?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StigmataSet {
|
|
||||||
id: string
|
|
||||||
name: string
|
|
||||||
altName: string
|
|
||||||
twoSetSkill: StigmataSkill
|
|
||||||
threeSetSkill: StigmataSkill
|
|
||||||
version?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const stigmataDataFileNameList = readdirSync('honkai3rd/stigmata')
|
const stigmataDataFileNameList = readdirSync('honkai3rd/stigmata')
|
||||||
const stigmataList = stigmataDataFileNameList
|
const stigmataList = stigmataDataFileNameList
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
import { readdirSync, readJsonFileSync } from '../../../lib/data'
|
|
||||||
|
|
||||||
export interface SupplyEventData {
|
|
||||||
id: string
|
|
||||||
verified: boolean
|
|
||||||
track: number
|
|
||||||
name: string
|
|
||||||
type: string
|
|
||||||
token: string
|
|
||||||
featured: {
|
|
||||||
type: string
|
|
||||||
id: string
|
|
||||||
}[]
|
|
||||||
extra: string[]
|
|
||||||
version: number
|
|
||||||
duration: [string, string]
|
|
||||||
guarantees: {
|
|
||||||
count: number
|
|
||||||
recurring: boolean
|
|
||||||
rewards: { type: string; id: string; amount: number | [number, number] }[]
|
|
||||||
}[]
|
|
||||||
mileages: {
|
|
||||||
count: number
|
|
||||||
rewardOptions: {
|
|
||||||
type: string
|
|
||||||
id: string
|
|
||||||
amount: number
|
|
||||||
}[]
|
|
||||||
}[]
|
|
||||||
drops: {
|
|
||||||
type: string
|
|
||||||
id: string
|
|
||||||
rate: number
|
|
||||||
amount: number | [number, number]
|
|
||||||
}[]
|
|
||||||
}
|
|
||||||
|
|
||||||
export function listSupplyEventsByVersion(version: string) {
|
|
||||||
const supplyEventsDirectoryPathname = `honkai3rd/versions/${version}/supply-events`
|
|
||||||
|
|
||||||
const supplyEventFileNameList = readdirSync(supplyEventsDirectoryPathname)
|
|
||||||
const supplyEventList = supplyEventFileNameList
|
|
||||||
.map((fileName) => {
|
|
||||||
const filePathname = `${supplyEventsDirectoryPathname}/` + fileName
|
|
||||||
const data = readJsonFileSync(filePathname)
|
|
||||||
|
|
||||||
return { ...data, id: fileName.replace(/\.json/, '') } as SupplyEventData
|
|
||||||
})
|
|
||||||
.sort((a, b) => {
|
|
||||||
return -a.id.localeCompare(b.id)
|
|
||||||
})
|
|
||||||
|
|
||||||
return supplyEventList
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { SupplyEventData } from '../../../lib/honkai3rd/supplyEvents'
|
||||||
|
import { readdirSync, readJsonFileSync } from '../fs'
|
||||||
|
|
||||||
|
export function listSupplyEventsByVersion(version: string) {
|
||||||
|
const supplyEventsDirectoryPathname = `honkai3rd/versions/${version}/supply-events`
|
||||||
|
|
||||||
|
const supplyEventFileNameList = readdirSync(supplyEventsDirectoryPathname)
|
||||||
|
const supplyEventList = supplyEventFileNameList
|
||||||
|
.map((fileName) => {
|
||||||
|
const filePathname = `${supplyEventsDirectoryPathname}/` + fileName
|
||||||
|
const data = readJsonFileSync(filePathname)
|
||||||
|
|
||||||
|
return { ...data, id: fileName.replace(/\.json/, '') } as SupplyEventData
|
||||||
|
})
|
||||||
|
.sort((a, b) => {
|
||||||
|
return -a.id.localeCompare(b.id)
|
||||||
|
})
|
||||||
|
|
||||||
|
return supplyEventList
|
||||||
|
}
|
||||||
@@ -1,18 +1,7 @@
|
|||||||
import { format } from 'date-fns'
|
import { format } from 'date-fns'
|
||||||
import { readdirSync, readFileSync, readJsonFileSync } from '../../../lib/data'
|
import { readdirSync, readFileSync, readJsonFileSync } from '../fs'
|
||||||
import { compareVersion } from '../../../lib/string'
|
import { compareVersion } from '../../../lib/string'
|
||||||
|
import { VersionData } from '../../../lib/honkai3rd/versions'
|
||||||
export interface VersionData {
|
|
||||||
version: string
|
|
||||||
previousVersion?: string
|
|
||||||
nextVersion?: string
|
|
||||||
name: string
|
|
||||||
duration: [string, string]
|
|
||||||
verified: boolean
|
|
||||||
newBattlesuits: string[]
|
|
||||||
newWeapons: string[]
|
|
||||||
description: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const versionDirectoryList = readdirSync('honkai3rd/versions')
|
const versionDirectoryList = readdirSync('honkai3rd/versions')
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +1,6 @@
|
|||||||
import { readdirSync, readJsonFileSync } from '../../../lib/data'
|
import { readdirSync, readJsonFileSync } from '../fs'
|
||||||
import { compareVersion } from '../../../lib/string'
|
import { compareVersion } from '../../../lib/string'
|
||||||
|
import { WeaponData } from '../../../lib/honkai3rd/weapons'
|
||||||
export interface WeaponSkill {
|
|
||||||
name: string
|
|
||||||
description: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WeaponData {
|
|
||||||
id: string
|
|
||||||
name: string
|
|
||||||
atk: number
|
|
||||||
crt: number
|
|
||||||
category:
|
|
||||||
| 'pistol'
|
|
||||||
| 'cannon'
|
|
||||||
| 'katana'
|
|
||||||
| 'cross'
|
|
||||||
| 'greatsword'
|
|
||||||
| 'scythe'
|
|
||||||
| 'lance'
|
|
||||||
| 'gauntlet'
|
|
||||||
| 'bow'
|
|
||||||
rarity: number
|
|
||||||
skills: WeaponSkill[]
|
|
||||||
version?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const weaponsFileNameList = readdirSync('honkai3rd/weapons')
|
const weaponsFileNameList = readdirSync('honkai3rd/weapons')
|
||||||
const weaponDataList = weaponsFileNameList
|
const weaponDataList = weaponsFileNameList
|
||||||
|
|||||||
Reference in New Issue
Block a user