mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 07:38:53 +02:00
feat(website): social buttons in mobile menu
This commit is contained in:
parent
bdb03f8d51
commit
894ec1e3c1
@ -12,18 +12,18 @@ footer .content-wrapper {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer .social-buttons {
|
.social-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer a.social-button {
|
.social-buttons a.social-button {
|
||||||
color: var(--muted-color);
|
color: var(--muted-color);
|
||||||
transition: color 250ms ease-in-out, opacity 250ms ease-in-out;
|
transition: color 250ms ease-in-out, opacity 250ms ease-in-out;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer a.social-button:hover {
|
.social-buttons a.social-button:hover {
|
||||||
color: var(--brand-1);
|
color: var(--brand-1);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
@ -15,40 +15,55 @@ export default function Footer() {
|
|||||||
© 2017-2024 <Link href="https://github.com/zadam" openExternally>zadam</Link>.
|
© 2017-2024 <Link href="https://github.com/zadam" openExternally>zadam</Link>.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="social-buttons">
|
<SocialButtons />
|
||||||
<SocialButton
|
|
||||||
name="GitHub"
|
|
||||||
iconSvg={githubIcon}
|
|
||||||
url="https://github.com/TriliumNext/Trilium"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<SocialButton
|
|
||||||
name="GitHub Discussions"
|
|
||||||
iconSvg={githubDiscussionsIcon}
|
|
||||||
url="https://github.com/orgs/TriliumNext/discussions"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<SocialButton
|
|
||||||
name="Matrix"
|
|
||||||
iconSvg={matrixIcon}
|
|
||||||
url="https://matrix.to/#/#triliumnext:matrix.org"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<SocialButton
|
|
||||||
name="Reddit"
|
|
||||||
iconSvg={redditIcon}
|
|
||||||
url="https://www.reddit.com/r/Trilium/"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function SocialButton({ name, iconSvg, url }: { name: string, iconSvg: string, url: string }) {
|
export function SocialButtons({ className, withText }: { className?: string, withText?: boolean }) {
|
||||||
return (
|
return (
|
||||||
<Link className="social-button" href={url} openExternally title={name}>
|
<div className={`social-buttons ${className}`}>
|
||||||
|
<SocialButton
|
||||||
|
name="GitHub"
|
||||||
|
iconSvg={githubIcon}
|
||||||
|
url="https://github.com/TriliumNext/Trilium"
|
||||||
|
withText={withText}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SocialButton
|
||||||
|
name="GitHub Discussions"
|
||||||
|
iconSvg={githubDiscussionsIcon}
|
||||||
|
url="https://github.com/orgs/TriliumNext/discussions"
|
||||||
|
withText={withText}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SocialButton
|
||||||
|
name="Matrix"
|
||||||
|
iconSvg={matrixIcon}
|
||||||
|
url="https://matrix.to/#/#triliumnext:matrix.org"
|
||||||
|
withText={withText}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SocialButton
|
||||||
|
name="Reddit"
|
||||||
|
iconSvg={redditIcon}
|
||||||
|
url="https://www.reddit.com/r/Trilium/"
|
||||||
|
withText={withText}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function SocialButton({ name, iconSvg, url, withText }: { name: string, iconSvg: string, url: string, withText: boolean }) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
className="social-button"
|
||||||
|
href={url} openExternally
|
||||||
|
title={!withText ? name : undefined}
|
||||||
|
>
|
||||||
<Icon svg={iconSvg} />
|
<Icon svg={iconSvg} />
|
||||||
|
{withText && name}
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ header nav a.active {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
max-height: 0;
|
max-height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: max-height 200ms ease-in-out;
|
transition: max-height 200ms ease-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
header nav.mobile-shown {
|
header nav.mobile-shown {
|
||||||
@ -91,8 +91,17 @@ header nav a.active {
|
|||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
header nav a:last-of-type {
|
header .social-buttons {
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-top: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
header .social-buttons a {
|
||||||
border-bottom: unset;
|
border-bottom: unset;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import Icon from "./Icon";
|
|||||||
import logoPath from "../assets/icon-color.svg";
|
import logoPath from "../assets/icon-color.svg";
|
||||||
import menuIcon from "../assets/boxicons/bx-menu.svg?raw";
|
import menuIcon from "../assets/boxicons/bx-menu.svg?raw";
|
||||||
import { useState } from "preact/hooks";
|
import { useState } from "preact/hooks";
|
||||||
|
import { SocialButtons } from "./Footer";
|
||||||
|
|
||||||
interface HeaderLink {
|
interface HeaderLink {
|
||||||
url: string;
|
url: string;
|
||||||
@ -51,6 +52,8 @@ export function Header() {
|
|||||||
target={link.external && "_blank"}
|
target={link.external && "_blank"}
|
||||||
>{link.text}</a>
|
>{link.text}</a>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
<SocialButtons className="mobile-only" withText />
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<DownloadButton />
|
<DownloadButton />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user