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 {
|
export interface Props {
|
||||||
href: string
|
href: string
|
||||||
|
title?: string
|
||||||
newTab?: boolean
|
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 />
|
<slot />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -5,12 +5,14 @@ import styles from "../styles/Top.module.css"
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class={styles.up} aria-hidden="true" id="up">
|
<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>
|
<script>
|
||||||
const up = document.querySelector("#up")
|
const up = document.querySelector("#up")
|
||||||
document.addEventListener("scroll", () =>
|
document.addEventListener("scroll", () =>
|
||||||
up.setAttribute("aria-hidden", window.scrollY == 0)
|
up?.setAttribute("aria-hidden", (window.scrollY == 0).toString())
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue