Some extra changes
This commit is contained in:
parent
eafdabfd08
commit
9ff34e991b
2 changed files with 12 additions and 4 deletions
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue