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