public/components/ButtonToTop.vue
eggy dfd2a67b53 chore: hardcode height instead of aspect ratio
aspect ratio is fairly new so just in case
2022-08-09 19:14:39 -04:00

34 lines
597 B
Vue

<template>
<a href="#" class="go-top"></a>
</template>
<style scoped>
.go-top {
--offset: 20rem;
position: sticky;
bottom: 1rem;
margin-right: 1rem;
place-self: end;
margin-top: calc(100vh + var(--offset));
width: 2rem;
height: 2rem;
background: #ff8b24;
border-radius: 1rem;
box-shadow: 0 0.1rem 0.5rem 0 gray;
}
html.dark .go-top {
box-shadow: 0 0.1rem 0.5rem 0 black;
}
.go-top:before {
content: "";
position: absolute;
inset: 30%;
transform: translateY(20%) rotate(-45deg);
border-top: 0.35rem solid #fff;
border-right: 0.35rem solid #fff;
}
</style>