-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added global loading animation, instead of a specific one for feed lo…
…ad. The loading animation can be configured with different animations and sizes. Applied this loading animation to the feed load and to the groups load.
- Loading branch information
Showing
7 changed files
with
135 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
.content-loading-container { | ||
@include flex-column; | ||
height: fit-content; | ||
font-family: $secondaryFont; | ||
width: 100%; | ||
align-items: center; | ||
justify-content: center; | ||
margin-top: 8%; | ||
} | ||
|
||
.content-loading-icon { | ||
transform: scale(0.8); | ||
padding: 0; | ||
} | ||
|
||
.content-loading-message { | ||
display: flex; | ||
width: fit-content; | ||
font-size: 20px; | ||
font-family: $secondaryFont; | ||
align-items: center; | ||
justify-content: center; | ||
position: relative; | ||
gap: 6px; | ||
|
||
.dots { | ||
right: -1.15em; | ||
width: 1em; | ||
text-align: left; | ||
|
||
& > span { | ||
display: inline-block; | ||
opacity: 0; | ||
animation: blink 0.6s infinite; | ||
} | ||
|
||
.dot1 { | ||
animation-delay: 0s; | ||
} | ||
.dot2 { | ||
animation-delay: 0.2s; | ||
} | ||
.dot3 { | ||
animation-delay: 0.4s; | ||
} | ||
} | ||
} | ||
|
||
@keyframes blink { | ||
0%, | ||
20% { | ||
opacity: 1; | ||
} | ||
80%, | ||
100% { | ||
opacity: 0; | ||
} | ||
} | ||
|
||
@keyframes blink { | ||
0%, | ||
20% { | ||
opacity: 1; | ||
} | ||
80%, | ||
100% { | ||
opacity: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
|
||
interface LoadingAnimationProps { | ||
message: string; | ||
messageFontSize?: string; | ||
ripple?: "on" | "off"; | ||
dots?: "on" | "off"; | ||
} | ||
|
||
export default function LoadingAnimation({ | ||
message, | ||
messageFontSize = "20px", | ||
ripple = "on", | ||
dots = "on" | ||
}: LoadingAnimationProps) { | ||
return ( | ||
<div className="content-loading-container"> | ||
<div className="content-loading-message" style={{ fontSize: messageFontSize }}> | ||
{message} | ||
{dots === "on" && ( | ||
<span className="dots"> | ||
<span className="dot1">.</span> | ||
<span className="dot2">.</span> | ||
<span className="dot3">.</span> | ||
</span> | ||
)} | ||
</div> | ||
{ripple === "on" && ( | ||
<div className="content-loading-icon"> | ||
<div className="lds-ripple"> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters