forked from RSSNext/Follow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support read indicator and back to top, fixed RSSNext#2040
Signed-off-by: Innei <tukon479@gmail.com>
- Loading branch information
Showing
6 changed files
with
203 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { SVGProps } from "react" | ||
|
||
export function MaterialSymbolsProgressActivity(props: SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" {...props}> | ||
<path | ||
fill="currentColor" | ||
d="M12 22q-2.05 0-3.875-.788t-3.187-2.15q-1.363-1.362-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175Q6.3 3.575 8.124 2.788T12 2q.425 0 .713.288T13 3q0 .425-.288.713T12 4Q8.675 4 6.337 6.338T4 12q0 3.325 2.338 5.663T12 20q3.325 0 5.663-2.337T20 12q0-.425.288-.712T21 11q.425 0 .713.288T22 12q0 2.05-.788 3.875t-2.15 3.188q-1.362 1.362-3.175 2.15T12 22" | ||
/> | ||
</svg> | ||
) | ||
} | ||
|
||
interface CircleProgressProps { | ||
percent: number | ||
size?: number | ||
strokeWidth?: number | ||
strokeColor?: string | ||
backgroundColor?: string | ||
className?: string | ||
} | ||
|
||
export const CircleProgress: React.FC<CircleProgressProps> = ({ | ||
percent, | ||
size = 100, | ||
strokeWidth = 8, | ||
strokeColor = "currentColor", | ||
backgroundColor = "hsl(var(--background))", | ||
className, | ||
}) => { | ||
const normalizedPercent = Math.min(100, Math.max(0, percent)) | ||
const radius = (size - strokeWidth) / 2 | ||
const circumference = radius * 2 * Math.PI | ||
const offset = circumference - (normalizedPercent / 100) * circumference | ||
|
||
return ( | ||
<svg width={size} height={size} className={className}> | ||
<circle | ||
cx={size / 2} | ||
cy={size / 2} | ||
r={radius} | ||
strokeLinecap="round" | ||
fill="none" | ||
stroke={backgroundColor} | ||
strokeWidth={strokeWidth} | ||
/> | ||
<circle | ||
cx={size / 2} | ||
cy={size / 2} | ||
r={radius} | ||
strokeLinecap="round" | ||
fill="none" | ||
stroke={strokeColor} | ||
strokeWidth={strokeWidth} | ||
strokeDasharray={circumference} | ||
strokeDashoffset={offset} | ||
className="duration-75" | ||
transform={`rotate(-90 ${size / 2} ${size / 2})`} | ||
style={{ transition: "stroke-dashoffset 0.3s" }} | ||
/> | ||
</svg> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters