Host public assets from AWS
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Box, Card, Flex, Heading, Paragraph, Text } from '@theme-ui/components'
|
||||
import {
|
||||
Box,
|
||||
Card,
|
||||
Flex,
|
||||
Heading,
|
||||
Paragraph,
|
||||
Text,
|
||||
Image,
|
||||
} from '@theme-ui/components'
|
||||
import { NextPageContext } from 'next'
|
||||
import Image from 'next/image'
|
||||
import React from 'react'
|
||||
import BattlesuitFeatureLabel from '../../../components/atoms/BattlesuitFeatureLabel'
|
||||
import BattlesuitRankIcon from '../../../components/atoms/BattlesuitRankIcon'
|
||||
@@ -27,6 +34,7 @@ import { translate, useTranslation } from '../../../lib/i18n'
|
||||
import { useRouter } from 'next/router'
|
||||
import Head from '../../../components/atoms/Head'
|
||||
import { capitalize } from '../../../lib/string'
|
||||
import { assetsBucketBaseUrl } from '../../../lib/consts'
|
||||
|
||||
interface BattlesuitShowPageProps {
|
||||
battlesuit: BattlesuitData
|
||||
@@ -112,10 +120,9 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
||||
>
|
||||
<Image
|
||||
alt={battlesuitName}
|
||||
src={`/assets/honkai3rd/battlesuits/${battlesuit.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/battlesuits/${battlesuit.id}.png`}
|
||||
width={400}
|
||||
height={400}
|
||||
layout='responsive'
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Box, Card, Flex, Heading, Paragraph } from '@theme-ui/components'
|
||||
import {
|
||||
Box,
|
||||
Card,
|
||||
Flex,
|
||||
Heading,
|
||||
Paragraph,
|
||||
Image,
|
||||
} from '@theme-ui/components'
|
||||
import { NextPageContext } from 'next'
|
||||
import Image from 'next/image'
|
||||
import React from 'react'
|
||||
import BattlesuitFeatureLabel from '../../../components/atoms/BattlesuitFeatureLabel'
|
||||
import SecondaryLabel from '../../../components/atoms/SecondaryLabel'
|
||||
@@ -14,6 +20,7 @@ import { translate, useTranslation } from '../../../lib/i18n'
|
||||
import { useRouter } from 'next/router'
|
||||
import Head from '../../../components/atoms/Head'
|
||||
import { battlesuitFeatures } from '../../../lib/honkai3rd/battlesuits'
|
||||
import { assetsBucketBaseUrl } from '../../../lib/consts'
|
||||
|
||||
interface ElfShowPageProps {
|
||||
elf: ElfData
|
||||
@@ -76,9 +83,7 @@ const ElfShowPage = ({ elf }: ElfShowPageProps) => {
|
||||
>
|
||||
<Image
|
||||
alt={elf.name}
|
||||
layout='fill'
|
||||
objectFit='cover'
|
||||
src={`/assets/honkai3rd/elfs/${elf.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/elfs/${elf.id}.png`}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -11,6 +11,7 @@ import SquareImageBox from '../../components/atoms/SquareImageBox'
|
||||
import { mdiGithub } from '@mdi/js'
|
||||
import { Icon } from '@mdi/react'
|
||||
import Head from '../../components/atoms/Head'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
|
||||
const bannerValkyries = [
|
||||
'kiana',
|
||||
@@ -119,7 +120,7 @@ const NavItem = ({ target }: NavItemProps) => {
|
||||
<SquareImageBox
|
||||
size={40}
|
||||
mr={1}
|
||||
src={`/assets/honkai3rd/nav-icons/${target}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/nav-icons/${target}.png`}
|
||||
/>
|
||||
<Text sx={{ fontSize: 3 }}>{t(`nav.${target}`)}</Text>
|
||||
</Flex>
|
||||
@@ -151,7 +152,7 @@ const BannerItem = ({ valkyrie, active }: BannerItemProps) => {
|
||||
>
|
||||
<SquareImageBox
|
||||
size={280}
|
||||
src={`/assets/honkai3rd/banner-${valkyrie}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/banner-${valkyrie}.png`}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
|
||||
@@ -25,6 +25,7 @@ import { translate, useTranslation } from '../../../lib/i18n'
|
||||
import { useRouter } from 'next/router'
|
||||
import Head from '../../../components/atoms/Head'
|
||||
import PageLink from '../../../components/atoms/PageLink'
|
||||
import { assetsBucketBaseUrl } from '../../../lib/consts'
|
||||
|
||||
interface VersionShowPageProps {
|
||||
versionData: VersionData
|
||||
@@ -130,7 +131,7 @@ const VersionShowPage = ({
|
||||
<Flex sx={{ alignItems: 'center' }} mb={2}>
|
||||
<SquareImageBox
|
||||
size={40}
|
||||
src={`/assets/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
|
||||
alt={`${battlesuitName}`}
|
||||
mr={2}
|
||||
/>
|
||||
@@ -162,7 +163,7 @@ const VersionShowPage = ({
|
||||
<Flex sx={{ alignItems: 'center' }} mb={2}>
|
||||
<SquareImageBox
|
||||
size={40}
|
||||
src={`/assets/honkai3rd/weapons/${weapon.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/weapons/${weapon.id}.png`}
|
||||
alt={`${weaponName}`}
|
||||
mr={2}
|
||||
/>
|
||||
@@ -270,15 +271,15 @@ export async function getStaticPaths() {
|
||||
function getIconSrcFromItem(item: { type: string; id: string }): string | null {
|
||||
switch (item.type) {
|
||||
case 'battlesuit':
|
||||
return `/assets/honkai3rd/battlesuits/portrait-${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${item.id}.png`
|
||||
case 'weapon':
|
||||
return `/assets/honkai3rd/weapons/${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/weapons/${item.id}.png`
|
||||
case 'stigmata':
|
||||
return `/assets/honkai3rd/stigmata/icon-${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/stigmata/icon-${item.id}.png`
|
||||
case 'elf':
|
||||
return `/assets/honkai3rd/elfs/icon-${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/elfs/icon-${item.id}.png`
|
||||
case 'outfit':
|
||||
return `/assets/honkai3rd/outfits/${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/outfits/${item.id}.png`
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import { useTranslation, translate } from '../../../lib/i18n'
|
||||
import { useRouter } from 'next/router'
|
||||
import Head from '../../../components/atoms/Head'
|
||||
import PageLink from '../../../components/atoms/PageLink'
|
||||
import { assetsBucketBaseUrl } from '../../../lib/consts'
|
||||
|
||||
interface VersionIndexPageProps {
|
||||
versionDataList: VersionData[]
|
||||
@@ -120,7 +121,7 @@ const VersionIndexPage = ({
|
||||
<Flex sx={{ alignItems: 'center' }} mb={2}>
|
||||
<SquareImageBox
|
||||
size={40}
|
||||
src={`/assets/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
|
||||
alt={`${battlesuitName}`}
|
||||
mr={2}
|
||||
/>
|
||||
@@ -152,7 +153,7 @@ const VersionIndexPage = ({
|
||||
<Flex sx={{ alignItems: 'center' }} mb={2}>
|
||||
<SquareImageBox
|
||||
size={40}
|
||||
src={`/assets/honkai3rd/weapons/${weapon.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/weapons/${weapon.id}.png`}
|
||||
alt={`${weaponName}`}
|
||||
mr={2}
|
||||
/>
|
||||
@@ -281,15 +282,15 @@ export default VersionIndexPage
|
||||
function getIconSrcFromItem(item: { type: string; id: string }): string | null {
|
||||
switch (item.type) {
|
||||
case 'battlesuit':
|
||||
return `/assets/honkai3rd/battlesuits/portrait-${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${item.id}.png`
|
||||
case 'weapon':
|
||||
return `/assets/honkai3rd/weapons/${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/weapons/${item.id}.png`
|
||||
case 'stigmata':
|
||||
return `/assets/honkai3rd/stigmata/icon-${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/stigmata/icon-${item.id}.png`
|
||||
case 'elf':
|
||||
return `/assets/honkai3rd/elfs/icon-${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/elfs/icon-${item.id}.png`
|
||||
case 'outfit':
|
||||
return `/assets/honkai3rd/outfits/${item.id}.png`
|
||||
return `${assetsBucketBaseUrl}/honkai3rd/outfits/${item.id}.png`
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import { useRouter } from 'next/router'
|
||||
import { useTranslation, translate } from '../../../lib/i18n'
|
||||
import Head from '../../../components/atoms/Head'
|
||||
import PageLink from '../../../components/atoms/PageLink'
|
||||
import { assetsBucketBaseUrl } from '../../../lib/consts'
|
||||
|
||||
interface WeaponShowPageProps {
|
||||
weapon: WeaponData
|
||||
@@ -58,7 +59,7 @@ const WeaponShowPage = ({ weapon }: WeaponShowPageProps) => {
|
||||
<SquareImageBox
|
||||
size={100}
|
||||
alt={weaponName}
|
||||
src={`/assets/honkai3rd/weapons/${weapon.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/weapons/${weapon.id}.png`}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
|
||||
+1
-3
@@ -1,7 +1,6 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Box, Text } from '@theme-ui/components'
|
||||
import { Box, Text, Image } from '@theme-ui/components'
|
||||
import PageLink from '../components/atoms/PageLink'
|
||||
import Image from 'next/image'
|
||||
import RootNavigator from '../components/organisms/RootNavigator'
|
||||
import Head from '../components/atoms/Head'
|
||||
|
||||
@@ -19,7 +18,6 @@ const IndexPage = () => {
|
||||
src='/assets/honkai3rd/wallpaper.png'
|
||||
width={640}
|
||||
height={360}
|
||||
layout='responsive'
|
||||
/>
|
||||
</Box>
|
||||
<Text sx={{ fontSize: 3 }}>Honkai 3rd</Text>
|
||||
|
||||
Reference in New Issue
Block a user