|
1 | 1 | --- |
2 | 2 | import IconChevronLeft from "@/assets/icons/IconChevronLeft.svg"; |
3 | | -
|
4 | | -/* |
5 | | -In #btt-btn-container, left position is `left-[calc((var(--container-3xl)/2)+50%+1rem)]`. |
6 | | -This is because we use `max-w-3xl` in `PostDetails.astro`. |
7 | | -If `max-width` in `PostDetails.astro` get updated, make sure to update the `var(--container-3xl)` as well. |
8 | | -max-w-3xl => var(--container-3xl) |
9 | | -max-w-4xl => var(--container-4xl) |
10 | | -max-w-5xl => var(--container-5xl) |
11 | | -etc... |
12 | | -*/ |
| 3 | +import IconArrowNarrowUp from "@/assets/icons/IconArrowNarrowUp.svg"; |
13 | 4 | --- |
14 | 5 |
|
15 | 6 | <div |
16 | 7 | id="btt-btn-container" |
17 | 8 | class:list={[ |
18 | | - "fixed right-4 bottom-8 xl:right-auto xl:left-[calc((var(--container-3xl)/2)+50%+1rem)]", |
19 | | - "translate-y-14 opacity-0 transition-all duration-500", |
| 9 | + "fixed right-4 bottom-8 z-50", |
| 10 | + "md:sticky md:right-auto md:float-end md:mr-1", |
| 11 | + "translate-y-14 opacity-0 transition duration-500", |
20 | 12 | ]} |
21 | 13 | > |
22 | 14 | <button |
23 | 15 | data-button="back-to-top" |
24 | 16 | class:list={[ |
25 | | - "group relative", |
26 | | - "size-14 rounded-full px-2 py-1 shadow-xl lg:h-8 lg:w-fit lg:rounded-md lg:shadow-none", |
27 | | - "bg-background lg:bg-transparent", |
| 17 | + "group relative bg-background px-2 py-1", |
| 18 | + "size-14 rounded-full shadow-xl", |
| 19 | + "md:h-8 md:w-fit md:rounded-md md:shadow-none", |
| 20 | + "md:bg-background/35 md:bg-clip-padding md:backdrop-blur-lg", |
28 | 21 | ]} |
29 | 22 | > |
30 | 23 | <span |
31 | 24 | id="progress-indicator" |
32 | | - class="absolute inset-0 -z-10 block size-14 scale-110 rounded-full bg-transparent lg:hidden lg:h-8 lg:rounded-md" |
| 25 | + class="absolute inset-0 -z-10 block size-14 scale-110 rounded-full bg-transparent md:hidden md:h-8 md:rounded-md" |
33 | 26 | ></span> |
34 | | - <IconChevronLeft class="inline-block rotate-90 lg:hidden" /> |
35 | | - <span |
36 | | - class="sr-only underline decoration-dashed decoration-2 underline-offset-4 group-hover:text-accent lg:not-sr-only" |
37 | | - > |
38 | | - <span class="text-xl" tabindex="0">↑</span> Back To Top |
| 27 | + <IconChevronLeft class="inline-block rotate-90 md:hidden" /> |
| 28 | + <span class="sr-only text-sm group-hover:text-accent md:not-sr-only"> |
| 29 | + <IconArrowNarrowUp class="inline-block size-4" /> |
| 30 | + Back To Top |
39 | 31 | </span> |
40 | 32 | </button> |
41 | 33 | </div> |
|
0 commit comments