mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
feat: start adding pwa
This commit is contained in:
1 parent
080f0a0eb7
commit
01755a2a64
15 files changed
+141
-54
No files matched your search
Vendored
+3
@@ -76,7 +76,9 @@
|
||||
"echarts",
|
||||
"Everytime",
|
||||
"FASTNAME",
|
||||
"favicons",
|
||||
"flexdirection",
|
||||
"fontsource",
|
||||
"FOURCC",
|
||||
"frameloop",
|
||||
"fsformat",
|
||||
@@ -154,6 +156,7 @@
|
||||
"Pyogenics",
|
||||
"ratingleaderboard",
|
||||
"raycaster",
|
||||
"Redirector",
|
||||
"researchable",
|
||||
"Resvg",
|
||||
"rizz",
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
"dependencies": {
|
||||
"@types/xmpp__client": "^0.13.3",
|
||||
"@xmpp/client": "^0.13.6",
|
||||
"astro-favicons": "^3.1.5",
|
||||
"cheerio": "^1.1.2",
|
||||
"googleapis": "^144.0.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
},
|
||||
|
||||
"common": {
|
||||
"name": "BlitzKit",
|
||||
|
||||
"units": {
|
||||
"m": "%s1m",
|
||||
"mm": "%s1mm",
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
// @ts-check
|
||||
|
||||
import react from '@astrojs/react';
|
||||
import sitemap from '@astrojs/sitemap';
|
||||
import { SUPPORTED_LOCALES } from '@blitzkit/i18n';
|
||||
import { defineConfig } from 'astro/config';
|
||||
import react from "@astrojs/react";
|
||||
import sitemap from "@astrojs/sitemap";
|
||||
import { SUPPORTED_LOCALES } from "@blitzkit/i18n";
|
||||
import strings from "@blitzkit/i18n/strings/en.json";
|
||||
import favicons from "astro-favicons";
|
||||
import { defineConfig } from "astro/config";
|
||||
|
||||
export default defineConfig({
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
defaultLocale: "en",
|
||||
locales: [...SUPPORTED_LOCALES],
|
||||
routing: {
|
||||
prefixDefaultLocale: false,
|
||||
@@ -15,17 +17,38 @@ export default defineConfig({
|
||||
},
|
||||
|
||||
devToolbar: { enabled: false },
|
||||
output: 'static',
|
||||
site: 'https://blitzkit.app',
|
||||
outDir: '../../dist/website',
|
||||
output: "static",
|
||||
site: "https://blitzkit.app",
|
||||
outDir: "../../dist/website",
|
||||
prefetch: true,
|
||||
|
||||
integrations: [react(), sitemap()],
|
||||
integrations: [
|
||||
react(),
|
||||
sitemap(),
|
||||
favicons({
|
||||
name: strings.common.name,
|
||||
short_name: strings.common.name,
|
||||
|
||||
manifest: {
|
||||
start_url: "/",
|
||||
display_override: ["minimal-ui"],
|
||||
},
|
||||
|
||||
icons: {
|
||||
windows: true,
|
||||
android: true,
|
||||
appleIcon: true,
|
||||
appleStartup: true,
|
||||
favicons: true,
|
||||
yandex: true,
|
||||
},
|
||||
}),
|
||||
],
|
||||
vite: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'.prisma/client/index-browser':
|
||||
'../../node_modules/.prisma/client/index-browser.js',
|
||||
".prisma/client/index-browser":
|
||||
"../../node_modules/.prisma/client/index-browser.js",
|
||||
},
|
||||
},
|
||||
ssr: {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 692 B |
Binary file not shown.
|
Before Width: | Height: | Size: 692 B |
@@ -0,0 +1,47 @@
|
||||
<svg width="426" height="426" viewBox="0 0 426 426" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M416.628 244.997L235.625 372.974C223.13 381.809 202.87 381.809 190.375 372.974L9.37173 244.997C3.1239 240.58 -3.95076e-06 234.79 0 229V196.6H426V229C426 234.79 422.876 240.58 416.628 244.997Z" fill="url(#paint0_linear_544_230)"/>
|
||||
<path d="M416.628 244.997L235.625 372.974C223.13 381.809 202.87 381.809 190.375 372.974L9.37173 244.997C3.1239 240.58 -3.95076e-06 234.79 0 229V196.6H426V229C426 234.79 422.876 240.58 416.628 244.997Z" fill="url(#paint1_linear_544_230)"/>
|
||||
<path d="M416.628 180.603L235.625 52.6262C223.13 43.7913 202.87 43.7913 190.375 52.6262L9.37173 180.603C-3.12391 189.438 -3.12391 203.762 9.37173 212.597L190.375 340.574C202.87 349.409 223.13 349.409 235.625 340.574L416.628 212.597C429.124 203.762 429.124 189.438 416.628 180.603Z" fill="#D9D9D9"/>
|
||||
<path d="M416.628 180.603L235.625 52.6262C223.13 43.7913 202.87 43.7913 190.375 52.6262L9.37173 180.603C-3.12391 189.438 -3.12391 203.762 9.37173 212.597L190.375 340.574C202.87 349.409 223.13 349.409 235.625 340.574L416.628 212.597C429.124 203.762 429.124 189.438 416.628 180.603Z" fill="url(#paint2_linear_544_230)"/>
|
||||
<path d="M416.628 180.603L235.625 52.6262C223.13 43.7913 202.87 43.7913 190.375 52.6262L9.37173 180.603C-3.12391 189.438 -3.12391 203.762 9.37173 212.597L190.375 340.574C202.87 349.409 223.13 349.409 235.625 340.574L416.628 212.597C429.124 203.762 429.124 189.438 416.628 180.603Z" fill="url(#paint3_linear_544_230)"/>
|
||||
<g filter="url(#filter0_d_544_230)">
|
||||
<path d="M197.056 150.108L290.596 213.945L310.832 199.599L289.153 184.23L288.86 177.31L335.236 182.298L359.102 165.378L288.049 158.111L286.355 118L263.968 133.871L265.867 167.722L217.292 135.762L197.056 150.108Z" fill="url(#paint4_linear_544_230)"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M192.905 289L70 201.714L116.393 168.767C129.906 159.17 143.124 153.539 156.048 151.875C168.971 150.211 180.919 153.275 191.893 161.069C198.702 165.905 202.718 171.006 203.941 176.372C205.165 181.658 204.302 186.506 201.354 190.918L201.692 191.158C208.978 188.301 216.935 187.286 225.563 188.113C234.247 188.9 242.613 192.151 250.66 197.866C261.803 205.779 266.398 214.825 264.446 225.004C262.551 235.142 254.96 244.929 241.672 254.366L192.905 289ZM221.999 242.08L200.456 257.38L163.905 231.422L185.448 216.123C192.007 211.465 198.473 209.23 204.846 209.42C211.22 209.529 217.193 211.562 222.764 215.519C228.392 219.516 231.31 223.797 231.521 228.364C231.732 232.85 228.557 237.422 221.999 242.08ZM165.937 205.64L146.77 219.252L114.693 196.472L133.861 182.859C140.363 178.241 146.435 175.887 152.076 175.798C157.717 175.708 163.07 177.462 168.135 181.059C173.256 184.696 175.809 188.557 175.796 192.643C175.726 196.69 172.44 201.022 165.937 205.64Z" fill="url(#paint5_linear_544_230)"/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d_544_230" x="51.6" y="107.6" width="325.902" height="207.8" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dy="8"/>
|
||||
<feGaussianBlur stdDeviation="9.2"/>
|
||||
<feComposite in2="hardAlpha" operator="out"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_544_230"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_544_230" result="shape"/>
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear_544_230" x1="127.008" y1="227.288" x2="174.926" y2="391.583" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#0F3F7D"/>
|
||||
<stop offset="1" stop-color="#10284C"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_544_230" x1="213" y1="196.6" x2="213" y2="379.6" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#10243E"/>
|
||||
<stop offset="1" stop-color="#0F1B2D"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_544_230" x1="213" y1="46" x2="213" y2="347.2" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#10243E"/>
|
||||
<stop offset="1" stop-color="#0F1B2D"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear_544_230" x1="127.008" y1="96.51" x2="241.48" y2="334.974" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#0F3F7D"/>
|
||||
<stop offset="1" stop-color="#10284C"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint4_linear_544_230" x1="318.524" y1="40.5884" x2="402.41" y2="158.706" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.34" stop-color="#EAF6FF"/>
|
||||
<stop offset="0.64" stop-color="#97CBFF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint5_linear_544_230" x1="318.524" y1="40.5884" x2="402.41" y2="158.706" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.34" stop-color="#EAF6FF"/>
|
||||
<stop offset="0.64" stop-color="#97CBFF"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
File renamed without changes.
@@ -0,0 +1,5 @@
|
||||
---
|
||||
import { localizedHTML as favicons } from "astro-favicons/middleware";
|
||||
---
|
||||
|
||||
<Fragment set:html={favicons(Astro.currentLocale)} />
|
||||
@@ -0,0 +1,25 @@
|
||||
<script>
|
||||
import { SUPPORTED_LOCALES } from "@blitzkit/i18n";
|
||||
import { getBestLocale } from "../core/i18n/getBestLocale";
|
||||
const isAPI = window.location.pathname.startsWith("/api");
|
||||
const isI18nPath = SUPPORTED_LOCALES.some((locale) =>
|
||||
window.location.pathname.startsWith(`/${locale}`)
|
||||
);
|
||||
const bestLocale = getBestLocale();
|
||||
const currentPathLocale = SUPPORTED_LOCALES.find((locale) =>
|
||||
window.location.pathname.startsWith(`/${locale}`)
|
||||
);
|
||||
|
||||
if (
|
||||
!isAPI && // not an api, duh!
|
||||
localStorage.getItem("preferred-locale") !== null && // no preference, so probably google's crawler
|
||||
bestLocale !== currentPathLocale // we need to redirect
|
||||
) {
|
||||
window.location.pathname = isI18nPath
|
||||
? window.location.pathname.replace(
|
||||
`/${currentPathLocale}`,
|
||||
bestLocale === undefined ? "" : `/${bestLocale}`
|
||||
)
|
||||
: `/${bestLocale}${window.location.pathname}`;
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,3 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||
Whitespace-only changes.
@@ -1,14 +1,18 @@
|
||||
---
|
||||
import '@fontsource/inter';
|
||||
import { Flex } from '@radix-ui/themes';
|
||||
import { BlitzKitTheme } from '../components/BlitzKitTheme';
|
||||
import { Checks } from '../components/Checks';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import Navbar from '../components/Navbar.astro';
|
||||
import Party3 from '../components/Party3.astro';
|
||||
import './base.css';
|
||||
import { DEFAULT_LOCALE } from '@blitzkit/i18n';
|
||||
import Servicing from '../components/Servicing.astro';
|
||||
import { DEFAULT_LOCALE } from "@blitzkit/i18n";
|
||||
import strings from "@blitzkit/i18n/strings/en.json";
|
||||
import "@fontsource/inter";
|
||||
import { Flex } from "@radix-ui/themes";
|
||||
import Analytics from "../components/Analytics.astro";
|
||||
import { BlitzKitTheme } from "../components/BlitzKitTheme";
|
||||
import { Checks } from "../components/Checks";
|
||||
import Footer from "../components/Footer.astro";
|
||||
import LocaleRedirector from "../components/LocaleRedirector.astro";
|
||||
import Meta from "../components/Meta.astro";
|
||||
import Navbar from "../components/Navbar.astro";
|
||||
import PWA from "../components/PWA.astro";
|
||||
import Servicing from "../components/Servicing.astro";
|
||||
import "./base.css";
|
||||
|
||||
export interface Props {
|
||||
noFooter?: boolean;
|
||||
@@ -23,44 +27,17 @@ const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||
|
||||
<html lang={locale}>
|
||||
<head>
|
||||
<meta property="og:site_name" content="BlitzKit" />
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||
<meta property="og:site_name" content={strings.common.name} />
|
||||
|
||||
<Party3 />
|
||||
|
||||
<script>
|
||||
import { SUPPORTED_LOCALES } from '@blitzkit/i18n';
|
||||
import { getBestLocale } from '../core/i18n/getBestLocale';
|
||||
const isAPI = window.location.pathname.startsWith('/api');
|
||||
const isI18nPath = SUPPORTED_LOCALES.some((locale) =>
|
||||
window.location.pathname.startsWith(`/${locale}`),
|
||||
);
|
||||
const bestLocale = getBestLocale();
|
||||
const currentPathLocale = SUPPORTED_LOCALES.find((locale) =>
|
||||
window.location.pathname.startsWith(`/${locale}`),
|
||||
);
|
||||
|
||||
if (
|
||||
!isAPI && // not an api, duh!
|
||||
localStorage.getItem('preferred-locale') !== null && // no preference, so probably google's crawler
|
||||
bestLocale !== currentPathLocale // we need to redirect
|
||||
) {
|
||||
window.location.pathname = isI18nPath
|
||||
? window.location.pathname.replace(
|
||||
`/${currentPathLocale}`,
|
||||
bestLocale === undefined ? '' : `/${bestLocale}`,
|
||||
)
|
||||
: `/${bestLocale}${window.location.pathname}`;
|
||||
}
|
||||
</script>
|
||||
<PWA />
|
||||
<Meta />
|
||||
<Analytics />
|
||||
<LocaleRedirector />
|
||||
|
||||
<slot name="head" />
|
||||
</head>
|
||||
|
||||
<body class={noNavbar ? 'no-navbar' : ''}>
|
||||
<body class={noNavbar ? "no-navbar" : ""}>
|
||||
<BlitzKitTheme>
|
||||
<Flex direction="column" minHeight="100vh">
|
||||
<Navbar {integrated} />
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
debug
|
||||
Reference in new issue
Block a user