Some extra changes

This commit is contained in:
Henry Hiles 2023-07-30 16:09:50 -04:00
parent eafdabfd08
commit 9ff34e991b
2 changed files with 12 additions and 4 deletions

View file

@ -3,12 +3,18 @@ import styles from "../styles/Button.module.css"
export interface Props {
href: string
title?: string
newTab?: boolean
}
const { href, newTab } = Astro.props
const { href, newTab, title } = Astro.props
---
<a href={href} class={styles.button} target={newTab ? "_blank" : ""}>
<a
href={href}
class={styles.button}
title={title}
target={newTab ? "_blank" : ""}
>
<slot />
</a>

View file

@ -5,12 +5,14 @@ import styles from "../styles/Top.module.css"
---
<div class={styles.up} aria-hidden="true" id="up">
<ButtonLink href="#"><Icon name="mdi:arrow-up" /></ButtonLink>
<ButtonLink href="#" title="Back to top">
<Icon name="mdi:arrow-up" />
</ButtonLink>
<script>
const up = document.querySelector("#up")
document.addEventListener("scroll", () =>
up.setAttribute("aria-hidden", window.scrollY == 0)
up?.setAttribute("aria-hidden", (window.scrollY == 0).toString())
)
</script>
</div>