/** * Copyright (c) 2025 adoravel * SPDX-License-Identifier: AGPL-3.0-or-later */ import { Project, ProjectLanguage } from "~/content/projects.ts"; import { css } from "~/lib/css.ts"; import { boundaries, ease, elevation, fontFamily, fontSize, radius, spacing, theme } from "~/layout.tsx"; import { ExternalLink, License } from "~/components/ui/Icon.tsx"; interface Props { projects: Project[]; } const Styled = css(` :scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${spacing[2]}; margin-top: ${spacing[2]}; padding-left: 0; list-style: none; font-family: ${fontFamily.misc}; letter-spacing: ${spacing.letter.misc}; @media (max-width: ${boundaries.mobileMaxWidth}) { grid-template-columns: 1fr; } } .project-card { position: relative; display: flex; flex-direction: column; height: 100%; padding: ${spacing[3]} ${spacing[4]}; color: ${theme.text}; background-color: ${theme.base}; border: 1px solid ${theme.baseBorder}; border-radius: ${radius.lg}; line-height: ${boundaries.lineHeight + 0.25}; text-decoration: none; overflow: hidden; transform: translateY(0px); box-shadow: 0 0px 0px rgba(0, 0, 0, 0); transition: transform ${ease.spring}, box-shadow ${ease.spring}, background-color ${ease.fast}, border-color ${ease.fast}; &:hover { background-color: ${theme.surfaceHover}; border-color: ${theme.surfaceBorderHover}; transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2); } } .project-card:hover::before { transform: scale(1.125); opacity: 1; } .project-card::before { position: absolute; top: -7rem; left: 0; display: flex; align-items: center; justify-content: center; width: 100%; content: " svg { margin-right: 0.5ch; } `); export default function Projects({ projects }: Props) { if (!projects?.length) return; return ( {projects.map((project) => { const langColour = project.lang.toString(16).padStart(6, "0"); return (
  • {project.author}/{project.name}

    {project.description}

    {ProjectLanguage[project.lang]}
    {project.license}
  • ); })}
    ); }