From 28952a5253d69ed4d4c0922d771d779bdddb6777 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 27 Sep 2025 18:17:20 +0300 Subject: [PATCH] feat(website): list with screenshot for collections --- apps/website/src/components/Card.tsx | 8 ++-- apps/website/src/pages/Home/index.css | 32 +++++++++++++ apps/website/src/pages/Home/index.tsx | 66 ++++++++++++++++++++++++--- 3 files changed, 96 insertions(+), 10 deletions(-) diff --git a/apps/website/src/components/Card.tsx b/apps/website/src/components/Card.tsx index c55f39a6d..711ce3ee0 100644 --- a/apps/website/src/components/Card.tsx +++ b/apps/website/src/components/Card.tsx @@ -1,7 +1,7 @@ -import { ComponentChildren } from "preact"; +import { ComponentChildren, HTMLAttributes } from "preact"; import Button from "./Button"; -interface CardProps { +interface CardProps extends Omit, "title"> { title: ComponentChildren; imageUrl?: string; className?: string; @@ -9,9 +9,9 @@ interface CardProps { children: ComponentChildren; } -export default function Card({ title, children, imageUrl, className, moreInfoUrl }: CardProps) { +export default function Card({ title, children, imageUrl, className, moreInfoUrl, ...restProps }: CardProps) { return ( -
+
{imageUrl && }
diff --git a/apps/website/src/pages/Home/index.css b/apps/website/src/pages/Home/index.css index a06998a92..279d7d91d 100644 --- a/apps/website/src/pages/Home/index.css +++ b/apps/website/src/pages/Home/index.css @@ -168,4 +168,36 @@ section.final-cta .buttons { section.final-cta .buttons .button { padding: 0.75em 2em; +} + +.list-with-screenshot { + display: flex; + gap: 2em; +} + +.list-with-screenshot ul { + list-style-type: none; + margin: 0; + padding: 0; +} + +.list-with-screenshot ul li { + margin-bottom: 1em; +} + +.list-with-screenshot ul li .card { + border: 1px solid transparent; +} + +.list-with-screenshot ul li.selected .card { + border: 1px solid var(--brand-1); +} + +.list-with-screenshot ul li:last-of-type { + margin-bottom: 0; +} + +.list-with-screenshot .details { + flex-basis: 50%; + flex-shrink: 0; } \ No newline at end of file diff --git a/apps/website/src/pages/Home/index.tsx b/apps/website/src/pages/Home/index.tsx index 4b6f5b96a..bdec86189 100644 --- a/apps/website/src/pages/Home/index.tsx +++ b/apps/website/src/pages/Home/index.tsx @@ -8,6 +8,7 @@ import Button, { Link } from '../../components/Button'; import gitHubIcon from "../../assets/boxicons/bx-github.svg?raw"; import dockerIcon from "../../assets/boxicons/bx-docker.svg?raw"; import { getPlatform } from '../../download-helper'; +import { useState } from 'preact/hooks'; export function Home() { usePageTitle(""); @@ -116,16 +117,69 @@ function NoteTypesSection() { function CollectionsSection() { return (
-
- Organize your personal or professional events using a calendar, with support for all-day and multi-day events. See your events at a glance with the week, month and year views. Easy interaction to add or drag events. - Display and edit information about notes in a tabular structure, with various column types such as text, number, check boxes, date & time, links and colors and support for relations. Optionally, display the notes within a tree hierarchy inside the table. - Organize your tasks or project status into a Kanban board with an easy way to create new items and columns and simply changing their status by dragging across the board. - Plan your vacations or mark your points of interest directly on a geographical map using customizable markers. Display recorded GPX tracks to track itineraries. -
+
); } +function ListWithScreenshot({ items }: { + items: { title: string, imageUrl: string, description: string, moreInfo: string }[]; +}) { + const [ selectedItem, setSelectedItem ] = useState(items[0]); + + return ( +
+
    + {items.map(item => ( +
  • + setSelectedItem(item)} + onClick={() => setSelectedItem(item)} + > + {item.description} + + + +
  • + ))} +
+ +
+

{selectedItem.title}

+ + +
+
+ ) +} + function FaqSection() { return (