From 530634fea254c344684d42fe7a1d5b4020f6a3ab Mon Sep 17 00:00:00 2001 From: LynithDev <61880709+LynithDev@users.noreply.github.com> Date: Tue, 26 Dec 2023 20:29:16 +0100 Subject: Footer + small tweaks --- apps/website/config.ts | 53 ++++++++++++ apps/website/public/media/polyfrost/full.svg | 22 ++--- apps/website/src/components/base/Footer.astro | 39 +++++++-- apps/website/src/components/base/Link.astro | 17 ++++ apps/website/src/components/base/Navbar.astro | 21 ----- .../src/components/base/NavbarElement.astro | 95 ---------------------- apps/website/src/components/base/Paragraph.astro | 6 +- apps/website/src/components/base/Slider.astro | 2 +- .../src/components/base/navbar/Navbar.astro | 21 +++++ .../src/components/base/navbar/NavbarElement.astro | 95 ++++++++++++++++++++++ apps/website/src/components/icons/Icon.astro | 21 ++++- apps/website/src/components/icons/impl/discord.svg | 1 + apps/website/src/components/icons/impl/github.svg | 3 + apps/website/src/components/icons/impl/youtube.svg | 3 + apps/website/src/components/logos/Logo.astro | 2 +- apps/website/src/layouts/Layout.astro | 2 +- apps/website/src/types/Config.d.ts | 11 ++- apps/website/tailwind.config.ts | 1 + 18 files changed, 271 insertions(+), 144 deletions(-) create mode 100644 apps/website/src/components/base/Link.astro delete mode 100644 apps/website/src/components/base/Navbar.astro delete mode 100644 apps/website/src/components/base/NavbarElement.astro create mode 100644 apps/website/src/components/base/navbar/Navbar.astro create mode 100644 apps/website/src/components/base/navbar/NavbarElement.astro create mode 100644 apps/website/src/components/icons/impl/discord.svg create mode 100644 apps/website/src/components/icons/impl/github.svg create mode 100644 apps/website/src/components/icons/impl/youtube.svg diff --git a/apps/website/config.ts b/apps/website/config.ts index e74d7aa..8e4a47e 100644 --- a/apps/website/config.ts +++ b/apps/website/config.ts @@ -24,6 +24,59 @@ export const configConst = { }, ], }, + footer: [ + { + header: "Products", + links: [ + { + text: "OneConfig", + url: "/projects/oneconfig", + }, + { + text: "OneLauncher", + url: "/projects/onelauncher", + }, + ] + }, + { + header: "Organization", + links: [ + { + text: "About us", + url: "/about", + }, + { + text: "Branding", + url: "/branding", + }, + { + text: "Contact us", + url: "/contact", + }, + { + text: "Documentation", + url: "/documentation", + } + ] + }, + { + header: "Legal", + links: [ + { + text: "Terms of service", + url: "/terms", + }, + { + text: "Privacy policy", + url: "/privacy", + }, + { + text: "Licenses", + url: "/licenses", + }, + ] + } + ] } satisfies Config; function getProjects(): Project[] { diff --git a/apps/website/public/media/polyfrost/full.svg b/apps/website/public/media/polyfrost/full.svg index 8c51156..a9c05fe 100644 --- a/apps/website/public/media/polyfrost/full.svg +++ b/apps/website/public/media/polyfrost/full.svg @@ -1,12 +1,12 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/apps/website/src/components/base/Footer.astro b/apps/website/src/components/base/Footer.astro index 0eaa4ba..bf019ac 100644 --- a/apps/website/src/components/base/Footer.astro +++ b/apps/website/src/components/base/Footer.astro @@ -1,15 +1,42 @@ --- - +import Icon from "@components/icons/Icon.astro"; +import Logo from "@components/logos/Logo.astro"; +import configConst from "@config"; +import Link from "./Link.astro"; --- -
-
+
+
+
+
+ +

English, USA

{/* hardcoded for now */} +
+ + + +
+
+
+ {configConst.footer.map((column) => ( +
+

{column.header}

+
    + {column.links.map((link) => ( +
  • + {link.text} +
  • + ))} +
+
+ ))} +
-
- +
+

© {new Date().getFullYear()} Polyfrost. All rights reserved.

+

Not affiliated with Mojang Studios.

diff --git a/apps/website/src/components/base/Link.astro b/apps/website/src/components/base/Link.astro new file mode 100644 index 0000000..5fa6d75 --- /dev/null +++ b/apps/website/src/components/base/Link.astro @@ -0,0 +1,17 @@ +--- +import type { HTMLAttributes } from "astro/types"; + +interface Props extends HTMLAttributes<"a"> { + +} + +const props = Astro.props; +const className = [ + "hover:text-blue-500 hover:underline transition-colors", + props.class, +].join(' '); +--- + + + + diff --git a/apps/website/src/components/base/Navbar.astro b/apps/website/src/components/base/Navbar.astro deleted file mode 100644 index 15f7638..0000000 --- a/apps/website/src/components/base/Navbar.astro +++ /dev/null @@ -1,21 +0,0 @@ ---- -import type { Config } from '@webtypes/Config'; -import config from 'config'; -import NavbarElement from './NavbarElement.astro'; - ---- - -
- -
diff --git a/apps/website/src/components/base/NavbarElement.astro b/apps/website/src/components/base/NavbarElement.astro deleted file mode 100644 index 8a254d6..0000000 --- a/apps/website/src/components/base/NavbarElement.astro +++ /dev/null @@ -1,95 +0,0 @@ ---- -import Icon from '@components/icons/Icon.astro'; -import Logo from '@components/logos/Logo.astro'; -import type { LogoType, NavbarElement } from '@webtypes/Config'; -import Header from './Header.astro'; -import ScreenOverlay from './ScreenOverlay.astro'; -import ScrollbarOverlayContainer from './ScrollbarOverlayContainer.astro'; -import Tag from './Tag.astro'; - -interface Props { - element: NavbarElement - index: number -} - -const { - element, - index, -} = Astro.props; ---- - -
  • - -
  • diff --git a/apps/website/src/components/base/Paragraph.astro b/apps/website/src/components/base/Paragraph.astro index ffb1030..5ceaf6e 100644 --- a/apps/website/src/components/base/Paragraph.astro +++ b/apps/website/src/components/base/Paragraph.astro @@ -26,6 +26,6 @@ const className = [ ].join(' '); --- -

    - {text || } -

    +

    + {text || } +

    diff --git a/apps/website/src/components/base/Slider.astro b/apps/website/src/components/base/Slider.astro index 3fbca91..625d7ff 100644 --- a/apps/website/src/components/base/Slider.astro +++ b/apps/website/src/components/base/Slider.astro @@ -14,7 +14,7 @@ const { wrapperClass = '', childrenNum, childrenSize = '256px', - speed = '20s', + speed = '25s', } = Astro.props; --- diff --git a/apps/website/src/components/base/navbar/Navbar.astro b/apps/website/src/components/base/navbar/Navbar.astro new file mode 100644 index 0000000..ca39f2b --- /dev/null +++ b/apps/website/src/components/base/navbar/Navbar.astro @@ -0,0 +1,21 @@ +--- +import type { Config } from '@webtypes/Config'; +import config from 'config'; +import NavbarElement from '../navbar/NavbarElement.astro'; + +--- + +
    + +
    diff --git a/apps/website/src/components/base/navbar/NavbarElement.astro b/apps/website/src/components/base/navbar/NavbarElement.astro new file mode 100644 index 0000000..8a455de --- /dev/null +++ b/apps/website/src/components/base/navbar/NavbarElement.astro @@ -0,0 +1,95 @@ +--- +import Icon from '@components/icons/Icon.astro'; +import Logo from '@components/logos/Logo.astro'; +import type { LogoType, NavbarElement } from '@webtypes/Config'; +import Header from '../Header.astro'; +import ScreenOverlay from '../ScreenOverlay.astro'; +import ScrollbarOverlayContainer from '../ScrollbarOverlayContainer.astro'; +import Tag from '../Tag.astro'; + +interface Props { + element: NavbarElement + index: number +} + +const { + element, + index, +} = Astro.props; +--- + +
  • + +
  • diff --git a/apps/website/src/components/icons/Icon.astro b/apps/website/src/components/icons/Icon.astro index b9a9b34..858b605 100644 --- a/apps/website/src/components/icons/Icon.astro +++ b/apps/website/src/components/icons/Icon.astro @@ -1,6 +1,7 @@ --- import type { HTMLAttributes } from 'astro/types'; import { parse } from 'node-html-parser'; +import Test from "./impl/book-open.svg"; type _ModIcons = | 'chatting' @@ -12,21 +13,32 @@ type _ModIcons = | 'polyweather' | 'keystrokes'; export type ModIcons = _ModIcons; // bypass for Astro compiler issue https://github.com/withastro/compiler/issues/554#issuecomment-1741702411 + +type _External = + | 'discord' + | 'github' + | 'youtube' + | 'twitter'; + +export type External = _External; + type _Icons = | 'chevron-down' | 'download' | 'book-open' | 'link-external' + | External | ModIcons; export type Icons = _Icons; // bypass for Astro compiler issue https://github.com/withastro/compiler/issues/554#issuecomment-1741702411 interface Props extends HTMLAttributes<'svg'> { - icon: Icons + icon: Icons, + path?: string, size?: number | [number, number] } -async function getSVG(name: string) { - const file = await import(/* @vite-ignore */ `./impl/${name}.svg?raw`); +async function getSVG(name: string, path = 'impl') { + const file = await import(`./${path}/${name}.svg?raw`); if (!file) throw new Error(`${name} not found`); @@ -49,6 +61,7 @@ async function getSVG(name: string) { const { icon, size, + path = 'impl', ...attributes } = Astro.props as Props; @@ -73,7 +86,7 @@ try { }; }; - const { attributes: baseAttributes, innerHTML } = await getSVG(icon); + const { attributes: baseAttributes, innerHTML } = await getSVG(icon, path); svgAttributes = { ...baseAttributes, ...attributes, diff --git a/apps/website/src/components/icons/impl/discord.svg b/apps/website/src/components/icons/impl/discord.svg new file mode 100644 index 0000000..7fcddad --- /dev/null +++ b/apps/website/src/components/icons/impl/discord.svg @@ -0,0 +1 @@ + diff --git a/apps/website/src/components/icons/impl/github.svg b/apps/website/src/components/icons/impl/github.svg new file mode 100644 index 0000000..cb3681d --- /dev/null +++ b/apps/website/src/components/icons/impl/github.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/website/src/components/icons/impl/youtube.svg b/apps/website/src/components/icons/impl/youtube.svg new file mode 100644 index 0000000..827dc58 --- /dev/null +++ b/apps/website/src/components/icons/impl/youtube.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/website/src/components/logos/Logo.astro b/apps/website/src/components/logos/Logo.astro index c2333e1..7988092 100644 --- a/apps/website/src/components/logos/Logo.astro +++ b/apps/website/src/components/logos/Logo.astro @@ -51,4 +51,4 @@ catch (err) { --- - + diff --git a/apps/website/src/layouts/Layout.astro b/apps/website/src/layouts/Layout.astro index 56b4abc..ccce067 100644 --- a/apps/website/src/layouts/Layout.astro +++ b/apps/website/src/layouts/Layout.astro @@ -1,7 +1,7 @@ --- import '../styles/global.css'; import Footer from '@components/base/Footer.astro'; -import Navbar from '../components/base/Navbar.astro'; +import Navbar from '../components/base/navbar/Navbar.astro'; import Favicon from '/media/polyfrost/minimal_bg.svg?url'; interface Props { diff --git a/apps/website/src/types/Config.d.ts b/apps/website/src/types/Config.d.ts index 8d76ff7..f53967a 100644 --- a/apps/website/src/types/Config.d.ts +++ b/apps/website/src/types/Config.d.ts @@ -24,11 +24,20 @@ export interface NavbarElement { dropdown?: NavbarDropdown[] } +export interface FooterColumn { + header: string + links: { + text: string, + url: string, + }[] +} + export interface Config { projects: Project[] logos: string[] navbar: { left: NavbarElement[] right: NavbarElement[] - } + }, + footer: FooterColumn[] } diff --git a/apps/website/tailwind.config.ts b/apps/website/tailwind.config.ts index 542f10c..e0c91a0 100644 --- a/apps/website/tailwind.config.ts +++ b/apps/website/tailwind.config.ts @@ -40,6 +40,7 @@ const config: Config = { }, // Other 'navy-peony': 'rgba(32, 55, 91, 1)', + 'blue-gray': 'rgba(119, 143, 183, 1)', 'primary': { 600: 'rgba(20, 82, 204, 1)', }, -- cgit