Skip to content

Commit

Permalink
Skillsをダークテーマ対応させる
Browse files Browse the repository at this point in the history
  • Loading branch information
piny940 committed Jul 1, 2023
1 parent c001939 commit 7d48588
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/Common/PieItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,22 @@ export type PieItemProps = {
percent: number
children: ReactNode
className?: string
innerClassName?: string
}

export const PieItem: React.FC<PieItemProps> = ({
percent,
children,
className,
innerClassName,
}) => {
const start = [0, 85, 255]
const end = [0, 255, 238]
const color = end.map((v, i) => start[i] + ((v - start[i]) * percent) / 100)

return (
<PieDiv start={start} end={color} percent={percent} className={className}>
<CircleDiv>{children}</CircleDiv>
<CircleDiv className={innerClassName}>{children}</CircleDiv>
</PieDiv>
)
}
6 changes: 5 additions & 1 deletion src/components/Portfolio/SkillItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export type SkillItemProps = {
export const SkillItem: React.FC<SkillItemProps> = ({ skill, className }) => {
return (
<div className={className}>
<PieItem className="mx-auto" percent={skill.percent}>
<PieItem
innerClassName="bg-body"
className="mx-auto"
percent={skill.percent}
>
<div className="d-flex flex-column mb-2">
{skill.logoSrc && (
<div className="icon text-center">
Expand Down
2 changes: 1 addition & 1 deletion src/data/skills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const skillsData: SkillType[] = [
},
{
name: 'django',
percent: 30,
percent: 10,
logoSrc: '/images/skills/django.svg',
},
]

0 comments on commit 7d48588

Please sign in to comment.