mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-19 20:03:51 +01:00
tool banner and home
This commit is contained in:
6 files changed
+26
-45
No files matched your search
@@ -1,3 +0,0 @@
|
|||||||
.back {
|
|
||||||
display: contents;
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import type { ComponentProps } from "react";
|
|
||||||
import { classNames } from "../../ui/classNames";
|
|
||||||
import styles from "./index.module.css";
|
|
||||||
|
|
||||||
interface Props extends ComponentProps<"div"> {}
|
|
||||||
|
|
||||||
export function Back({ className, onClick, ...props }: Props) {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={classNames(styles.back, className)}
|
|
||||||
onClick={(event) => {
|
|
||||||
console.log("back");
|
|
||||||
window.history.back();
|
|
||||||
onClick?.(event);
|
|
||||||
}}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
---
|
---
|
||||||
import { ArrowLeftIcon } from "@radix-ui/react-icons";
|
import { alias } from "@blitzkit/core";
|
||||||
import { api } from "../api/dynamic";
|
import { api } from "../api/dynamic";
|
||||||
import type { Tool } from "../constants/tools";
|
import type { Tool } from "../constants/tools";
|
||||||
import { Logo } from "../icons/Logo";
|
import { Logo } from "../icons/Logo";
|
||||||
import { Back } from "./Back";
|
|
||||||
import { Heading } from "./Heading";
|
import { Heading } from "./Heading";
|
||||||
import { IconButton } from "./IconButton";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
locale: string;
|
locale: string;
|
||||||
@@ -20,9 +18,21 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
<style>
|
<style>
|
||||||
.tool-banner {
|
.tool-banner {
|
||||||
--tool-banner-overlap: 8rem;
|
--tool-banner-overlap: 8rem;
|
||||||
|
--margin: var(--space-4);
|
||||||
|
|
||||||
|
flex: 1;
|
||||||
|
border-radius: var(--space-4);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
margin: var(--margin) var(--margin) 0 0;
|
||||||
|
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
|
||||||
|
@media screen and (max-width: 80rem) {
|
||||||
|
margin: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -31,7 +41,7 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: var(--space-4);
|
gap: var(--space-4);
|
||||||
padding: var(--space-5) var(--space-4);
|
padding: var(--padding) var(--space-4);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
backdrop-filter: var(--blur-tint);
|
backdrop-filter: var(--blur-tint);
|
||||||
@@ -52,11 +62,6 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
max-width: var(--page-width);
|
max-width: var(--page-width);
|
||||||
|
|
||||||
.return {
|
|
||||||
width: 0.75em;
|
|
||||||
height: 0.75em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
||||||
@@ -98,7 +103,7 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
<div
|
<div
|
||||||
class="tool-banner"
|
class="tool-banner"
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(/media/tools/banners/${tool.id}.webp)`,
|
backgroundImage: `url(${alias("api", `/tools/${tool.id}/banners/thumbnail.webp`)})`,
|
||||||
backgroundPosition: tool.banner_background_position ?? "top",
|
backgroundPosition: tool.banner_background_position ?? "top",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -106,20 +111,11 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
<div
|
<div
|
||||||
class="pattern"
|
class="pattern"
|
||||||
style={{ backgroundImage: `url(/media/patterns/${tool.id}.svg)` }}
|
style={{ backgroundImage: `url(/media/patterns/${tool.id}.svg)` }}
|
||||||
>
|
></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="centered">
|
<div class="centered">
|
||||||
<Heading weight="bold" size="2">
|
<Heading weight="bold" size="2">
|
||||||
<div style={{ display: "flex", alignItems: "center", gap: "var(--space-4)" }}>
|
|
||||||
<Back client:load>
|
|
||||||
<IconButton variant="soft" color="gray" highContrast>
|
|
||||||
<ArrowLeftIcon className="return" />
|
|
||||||
</IconButton>
|
|
||||||
</Back>
|
|
||||||
|
|
||||||
{toolStrings.name}
|
{toolStrings.name}
|
||||||
</div>
|
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
<Logo className="logo" />
|
<Logo className="logo" />
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
import { alias } from "@blitzkit/core";
|
||||||
import { api } from "../api/dynamic";
|
import { api } from "../api/dynamic";
|
||||||
import type { Tool } from "../constants/tools";
|
import type { Tool } from "../constants/tools";
|
||||||
import { Heading } from "./Heading";
|
import { Heading } from "./Heading";
|
||||||
@@ -79,7 +80,9 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{ backgroundImage: `url(/media/tools/banners/${tool.id}.webp)` }}
|
style={{
|
||||||
|
backgroundImage: `url(${alias("api", `/tools/${tool.id}/banners/poster.webp`)})`,
|
||||||
|
}}
|
||||||
class="container"
|
class="container"
|
||||||
data-disabled={String(tool.disabled ?? false)}
|
data-disabled={String(tool.disabled ?? false)}
|
||||||
>
|
>
|
||||||
@@ -92,7 +95,9 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="background"
|
class="background"
|
||||||
style={{ backgroundImage: `url(/media/tools/banners/${tool.id}.webp)` }}
|
style={{
|
||||||
|
backgroundImage: `url(${alias("api", `/tools/${tool.id}/banners/poster.webp`)})`,
|
||||||
|
}}
|
||||||
></div>
|
></div>
|
||||||
|
|
||||||
<div class="content" data-minor={minor}>
|
<div class="content" data-minor={minor}>
|
||||||
|
|||||||
@@ -96,10 +96,12 @@ export const tools: Record<string, Tool> = {
|
|||||||
|
|
||||||
export enum ToolBannerSize {
|
export enum ToolBannerSize {
|
||||||
Thumbnail = "thumbnail",
|
Thumbnail = "thumbnail",
|
||||||
|
Poster = "poster",
|
||||||
Full = "full",
|
Full = "full",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TOOL_BANNER_HEIGHTS: Record<ToolBannerSize, number | null> = {
|
export const TOOL_BANNER_HEIGHTS: Record<ToolBannerSize, number | null> = {
|
||||||
[ToolBannerSize.Thumbnail]: 128,
|
[ToolBannerSize.Thumbnail]: 128,
|
||||||
|
[ToolBannerSize.Poster]: 480 * 1.5,
|
||||||
[ToolBannerSize.Full]: null,
|
[ToolBannerSize.Full]: null,
|
||||||
};
|
};
|
||||||
@@ -16,7 +16,7 @@ const { locale } = Astro.props;
|
|||||||
<ColorScale color="amber" />
|
<ColorScale color="amber" />
|
||||||
<ColorScale color="red" />
|
<ColorScale color="red" />
|
||||||
|
|
||||||
<ToolBanner {locale} tool={tools.tanks} slot="pre-app" />
|
<ToolBanner {locale} tool={tools.tanks} />
|
||||||
|
|
||||||
<Section>
|
<Section>
|
||||||
<Page {locale} client:only="react">
|
<Page {locale} client:only="react">
|
||||||
|
|||||||
Reference in new issue
Block a user