mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: more promotion
This commit is contained in:
1 parent
9a33b84b1c
commit
0bf6ac33a5
4 files changed
+71
-30
No files matched your search
@@ -841,9 +841,9 @@
|
|||||||
"title": "Install the BlitzKit App",
|
"title": "Install the BlitzKit App",
|
||||||
"new": "NEW",
|
"new": "NEW",
|
||||||
"checking": "Checking compatibility...",
|
"checking": "Checking compatibility...",
|
||||||
"incompatible": "Incompatible device.",
|
"instructions": "Instructions for Apple devices.",
|
||||||
"incompatible_help": "Try manually.",
|
"install": "Install",
|
||||||
"install": "Install"
|
"dismiss": "Dismiss"
|
||||||
},
|
},
|
||||||
|
|
||||||
"discord": {
|
"discord": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Theme, type ThemeProps } from '@radix-ui/themes';
|
import { Theme, type ThemeProps } from "@radix-ui/themes";
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from "react";
|
||||||
|
|
||||||
interface BlitzKitThemeProps extends ThemeProps {
|
interface BlitzKitThemeProps extends ThemeProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
@@ -13,13 +13,13 @@ export function BlitzKitTheme({
|
|||||||
}: BlitzKitThemeProps) {
|
}: BlitzKitThemeProps) {
|
||||||
return (
|
return (
|
||||||
<Theme
|
<Theme
|
||||||
style={{ minHeight: 'unset', display: 'contents', ...style }}
|
style={{ minHeight: "unset", display: "contents", ...style }}
|
||||||
className={`blitzkit-theme ${className}`}
|
className={`blitzkit-theme ${className}`}
|
||||||
grayColor="mauve"
|
grayColor="mauve"
|
||||||
appearance="dark"
|
appearance="dark"
|
||||||
panelBackground="solid"
|
panelBackground="solid"
|
||||||
radius="full"
|
radius="full"
|
||||||
accentColor="amber"
|
accentColor="indigo"
|
||||||
suppressHydrationWarning
|
suppressHydrationWarning
|
||||||
suppressContentEditableWarning
|
suppressContentEditableWarning
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import { DownloadIcon } from "@radix-ui/react-icons";
|
import { Cross1Icon, Cross2Icon, DownloadIcon } from "@radix-ui/react-icons";
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
Box,
|
Box,
|
||||||
@@ -14,13 +14,26 @@ import {
|
|||||||
import { getStrings } from "../core/i18n/getStrings";
|
import { getStrings } from "../core/i18n/getStrings";
|
||||||
import type { LocaleAcceptorProps } from "../hooks/useLocale";
|
import type { LocaleAcceptorProps } from "../hooks/useLocale";
|
||||||
|
|
||||||
type Props = LocaleAcceptorProps;
|
type Props = LocaleAcceptorProps & {
|
||||||
|
floating?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
const { locale } = Astro.props;
|
const { locale, floating } = Astro.props;
|
||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
---
|
---
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
#pwa-prompter[data-floating="true"] {
|
||||||
|
position: fixed;
|
||||||
|
bottom: var(--space-6);
|
||||||
|
right: var(--space-6);
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pwa-prompter[data-floating="true"] .card {
|
||||||
|
box-shadow: var(--shadow-6);
|
||||||
|
}
|
||||||
|
|
||||||
.pwa-logo {
|
.pwa-logo {
|
||||||
width: 6rem;
|
width: 6rem;
|
||||||
height: 6rem;
|
height: 6rem;
|
||||||
@@ -35,28 +48,42 @@ const strings = getStrings(locale);
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pwa-install,
|
#pwa-install,
|
||||||
#pwa-incompatible {
|
#pwa-incompatible,
|
||||||
|
#pwa-prompter[data-floating="true"],
|
||||||
|
#pwa-dismiss {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
html.pwa-enabled #pwa-install,
|
html.pwa-enabled #pwa-install,
|
||||||
html.pwa-disabled #pwa-incompatible {
|
html.pwa-disabled #pwa-incompatible,
|
||||||
|
html.pwa-enabled #pwa-prompter[data-floating="true"],
|
||||||
|
#pwa-prompter[data-floating="true"] #pwa-dismiss {
|
||||||
display: unset;
|
display: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pwa-actions button {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { pwaInstallHandler } from "pwa-install-handler";
|
import { pwaInstallHandler } from "pwa-install-handler";
|
||||||
|
|
||||||
const pwaInstallButton = document.getElementById("pwa-install");
|
const pwaInstallButton = document.getElementById("pwa-install");
|
||||||
|
const pwaDismissButton = document.getElementById("pwa-dismiss");
|
||||||
|
const pwaPrompter = document.getElementById("pwa-prompter");
|
||||||
|
|
||||||
pwaInstallButton?.addEventListener("click", () => {
|
pwaInstallButton?.addEventListener("click", () => {
|
||||||
pwaInstallHandler.install();
|
pwaInstallHandler.install();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
pwaDismissButton?.addEventListener("click", () => {
|
||||||
|
pwaPrompter?.remove();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Flex justify="center" mt="4">
|
<Flex id="pwa-prompter" justify="center" mt="4" data-floating={floating}>
|
||||||
<Card variant="classic">
|
<Card variant="classic" className="card">
|
||||||
<Inset>
|
<Inset>
|
||||||
<Flex align="center">
|
<Flex align="center">
|
||||||
<Box className="pwa-logo" />
|
<Box className="pwa-logo" />
|
||||||
@@ -78,23 +105,30 @@ const strings = getStrings(locale);
|
|||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Text color="tomato" id="pwa-incompatible">
|
<Link
|
||||||
{strings.website.home.pwa.incompatible}{" "}
|
id="pwa-incompatible"
|
||||||
<Link
|
trim="end"
|
||||||
underline="always"
|
underline="always"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href="https://www.cdc.gov/niosh/mining/tools/installpwa.html"
|
href="https://www.cdc.gov/niosh/mining/tools/installpwa.html"
|
||||||
>
|
>
|
||||||
{strings.website.home.pwa.incompatible_help}
|
{strings.website.home.pwa.instructions}
|
||||||
</Link>
|
</Link>
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Button id="pwa-install" color="jade">
|
<Flex className="pwa-actions" gap="2">
|
||||||
<Flex align="center" gap="1" justify="center">
|
<Button id="pwa-dismiss" color="tomato" variant="outline">
|
||||||
<DownloadIcon />
|
<Flex align="center" gap="1" justify="center">
|
||||||
{strings.website.home.pwa.install}
|
<Cross2Icon />
|
||||||
</Flex>
|
{strings.website.home.pwa.dismiss}
|
||||||
</Button>
|
</Flex>
|
||||||
|
</Button>
|
||||||
|
<Button id="pwa-install" color="jade">
|
||||||
|
<Flex align="center" gap="1" justify="center">
|
||||||
|
<DownloadIcon />
|
||||||
|
{strings.website.home.pwa.install}
|
||||||
|
</Flex>
|
||||||
|
</Button>
|
||||||
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Inset>
|
</Inset>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import LocaleRedirector from "../components/LocaleRedirector.astro";
|
|||||||
import Meta from "../components/Meta.astro";
|
import Meta from "../components/Meta.astro";
|
||||||
import Navbar from "../components/Navbar.astro";
|
import Navbar from "../components/Navbar.astro";
|
||||||
import PWA from "../components/PWA.astro";
|
import PWA from "../components/PWA.astro";
|
||||||
|
import PWAPrompter from "../components/PWAPrompter.astro";
|
||||||
import Servicing from "../components/Servicing.astro";
|
import Servicing from "../components/Servicing.astro";
|
||||||
import "./base.css";
|
import "./base.css";
|
||||||
|
|
||||||
@@ -38,6 +39,12 @@ const locale = Astro.params.locale;
|
|||||||
|
|
||||||
<body class={noNavbar ? "no-navbar" : ""}>
|
<body class={noNavbar ? "no-navbar" : ""}>
|
||||||
<BlitzKitTheme>
|
<BlitzKitTheme>
|
||||||
|
{
|
||||||
|
Astro.routePattern !== "/[...locale]" && (
|
||||||
|
<PWAPrompter {locale} floating />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
<Flex direction="column" minHeight="100vh">
|
<Flex direction="column" minHeight="100vh">
|
||||||
<Navbar {integrated} />
|
<Navbar {integrated} />
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user