mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
style(website): redesign list with screenshot
This commit is contained in:
@@ -97,8 +97,7 @@
|
||||
"get_started": "Get started"
|
||||
},
|
||||
"components": {
|
||||
"link_learn_more": "Learn more...",
|
||||
"list_with_screenshot_alt": "Screenshot of the feature being selected"
|
||||
"link_learn_more": "Learn more..."
|
||||
},
|
||||
"download_now": {
|
||||
"text": "Download now ",
|
||||
|
||||
@@ -183,72 +183,43 @@ section.faq {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: var(--brand-1);
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
gap: 1em;
|
||||
display: grid;
|
||||
|
||||
@media (min-width: 720px) {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: 1em;
|
||||
|
||||
&:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
margin: 0;
|
||||
|
||||
.card {
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
&.selected .card {
|
||||
border: 1px solid var(--brand-1);
|
||||
}
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.details {
|
||||
flex-basis: 50%;
|
||||
flex-shrink: 0;
|
||||
max-height: 35vh;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@media (max-width: 719px) {
|
||||
margin-top: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
&.horizontal {
|
||||
flex-direction: column-reverse;
|
||||
|
||||
ul {
|
||||
gap: 1em;
|
||||
display: grid;
|
||||
|
||||
@media (min-width: 720px) {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: var(--brand-1);
|
||||
}
|
||||
|
||||
.details {
|
||||
max-height: 35vh;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
img {
|
||||
height: 100%;
|
||||
width: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
img {
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ function NoteTypesSection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Section className="note-types" title={t("note_types.title")}>
|
||||
<ListWithScreenshot horizontal items={[
|
||||
<ListWithScreenshot items={[
|
||||
{
|
||||
title: t("note_types.text_title"),
|
||||
imageUrl: "/type_text.webp",
|
||||
@@ -246,39 +246,26 @@ function CollectionsSection() {
|
||||
);
|
||||
}
|
||||
|
||||
function ListWithScreenshot({ items, horizontal, cardExtra }: {
|
||||
function ListWithScreenshot({ items, cardExtra }: {
|
||||
items: { title: string, imageUrl: string, description: string, moreInfo: string, iconSvg?: string }[];
|
||||
horizontal?: boolean;
|
||||
cardExtra?: ComponentChildren;
|
||||
}) {
|
||||
const [ selectedItem, setSelectedItem ] = useState(items[0]);
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div className={`list-with-screenshot ${horizontal ? "horizontal" : ""}`}>
|
||||
<div className={`list-with-screenshot`}>
|
||||
<ul>
|
||||
{items.map(item => (
|
||||
<li className={`${item === selectedItem ? "selected" : ""}`}>
|
||||
<li>
|
||||
<Card
|
||||
title={item.title}
|
||||
onMouseEnter={() => setSelectedItem(item)}
|
||||
onClick={() => setSelectedItem(item)}
|
||||
moreInfoUrl={item.moreInfo}
|
||||
iconSvg={item.iconSvg}
|
||||
imageUrl={item.imageUrl}
|
||||
>
|
||||
{item.description}
|
||||
</Card>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<div className="details">
|
||||
{selectedItem && (
|
||||
<>
|
||||
<img src={selectedItem.imageUrl} alt={t("components.list_with_screenshot_alt")} loading="lazy" />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user