Redesign
This commit is contained in:
parent
0b4bca36ed
commit
f1bb9b80ca
18 changed files with 372 additions and 43 deletions
src/pages
115
src/pages/database/[...slug].astro
Normal file
115
src/pages/database/[...slug].astro
Normal file
|
@ -0,0 +1,115 @@
|
|||
---
|
||||
import { getCollection } from 'astro:content'
|
||||
import TaShowcaseLayout from '../../layouts/taShowcaseLayout.astro'
|
||||
import Layout from '../../layouts/Layout.astro'
|
||||
import DatabaseSection from '../../layouts/databaseSection.astro'
|
||||
import QuestListing from '../../components/questListing.astro'
|
||||
import SmallTitle from '../../components/smallTitle.astro'
|
||||
|
||||
interface store {
|
||||
slug: string
|
||||
group: boolean
|
||||
questinfo:
|
||||
| undefined
|
||||
| {
|
||||
slug: string
|
||||
info: {
|
||||
title: string
|
||||
releaseDate: Date
|
||||
shortdescription: string
|
||||
releaseNumber: number
|
||||
}
|
||||
}[]
|
||||
pageinfo:
|
||||
| undefined
|
||||
| {
|
||||
title: string
|
||||
shortdescription: string
|
||||
}
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const fulldata = await getCollection('taInfoData')
|
||||
const slugdata: store[] = fulldata.map((data) => {
|
||||
return {
|
||||
slug: data.id,
|
||||
group: false,
|
||||
questinfo: undefined,
|
||||
pageinfo: undefined,
|
||||
}
|
||||
})
|
||||
|
||||
const groupdata = await getCollection('groups')
|
||||
const groups: store[] = groupdata.map((data) => {
|
||||
return {
|
||||
slug: data.id,
|
||||
group: true,
|
||||
questinfo: undefined,
|
||||
pageinfo: undefined,
|
||||
}
|
||||
})
|
||||
|
||||
const full = slugdata.concat(groups as any)
|
||||
full.map((data) => {
|
||||
if (data.group) {
|
||||
const coll = fulldata.filter((d) => d.id.startsWith(data.slug))
|
||||
data.questinfo = coll.map((d) => {
|
||||
return { slug: d.id, info: d.data.info }
|
||||
})
|
||||
data.questinfo.sort(
|
||||
(a, b) =>
|
||||
b.info.releaseDate.valueOf() - a.info.releaseDate.valueOf() ||
|
||||
b.info.releaseNumber - a.info.releaseNumber
|
||||
)
|
||||
const page = groupdata.find((d) => d.id === data.slug)
|
||||
data.pageinfo = page?.data.info
|
||||
}
|
||||
})
|
||||
|
||||
return full.map((data) => ({
|
||||
params: { slug: data.slug },
|
||||
props: {
|
||||
key: data.slug,
|
||||
group: data.group,
|
||||
questinfo: data.questinfo,
|
||||
pageinfo: data.pageinfo,
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
const { key, group, questinfo, pageinfo } = Astro.props
|
||||
---
|
||||
|
||||
{
|
||||
!group && (
|
||||
<TaShowcaseLayout
|
||||
collection="taInfoData"
|
||||
collectionKey={key}
|
||||
baseurl="database"
|
||||
/>
|
||||
)
|
||||
}
|
||||
{
|
||||
group && (
|
||||
<Layout
|
||||
title={`${pageinfo!.title} - TA Database - FGO TA`}
|
||||
currentpage="database"
|
||||
descriptionOverride={pageinfo!.shortdescription}
|
||||
>
|
||||
<SmallTitle
|
||||
maintext={pageinfo!.title}
|
||||
subtext={pageinfo!.shortdescription}
|
||||
fadeout={true}
|
||||
baseurl="database"
|
||||
/>
|
||||
<DatabaseSection title="" titlehidden={true}>
|
||||
{questinfo!.map((quest) => (
|
||||
<QuestListing
|
||||
{...{ ...quest.info, slug: quest.slug }}
|
||||
baseurl="database"
|
||||
/>
|
||||
))}
|
||||
</DatabaseSection>
|
||||
</Layout>
|
||||
)
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
import { getCollection } from 'astro:content';
|
||||
import TaShowcaseLayout from '../../layouts/taShowcaseLayout.astro'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const fulldata = (await getCollection('taInfoData')).map((data) => data.id)
|
||||
return fulldata.map((slug) => ({ params: { slug } }))
|
||||
}
|
||||
|
||||
const { slug } = Astro.params
|
||||
---
|
||||
|
||||
<TaShowcaseLayout collection="taInfoData" collectionKey={slug} baseurl="database"/>
|
|
@ -3,11 +3,19 @@ import { getCollection } from 'astro:content';
|
|||
import Layout from '../../layouts/Layout.astro'
|
||||
import QuestListing from '../../components/questListing.astro'
|
||||
import DatabaseSection from '../../layouts/databaseSection.astro'
|
||||
import Title from '../../components/title.astro';
|
||||
|
||||
const description = 'FGO NA TA Database'
|
||||
const fulldata = await getCollection('taInfoData')
|
||||
const fulldata = await getCollection('taInfoData')
|
||||
const groups = await getCollection('groups')
|
||||
let combined = fulldata
|
||||
|
||||
fulldata.sort(
|
||||
for (const group of groups) {
|
||||
combined = combined.filter(data => !data.id.startsWith(group.id))
|
||||
}
|
||||
combined = combined.concat(groups as any)
|
||||
|
||||
combined.sort(
|
||||
(a, b) => b.data.info.releaseDate.valueOf() - a.data.info.releaseDate.valueOf() || b.data.info.releaseNumber - a.data.info.releaseNumber
|
||||
)
|
||||
|
||||
|
@ -18,8 +26,9 @@ fulldata.sort(
|
|||
currentpage="database"
|
||||
descriptionOverride={description}
|
||||
>
|
||||
<DatabaseSection title="NA Runs">
|
||||
{fulldata.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="database" />)}
|
||||
<Title maintext='TA DATA­BASE' subtext='A mostly up-to-date list of NA TA runs' fadeout={true}/>
|
||||
<DatabaseSection title="NA Runs" titlehidden={true}>
|
||||
{combined.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="database" />)}
|
||||
</DatabaseSection>
|
||||
</Layout>
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
import Layout from '../layouts/Layout.astro'
|
||||
import Hero from '../components/hero.astro'
|
||||
import Title from '../components/title.astro'
|
||||
|
||||
const description =
|
||||
'This site is a WIP project by Firq. In the future, it will be used to catalogue information around FGO TA and the game in general.'
|
||||
|
@ -11,7 +12,8 @@ const description =
|
|||
currentpage="home"
|
||||
descriptionOverride={description}
|
||||
>
|
||||
<Hero />
|
||||
<Title maintext='FGO NA TA DATA­BASE' subtext='The all-in-one lookup for your all TA needs'/>
|
||||
<Hero fadeout={true}/>
|
||||
</Layout>
|
||||
|
||||
<style></style>
|
||||
|
|
|
@ -4,6 +4,7 @@ import Layout from '../../layouts/Layout.astro'
|
|||
import QuestListing from '../../components/questListing.astro'
|
||||
import DatabaseSection from '../../layouts/databaseSection.astro'
|
||||
import GenericHero from '../../components/genericHero.astro';
|
||||
import Title from '../../components/title.astro';
|
||||
|
||||
const description = 'One of the most anticipated events of 2024 - Teslafest. Were the two weeks of time enough for all those quests, even with a parallel lottery?'
|
||||
const fulldata = await getCollection('teslafest')
|
||||
|
@ -25,7 +26,7 @@ const eq_2020 = fulldata.filter((value) => value.id.startsWith("eq-2020"))
|
|||
currentpage="teslafest"
|
||||
descriptionOverride={description}
|
||||
>
|
||||
<GenericHero text="TESLAFEST"></GenericHero>
|
||||
<Title maintext='TESLA­FEST' subtext='' fadeout={true}/>
|
||||
<DatabaseSection title="Challenge Quest">
|
||||
{cq.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="teslafest" />)}
|
||||
</DatabaseSection>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue