Skip to content

Commit

Permalink
🏎 Improve those blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
keithrfung committed Jan 27, 2023
1 parent dc2add5 commit a4cb2cd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
20 changes: 16 additions & 4 deletions src/components/AnimatedBackground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const blobVariations = [
startY: "0vh",
endX: "100vw",
endY: "100vh",
duration: 5,
rotate: 35,
},
{
color: "spiroDiscoBall",
Expand All @@ -36,6 +38,8 @@ const blobVariations = [
startY: "60vh",
endX: "20vw",
endY: "0vh",
duration: 35,
ease: "easeIn",
},
{
color: "darkTopaz",
Expand All @@ -44,6 +48,14 @@ const blobVariations = [
endX: "95vw",
endY: "20vh",
},
{
color: "darkLavender",
startX: "80vw",
startY: "30vh",
endX: "10vw",
endY: "50vh",
duration: 5,
},
];

export const AnimatedBackground: FC = () => {
Expand Down Expand Up @@ -91,7 +103,7 @@ export const AnimatedBackground: FC = () => {
}}
>
{blobs.map((Blob, index) => {
const { color, startX, startY, endX, endY, ease } =
const { color, startX, startY, endX, endY, duration, rotate, ease } =
blobVariations[index];
return (
<motion.div
Expand All @@ -111,12 +123,12 @@ export const AnimatedBackground: FC = () => {
transition={{
repeatType: "reverse",
repeat: Infinity,
duration: 30,
rotate: 20,
duration: duration || 30,
rotate: rotate || 20,
ease: ease || "linear",
}}
>
<Blob sx={{ height: blobHeight, color }} />
<Blob sx={{ height: blobHeight, color: color || "white" }} />
</motion.div>
);
})}
Expand Down
2 changes: 1 addition & 1 deletion src/gatsby-plugin-theme-ui/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const COLORS = {
cultured: "#f8f8f8",
spaceCadet: "#212650",
purpleHeart: "#724e96",
purpleHeart: "#8957a0",
darkLavender: "#724e96",
diamond: "#c1e5f3",
spiroDiscoBall: "#1abbee",
Expand Down
5 changes: 5 additions & 0 deletions src/svgs/blobs/blob-5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/svgs/blobs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { default as Blob1 } from "./blob-1.svg";
import { default as Blob2 } from "./blob-2.svg";
import { default as Blob3 } from "./blob-3.svg";
import { default as Blob4 } from "./blob-4.svg";
import { default as Blob5 } from "./blob-5.svg";

export const blobs = [Blob1, Blob2, Blob3, Blob4];
export const blobs = [Blob1, Blob2, Blob3, Blob4, Blob5];

0 comments on commit a4cb2cd

Please sign in to comment.