From cd680de68b9bd41cb9cdc5c82eb006be5f25399f Mon Sep 17 00:00:00 2001 From: NCanggoro Date: Wed, 27 Sep 2023 21:55:21 +0700 Subject: [PATCH] add spinner loading component --- src/components/Loading/Spinner/index.tsx | 6 ++++++ src/components/Loading/Spinner/style.css | 16 ++++++++++++++++ src/components/index.ts | 6 +++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/components/Loading/Spinner/index.tsx create mode 100644 src/components/Loading/Spinner/style.css diff --git a/src/components/Loading/Spinner/index.tsx b/src/components/Loading/Spinner/index.tsx new file mode 100644 index 0000000..d6aad4a --- /dev/null +++ b/src/components/Loading/Spinner/index.tsx @@ -0,0 +1,6 @@ +import './style.css' +export default function SpinnerLoading() { + return ( +
+ ) +} \ No newline at end of file diff --git a/src/components/Loading/Spinner/style.css b/src/components/Loading/Spinner/style.css new file mode 100644 index 0000000..aa99ddb --- /dev/null +++ b/src/components/Loading/Spinner/style.css @@ -0,0 +1,16 @@ +@keyframes spinner { + to {transform: rotate(360deg);} +} + +.spinner:before { + content: ''; + box-sizing: border-box; + position: relative; + display: inline-block; + width: 16px; + height: 16px; + border-radius: 50%; + border: 2px solid #ccc; + border-top-color: #000; + animation: spinner .7s linear infinite; +} \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index 69f5ba8..71ea9d4 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -4,10 +4,14 @@ import DefaultSeparator from "./Separator/Default"; import Footer from './Footer/'; import CustomInterweave from "./CustomInterweave"; +import SpinnerLoading from "./Loading/Spinner"; + export { Header, SeparatorWithAnchor, DefaultSeparator, Footer, - CustomInterweave + CustomInterweave, + + SpinnerLoading, } \ No newline at end of file