2024-09-14 13:24:24 -05:00
|
|
|
---
|
2025-09-13 21:54:43 -05:00
|
|
|
import type { Tool } from "../constants/tools";
|
|
|
|
|
import { getStrings } from "../core/i18n/getStrings";
|
2026-08-18 13:02:59 -05:00
|
|
|
import { Heading } from "./Heading";
|
2025-09-13 21:54:43 -05:00
|
|
|
import { LinkI18n } from "./LinkI18n";
|
2026-08-18 13:02:59 -05:00
|
|
|
import { Text } from "./Text";
|
2024-09-14 13:24:24 -05:00
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
tool: Tool;
|
2025-10-22 17:52:01 -05:00
|
|
|
locale: string;
|
2024-09-14 13:24:24 -05:00
|
|
|
}
|
|
|
|
|
|
2026-08-18 13:02:59 -05:00
|
|
|
const { locale, tool } = Astro.props;
|
2025-01-06 20:09:11 -06:00
|
|
|
const strings = getStrings(locale);
|
|
|
|
|
const toolStrings =
|
|
|
|
|
strings.website.tools[
|
2025-09-13 21:54:43 -05:00
|
|
|
(tool.strings ?? tool.id) as keyof typeof strings.website.tools
|
2025-01-06 20:09:11 -06:00
|
|
|
];
|
2024-09-14 13:24:24 -05:00
|
|
|
---
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.container {
|
2026-08-18 13:02:59 -05:00
|
|
|
display: flex;
|
|
|
|
|
|
2026-08-18 12:34:27 -05:00
|
|
|
border-radius: var(--radius-3);
|
2024-09-14 13:24:24 -05:00
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center;
|
|
|
|
|
height: 16rem;
|
|
|
|
|
|
2026-08-18 13:02:59 -05:00
|
|
|
position: relative;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
2025-09-13 21:54:43 -05:00
|
|
|
&[data-disabled="true"] {
|
2024-09-14 13:24:24 -05:00
|
|
|
opacity: 0.25;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.link {
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
color: inherit;
|
2026-08-18 13:02:59 -05:00
|
|
|
|
|
|
|
|
.background {
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
|
|
gap: var(--space-4);
|
|
|
|
|
|
|
|
|
|
.wrapper {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-14 13:24:24 -05:00
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
2026-08-18 13:02:59 -05:00
|
|
|
<div
|
|
|
|
|
style={{ backgroundImage: `url(/assets/images/tools/${tool.id}.webp)` }}
|
|
|
|
|
class="container"
|
2024-09-14 13:24:24 -05:00
|
|
|
>
|
2024-12-27 14:01:59 -06:00
|
|
|
<LinkI18n
|
|
|
|
|
{locale}
|
2024-09-14 13:24:24 -05:00
|
|
|
className="link"
|
|
|
|
|
underline="none"
|
2025-09-13 21:54:43 -05:00
|
|
|
href={tool.href ?? `/${tool.id}`}
|
|
|
|
|
target={tool.href ? "_blank" : undefined}
|
2024-09-14 13:24:24 -05:00
|
|
|
>
|
2026-08-18 13:02:59 -05:00
|
|
|
<div
|
|
|
|
|
class="background"
|
|
|
|
|
style={{ backgroundImage: `url(/assets/images/tools/${tool.id}.webp)` }}
|
|
|
|
|
>
|
|
|
|
|
</div>
|
2024-09-14 13:24:24 -05:00
|
|
|
|
2026-08-18 13:02:59 -05:00
|
|
|
<div
|
|
|
|
|
class="content"
|
2024-09-14 13:24:24 -05:00
|
|
|
style={{
|
2025-09-13 21:54:43 -05:00
|
|
|
backgroundColor: "var(--color-panel-translucent)",
|
2026-08-18 12:34:27 -05:00
|
|
|
backdropFilter: "blur(64px) brightness(50%)",
|
2025-09-13 21:54:43 -05:00
|
|
|
WebkitBackdropFilter: "blur(64px)",
|
2024-09-14 13:24:24 -05:00
|
|
|
}}
|
|
|
|
|
>
|
2026-08-18 13:02:59 -05:00
|
|
|
<div class="wrapper">
|
|
|
|
|
<Heading weight="medium">
|
2025-01-06 20:09:11 -06:00
|
|
|
{toolStrings.name}
|
2024-09-14 13:24:24 -05:00
|
|
|
</Heading>
|
2026-08-18 13:02:59 -05:00
|
|
|
|
|
|
|
|
<Text color="gray">
|
2025-09-13 21:54:43 -05:00
|
|
|
{toolStrings.description}
|
2024-09-14 13:24:24 -05:00
|
|
|
</Text>
|
2026-08-18 13:02:59 -05:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-12-27 14:01:59 -06:00
|
|
|
</LinkI18n>
|
2026-08-18 13:02:59 -05:00
|
|
|
</div>
|