mirror of
https://github.com/zadam/trilium.git
synced 2026-01-07 23:24:25 +01:00
feat(website): list with screenshot for collections
This commit is contained in:
parent
d66505e5bc
commit
28952a5253
@ -1,7 +1,7 @@
|
|||||||
import { ComponentChildren } from "preact";
|
import { ComponentChildren, HTMLAttributes } from "preact";
|
||||||
import Button from "./Button";
|
import Button from "./Button";
|
||||||
|
|
||||||
interface CardProps {
|
interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
||||||
title: ComponentChildren;
|
title: ComponentChildren;
|
||||||
imageUrl?: string;
|
imageUrl?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -9,9 +9,9 @@ interface CardProps {
|
|||||||
children: ComponentChildren;
|
children: ComponentChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Card({ title, children, imageUrl, className, moreInfoUrl }: CardProps) {
|
export default function Card({ title, children, imageUrl, className, moreInfoUrl, ...restProps }: CardProps) {
|
||||||
return (
|
return (
|
||||||
<div className={`card ${className}`}>
|
<div className={`card ${className}`} {...restProps}>
|
||||||
{imageUrl && <img class="image" src={imageUrl} />}
|
{imageUrl && <img class="image" src={imageUrl} />}
|
||||||
|
|
||||||
<div className="card-content">
|
<div className="card-content">
|
||||||
|
|||||||
@ -169,3 +169,35 @@ section.final-cta .buttons {
|
|||||||
section.final-cta .buttons .button {
|
section.final-cta .buttons .button {
|
||||||
padding: 0.75em 2em;
|
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;
|
||||||
|
}
|
||||||
@ -8,6 +8,7 @@ import Button, { Link } from '../../components/Button';
|
|||||||
import gitHubIcon from "../../assets/boxicons/bx-github.svg?raw";
|
import gitHubIcon from "../../assets/boxicons/bx-github.svg?raw";
|
||||||
import dockerIcon from "../../assets/boxicons/bx-docker.svg?raw";
|
import dockerIcon from "../../assets/boxicons/bx-docker.svg?raw";
|
||||||
import { getPlatform } from '../../download-helper';
|
import { getPlatform } from '../../download-helper';
|
||||||
|
import { useState } from 'preact/hooks';
|
||||||
|
|
||||||
export function Home() {
|
export function Home() {
|
||||||
usePageTitle("");
|
usePageTitle("");
|
||||||
@ -116,16 +117,69 @@ function NoteTypesSection() {
|
|||||||
function CollectionsSection() {
|
function CollectionsSection() {
|
||||||
return (
|
return (
|
||||||
<Section className="collections" title="Collections">
|
<Section className="collections" title="Collections">
|
||||||
<div className="collections-container grid-2-cols">
|
<ListWithScreenshot items={[
|
||||||
<Card title="Calendar" imageUrl="./src/assets/collection_calendar.png" moreInfoUrl="https://docs.triliumnotes.org/User%20Guide/User%20Guide/Note%20Types/Collections/Calendar%20View.html">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.</Card>
|
{
|
||||||
<Card title="Table" imageUrl="./src/assets/collection_table.png" moreInfoUrl="https://docs.triliumnotes.org/User%20Guide/User%20Guide/Note%20Types/Collections/Table%20View.html">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.</Card>
|
title: "Calendar",
|
||||||
<Card title="Board" imageUrl="./src/assets/collection_board.png" moreInfoUrl="https://docs.triliumnotes.org/User%20Guide/User%20Guide/Note%20Types/Collections/Board%20View.html">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.</Card>
|
imageUrl: "./src/assets/collection_calendar.png",
|
||||||
<Card title="Geomap" imageUrl="./src/assets/collection_geomap.png" moreInfoUrl="https://docs.triliumnotes.org/User%20Guide/User%20Guide/Note%20Types/Collections/Geo%20Map%20View.html">Plan your vacations or mark your points of interest directly on a geographical map using customizable markers. Display recorded GPX tracks to track itineraries.</Card>
|
moreInfo: "https://docs.triliumnotes.org/User%20Guide/User%20Guide/Note%20Types/Collections/Calendar%20View.html",
|
||||||
</div>
|
description: "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."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Table",
|
||||||
|
imageUrl: "./src/assets/collection_table.png",
|
||||||
|
moreInfo: "https://docs.triliumnotes.org/User%20Guide/User%20Guide/Note%20Types/Collections/Table%20View.html",
|
||||||
|
description: "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." },
|
||||||
|
{
|
||||||
|
title: "Board",
|
||||||
|
imageUrl: "./src/assets/collection_board.png",
|
||||||
|
moreInfo: "https://docs.triliumnotes.org/User%20Guide/User%20Guide/Note%20Types/Collections/Board%20View.html",
|
||||||
|
description: "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."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Geomap",
|
||||||
|
imageUrl: "./src/assets/collection_geomap.png",
|
||||||
|
moreInfo: "https://docs.triliumnotes.org/User%20Guide/User%20Guide/Note%20Types/Collections/Geo%20Map%20View.html",
|
||||||
|
description: "Plan your vacations or mark your points of interest directly on a geographical map using customizable markers. Display recorded GPX tracks to track itineraries."
|
||||||
|
}
|
||||||
|
]} />
|
||||||
</Section>
|
</Section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ListWithScreenshot({ items }: {
|
||||||
|
items: { title: string, imageUrl: string, description: string, moreInfo: string }[];
|
||||||
|
}) {
|
||||||
|
const [ selectedItem, setSelectedItem ] = useState(items[0]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="list-with-screenshot">
|
||||||
|
<ul>
|
||||||
|
{items.map(item => (
|
||||||
|
<li className={`${item === selectedItem ? "selected" : ""}`}>
|
||||||
|
<Card
|
||||||
|
title={item.title}
|
||||||
|
onMouseEnter={() => setSelectedItem(item)}
|
||||||
|
onClick={() => setSelectedItem(item)}
|
||||||
|
>
|
||||||
|
{item.description}
|
||||||
|
|
||||||
|
<div class="card-footer">
|
||||||
|
<Link href={selectedItem.moreInfo}>More info</Link>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div className="details">
|
||||||
|
<h3>{selectedItem.title}</h3>
|
||||||
|
|
||||||
|
<img src={selectedItem.imageUrl} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function FaqSection() {
|
function FaqSection() {
|
||||||
return (
|
return (
|
||||||
<Section className="faq" title="Frequently Asked Questions">
|
<Section className="faq" title="Frequently Asked Questions">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user