web/about: about page routing & navigation
This commit is contained in:
parent
6a0c05cf7a
commit
d98353d5af
12 changed files with 127 additions and 15 deletions
11
web/i18n/en/about.json
Normal file
11
web/i18n/en/about.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"page.general": "what's cobalt?",
|
||||
"page.faq": "FAQ",
|
||||
|
||||
"page.community": "community",
|
||||
"page.help": "get support",
|
||||
|
||||
"page.privacy": "privacy policy",
|
||||
"page.terms": "terms and ethics",
|
||||
"page.credits": "thanks & licenses"
|
||||
}
|
|
@ -10,6 +10,17 @@ const defaultSettingsPage = () => {
|
|||
return "/settings/appearance";
|
||||
}
|
||||
|
||||
const defaultAboutPage = () => {
|
||||
if (browser) {
|
||||
if (window.innerWidth <= 750) {
|
||||
return "/about";
|
||||
}
|
||||
}
|
||||
|
||||
return "/about/general";
|
||||
}
|
||||
|
||||
export {
|
||||
defaultSettingsPage,
|
||||
defaultAboutPage
|
||||
}
|
||||
|
|
90
web/src/routes/about/+layout.svelte
Normal file
90
web/src/routes/about/+layout.svelte
Normal file
|
@ -0,0 +1,90 @@
|
|||
<script lang="ts">
|
||||
import { t } from "$lib/i18n/translations";
|
||||
import { defaultAboutPage } from "$lib/subnav";
|
||||
|
||||
import PageNav from "$components/subnav/PageNav.svelte";
|
||||
|
||||
import PageNavTab from "$components/subnav/PageNavTab.svelte";
|
||||
import PageNavSection from "$components/subnav/PageNavSection.svelte";
|
||||
|
||||
import IconComet from "@tabler/icons-svelte/IconComet.svelte";
|
||||
import IconLock from "@tabler/icons-svelte/IconLock.svelte";
|
||||
|
||||
import IconHeartHandshake from "@tabler/icons-svelte/IconHeartHandshake.svelte";
|
||||
import IconChecklist from "@tabler/icons-svelte/IconChecklist.svelte";
|
||||
|
||||
import IconMessages from "@tabler/icons-svelte/IconMessages.svelte";
|
||||
import IconUsersGroup from "@tabler/icons-svelte/IconUsersGroup.svelte";
|
||||
import IconLicense from "@tabler/icons-svelte/IconLicense.svelte";
|
||||
</script>
|
||||
|
||||
<PageNav
|
||||
pageName="about"
|
||||
homeDesktopPath={defaultAboutPage()}
|
||||
homeNavPath="/about"
|
||||
homeTitle={$t("tabs.about")}
|
||||
contentPadding
|
||||
wideContent
|
||||
>
|
||||
<svelte:fragment slot="navigation">
|
||||
<PageNavSection>
|
||||
<PageNavTab
|
||||
tabPath="/about/general"
|
||||
tabTitle={$t("about.page.general")}
|
||||
iconColor="blue"
|
||||
>
|
||||
<IconComet />
|
||||
</PageNavTab>
|
||||
<PageNavTab
|
||||
tabPath="/about/faq"
|
||||
tabTitle={$t("about.page.faq")}
|
||||
iconColor="blue"
|
||||
>
|
||||
<IconMessages />
|
||||
</PageNavTab>
|
||||
</PageNavSection>
|
||||
|
||||
<PageNavSection>
|
||||
<PageNavTab
|
||||
tabPath="/about/community"
|
||||
tabTitle={$t("about.page.community")}
|
||||
iconColor="green"
|
||||
>
|
||||
<IconUsersGroup />
|
||||
</PageNavTab>
|
||||
<PageNavTab
|
||||
tabPath="/about/help"
|
||||
tabTitle={$t("about.page.help")}
|
||||
iconColor="green"
|
||||
>
|
||||
<IconHeartHandshake />
|
||||
</PageNavTab>
|
||||
</PageNavSection>
|
||||
|
||||
<PageNavSection>
|
||||
<PageNavTab
|
||||
tabPath="/about/privacy"
|
||||
tabTitle={$t("about.page.privacy")}
|
||||
iconColor="gray"
|
||||
>
|
||||
<IconLock />
|
||||
</PageNavTab>
|
||||
<PageNavTab
|
||||
tabPath="/about/terms"
|
||||
tabTitle={$t("about.page.terms")}
|
||||
iconColor="gray"
|
||||
>
|
||||
<IconChecklist />
|
||||
</PageNavTab>
|
||||
<PageNavTab
|
||||
tabPath="/about/credits"
|
||||
tabTitle={$t("about.page.credits")}
|
||||
iconColor="gray"
|
||||
>
|
||||
<IconLicense />
|
||||
</PageNavTab>
|
||||
</PageNavSection>
|
||||
</svelte:fragment>
|
||||
|
||||
<slot slot="content"></slot>
|
||||
</PageNav>
|
|
@ -1,13 +1,4 @@
|
|||
<script>
|
||||
import { t } from "$lib/i18n/translations";
|
||||
|
||||
import Placeholder from "$components/misc/Placeholder.svelte";
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>
|
||||
{$t("tabs.about")} ~ {$t("general.cobalt")}
|
||||
</title>
|
||||
</svelte:head>
|
||||
|
||||
<Placeholder pageName="about" />
|
||||
<!--
|
||||
please don't remove this file
|
||||
it's used to display page navigation on mobile, without a blank page it won't work
|
||||
-->
|
||||
|
|
1
web/src/routes/about/community/+page.svelte
Normal file
1
web/src/routes/about/community/+page.svelte
Normal file
|
@ -0,0 +1 @@
|
|||
<div>community links</div>
|
1
web/src/routes/about/credits/+page.svelte
Normal file
1
web/src/routes/about/credits/+page.svelte
Normal file
|
@ -0,0 +1 @@
|
|||
<div>thanks :3</div>
|
1
web/src/routes/about/faq/+page.svelte
Normal file
1
web/src/routes/about/faq/+page.svelte
Normal file
|
@ -0,0 +1 @@
|
|||
<div>frequently asked questions</div>
|
1
web/src/routes/about/general/+page.svelte
Normal file
1
web/src/routes/about/general/+page.svelte
Normal file
|
@ -0,0 +1 @@
|
|||
<div>what's cobalt?</div>
|
1
web/src/routes/about/help/+page.svelte
Normal file
1
web/src/routes/about/help/+page.svelte
Normal file
|
@ -0,0 +1 @@
|
|||
<div>support methods</div>
|
1
web/src/routes/about/privacy/+page.svelte
Normal file
1
web/src/routes/about/privacy/+page.svelte
Normal file
|
@ -0,0 +1 @@
|
|||
<div>privacy policy</div>
|
1
web/src/routes/about/terms/+page.svelte
Normal file
1
web/src/routes/about/terms/+page.svelte
Normal file
|
@ -0,0 +1 @@
|
|||
<div>terms and ethics here</div>
|
|
@ -1,2 +1,4 @@
|
|||
<!-- don't remove this file -->
|
||||
<!-- it's used to display navigation on mobile, without a blank page it doesn't work -->
|
||||
<!--
|
||||
please don't remove this file
|
||||
it's used to display page navigation on mobile, without a blank page it won't work
|
||||
-->
|
||||
|
|
Loading…
Reference in a new issue