Skip to content

Commit

Permalink
fix: svgs not visible on non-web environments
Browse files Browse the repository at this point in the history
  • Loading branch information
anup-a committed Aug 15, 2022
1 parent 467b294 commit 510f918
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
20 changes: 8 additions & 12 deletions src/components/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,8 @@ function Home({ isDark, toggleDarkMode }) {
x2={Math.round(50 + Math.sin(anglePI + Math.PI) * 50) + '%'}
y2={Math.round(50 + Math.cos(anglePI + Math.PI) * 50) + '%'}
>
<stop
offset="5%"
stopColor={`${gradColors.colorOne}${opac[index]}`}
/>
<stop
offset="95%"
stopColor={`${gradColors.colorTwo}${opac[index]}`}
/>
<stop offset="5%" stopColor={`${gradColors.colorOne}`} />
<stop offset="95%" stopColor={`${gradColors.colorTwo}`} />
</linearGradient>
</defs>,
)
Expand All @@ -120,7 +114,8 @@ function Home({ isDark, toggleDarkMode }) {
d={p.d}
stroke={p.strokeColor}
strokeWidth={p.strokeWidth}
fill={gradient ? `url(#gradient)` : `${bgColor}${opac[index]}`}
fill={gradient ? `url(#gradient)` : `${bgColor}`}
fillOpacity={opac[index]}
className={`transition-all duration-300 ease-in-out delay-150 path-${index}`}
transform={invert ? transformData : p.transform}
></path>,
Expand Down Expand Up @@ -157,13 +152,13 @@ function Home({ isDark, toggleDarkMode }) {
offset="5%"
stopColor={`${
invert ? gradColors.colorTwo : gradColors.colorOne
}${opac[index]}`}
}`}
/>
<stop
offset="95%"
stopColor={`${
invert ? gradColors.colorOne : gradColors.colorTwo
}${opac[index]}`}
}`}
/>
</linearGradient>
</defs>,
Expand All @@ -183,7 +178,8 @@ function Home({ isDark, toggleDarkMode }) {
d={p.d}
stroke={p.strokeColor}
strokeWidth={p.strokeWidth}
fill={gradient ? 'url(#gradient)' : `${bgColor}${opac[index]}`}
fill={gradient ? 'url(#gradient)' : `${bgColor}`}
fillOpacity={opac[index]}
className="transition-all duration-300 ease-in-out delay-150"
transform={p.transform}
></path>
Expand Down
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const OPACITY = 33

export const OPACITY_ARR = ['44', '66', '88', 'ff']
export const OPACITY_ARR = [0.265, 0.4, 0.53, 1]

export const MAX_WAVES = 4

Expand Down

0 comments on commit 510f918

Please sign in to comment.