Skip to content

Commit

Permalink
Add horizontal loading
Browse files Browse the repository at this point in the history
  • Loading branch information
vineethasok committed Oct 9, 2023
1 parent c98b494 commit fc79ef1
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Icon/IconCommon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import FolderOpen from "../icons/FolderOpen";
import FolderClosed from "../icons/FolderClosed";
import Gift from "@/components/icons/Gift";
import Home from "@/components/icons/Home";
import HorizontalLoading from "@/components/icons/HorizontalLoading";
import Http from "@/components/icons/Http";
import Integrations from "@/components/icons/Integrations";
import LightBulb from "@/components/icons/LightBulb";
Expand Down Expand Up @@ -155,6 +156,7 @@ export const ICONS_MAP = {
gift: Gift,
history: HistoryIcon,
home: Home,
"horizontal-loading": HorizontalLoading,
http: Http,
"info-in-circle": InfoInCircleIcon,
information: InformationIcon,
Expand Down
1 change: 1 addition & 0 deletions src/components/Icon/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export type IconName =
| "folder-open"
| "gift"
| "history"
| "horizontal-loading"
| "home"
| "http"
| "info-in-circle"
Expand Down
69 changes: 69 additions & 0 deletions src/components/icons/HorizontalLoading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import DotsHorizontal from "./DotsHorizontal";
import styled, { keyframes } from "styled-components";

const animationCircle1 = keyframes`
0 {
r: 0;
}
30% {
r: 1.5;
}
60% {
r: 0;
}
100% {
r: 0;
}
`;
const animationCircle2 = keyframes`
0 {
r: 0;
}
20% {
r: 0;
}
40% {
r: 1.5;
}
80% {
r: 0;
}
100% {
r: 0
}
`;
const animationCircle3 = keyframes`
0 {
r: 0;
}
40% {
r: 0;
}
80% {
r: 1.5;
}
100% {
r: 0
}
`;

const HorizontalLoading = styled(DotsHorizontal)`
circle {
r: 0;
animation-name: example;
animation-duration: 1.5s;
animation-iteration-count: infinite;
animation-timing-function: linear;
&:nth-child(1) {
animation-name: ${animationCircle1};
}
&:nth-child(2) {
animation-name: ${animationCircle2};
}
&:nth-child(3) {
animation-name: ${animationCircle3};
}
}
`;

export default HorizontalLoading;

0 comments on commit fc79ef1

Please sign in to comment.