Files
FixIt/assets/css/_partials/_widgets/_fixed-button.scss
T
Cell aad75044e9 feat: implement TOC drawer feature (#657)
* feat: add toc drawer button

* feat: add TOC dialog functionality and related styles

* feat: change back-to-top button with scroll progress indicator

* feat: update color-scheme handling in theme switcher

* fix: code review for checking mistakes and optimization

* fix: the issue where the TOC was still clickable even when it was hidden.
2025-11-18 12:35:34 +08:00

90 lines
1.8 KiB
SCSS

.fixed-buttons {
position: fixed;
right: 1.5rem;
bottom: 1.5rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
@include z-index(1);
}
.fixed-button {
font-size: 1rem;
line-height: 1.5rem;
padding: 0.5rem 0.625rem;
color: $global-font-color;
background-color: $header-background-color;
@include border-radius(1.25rem);
@include transition(color 0.4s ease);
@include blur;
@extend .print-d-none;
&:hover,
&:active {
color: $global-font-color;
cursor: pointer;
}
&:active,
&:focus,
&:hover {
outline: none;
}
[data-theme='dark'] & {
color: $global-font-color-dark;
background-color: $header-background-color-dark;
&:hover,
&:active {
color: $global-font-color-dark;
}
}
}
.back-to-top {
overflow: hidden;
position: relative;
// Ring stroke width
--b2t-stroke: 0.5rem;
// Ring background color
--b2t-bg: #{$global-border-color};
// Progress color
--b2t-prog: #FF7359;
// 2π×50 ≈ 314 (radius 50 for viewBox 100)
--b2t-circumference: 314;
[data-theme='dark'] & {
--b2t-bg: #{$global-border-color-dark};
--b2t-prog: #{$global-font-color-dark};
}
// SVG circular progress ring
svg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
// Rotate to start from top
transform: rotate(-90deg);
}
.bg {
fill: none;
stroke: var(--b2t-bg);
stroke-width: var(--b2t-stroke);
}
// Progress ring
.progress {
fill: none;
stroke: var(--b2t-prog);
stroke-width: var(--b2t-stroke);
stroke-linecap: round;
stroke-dasharray: var(--b2t-circumference);
stroke-dashoffset: calc(var(--b2t-circumference) - var(--b2t-circumference) * var(--scroll-percent, 0) / 100);
transition: stroke-dashoffset .1s linear;
}
}