added _ScrollToTop.tsx
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ae7f306356
commit
230e6b4175
@ -23,6 +23,19 @@ export default ((opts?: Options) => {
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<p></p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#">
|
||||
Наверх ↑
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="random-page-button">
|
||||
Случайная заметка 🎲
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</footer>
|
||||
)
|
||||
}
|
||||
|
31
quartz/components/_ScrollToTop.tsx
Normal file
31
quartz/components/_ScrollToTop.tsx
Normal file
@ -0,0 +1,31 @@
|
||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||
import style from "./styles/_scrollToTop.scss"
|
||||
|
||||
// @ts-ignore
|
||||
import script from "./scripts/_randomPage.inline"
|
||||
import { classNames } from "../util/lang"
|
||||
import { i18n } from "../i18n"
|
||||
|
||||
const ScrollToTop: QuartzComponent = ({ displayClass, fileData }: QuartzComponentProps) => {
|
||||
return (
|
||||
<div class={classNames(displayClass, "scroll-to-top")}>
|
||||
<h3>Utilities</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#">
|
||||
Scroll to top ↑
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="random-page-button">
|
||||
Random Page 🎲
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
)}
|
||||
|
||||
ScrollToTop.css = style
|
||||
ScrollToTop.afterDOMLoaded = script
|
||||
export default (() => ScrollToTop) satisfies QuartzComponentConstructor
|
31
quartz/components/styles/_scrollToTop.scss
Normal file
31
quartz/components/styles/_scrollToTop.scss
Normal file
@ -0,0 +1,31 @@
|
||||
.scroll-to-top {
|
||||
&>h3 {
|
||||
font-size: 1rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&>ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0.5rem 0;
|
||||
|
||||
&>li {
|
||||
&>a {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.external-icon {
|
||||
height: 1ex;
|
||||
margin: 0 0.15em;
|
||||
|
||||
> path {
|
||||
fill: var(--dark);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user