45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { pathToRoot } from "../util/path"
|
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|
import { classNames } from "../util/lang"
|
|
import { i18n } from "../i18n"
|
|
|
|
const Homebar: QuartzComponent = ({ fileData, cfg, displayClass }: QuartzComponentProps) => {
|
|
const title = cfg?.pageTitle ?? i18n(cfg.locale).propertyDefaults.title
|
|
const baseDir = pathToRoot(fileData.slug!)
|
|
return (
|
|
<div class="homebar">
|
|
<a class="hb-button" href="/">Home</a>
|
|
<a class="hb-button" href="/Characters">Characters</a>
|
|
<a class="hb-button" href="/Links">Where you can find me</a>
|
|
<a class="hb-button" href="/Projects">Projects</a>
|
|
<a class="hb-button" href="/Articles">Articles</a>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
Homebar.css = `
|
|
.homebar {
|
|
margin: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-wrap: wrap;
|
|
}
|
|
.hb-button {
|
|
text-size: 0.9rem;
|
|
border-radius: 16px;
|
|
border:none;
|
|
background-color: rgba(100,100,100, 0.3);
|
|
padding: 0.4rem 0.8rem;
|
|
margin: 0.2rem 0.4rem;
|
|
text-decoration: none;
|
|
width: fit-content;
|
|
height: fit-content;
|
|
cursor:pointer;
|
|
}
|
|
.hb-button:hover {
|
|
background-color: rgba(100,100,100, 0.5);
|
|
}
|
|
`
|
|
|
|
export default (() => Homebar) satisfies QuartzComponentConstructor
|