Files
FixIt/assets/css/_widgets/_fixed-button.scss
T

87 lines
2.0 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;
// TODO
color: darken($global-font-secondary-color, 10%);
background-color: $header-background-color;
@include border-radius(1.25rem);
@include transition(color 0.4s ease);
@include blur;
@extend .print-d-none;
[data-theme='dark'] & {
color: $global-font-secondary-color-dark;
background-color: $header-background-color-dark;
}
&:hover,
&:active {
color: var(#{$rootPrefix}global-font-color);
cursor: pointer;
}
&:active,
&:focus,
&:hover {
outline: none;
}
}
.back-to-top {
overflow: hidden;
position: relative;
// Ring stroke width
#{$rootPrefix}b2t-stroke: 0.5rem;
// Ring background color
#{$rootPrefix}b2t-bg: #{$global-border-color};
// Progress color
#{$rootPrefix}b2t-prog: var(#{$rootPrefix}success);
// dasharray = circumference = 2πr
// dashoffset = circumference * (1 - scrollPercent / 100)
#{$rootPrefix}b2t-dasharray: 314.15;
[data-theme='dark'] & {
#{$rootPrefix}b2t-bg: #{$global-border-color-dark};
#{$rootPrefix}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(#{$rootPrefix}b2t-bg);
stroke-width: var(#{$rootPrefix}b2t-stroke);
}
// Progress ring
.progress {
fill: none;
stroke: var(#{$rootPrefix}b2t-prog);
stroke-width: var(#{$rootPrefix}b2t-stroke);
stroke-linecap: round;
stroke-dasharray: var(#{$rootPrefix}b2t-dasharray);
stroke-dashoffset: calc(var(#{$rootPrefix}b2t-dasharray) * (1 - var(#{$rootPrefix}b2t-progress, 0) / 100));
transition: stroke-dashoffset .1s linear;
}
}