-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
154 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,114 @@ | ||
.typingIndicator { | ||
align-items: center; | ||
background-color: var(--white); | ||
border-radius: 15px; | ||
border: 1px solid var(--black-80); | ||
box-sizing: border-box; | ||
display: flex; | ||
gap: 6px; | ||
height: 44px; | ||
justify-content: center; | ||
padding-block: 10px; | ||
padding-inline: 10px; | ||
width: 62px; | ||
margin-block: var(--webchat-message-margin-block, 24px); | ||
margin-inline: var(--webchat-message-margin-inline, 20px); | ||
} | ||
|
||
.dot { | ||
background: var(--black-40); | ||
border-radius: 999px; | ||
width: 6px; | ||
height: 6px; | ||
} | ||
|
||
.dot:nth-child(1), | ||
.dot:nth-child(2), | ||
.dot:nth-child(3) { | ||
animation-duration: 0.9s; | ||
animation-timing-function: ease-in-out; | ||
animation-fill-mode: both; | ||
animation-iteration-count: infinite; | ||
animation-delay: -1000ms; | ||
} | ||
|
||
.dot:nth-child(1) { | ||
animation-name: dot1; | ||
} | ||
|
||
.dot:nth-child(2) { | ||
animation-name: dot2; | ||
} | ||
|
||
.dot:nth-child(3) { | ||
animation-name: dot3; | ||
} | ||
|
||
@media (prefers-reduced-motion) { | ||
.dot { | ||
animation: none !important; | ||
} | ||
} | ||
|
||
@keyframes dot1 { | ||
0% { | ||
transform: translateY(0); | ||
} | ||
20% { | ||
transform: translateY(-3px); | ||
} | ||
40% { | ||
transform: translateY(-6px); | ||
} | ||
60% { | ||
transform: translateY(-3px); | ||
} | ||
80% { | ||
transform: translateY(0); | ||
} | ||
100% { | ||
transform: translateY(0); | ||
} | ||
} | ||
|
||
@keyframes dot2 { | ||
0% { | ||
transform: translateY(0); | ||
} | ||
20% { | ||
transform: translateY(0); | ||
} | ||
40% { | ||
transform: translateY(-3px); | ||
} | ||
60% { | ||
transform: translateY(-6px); | ||
} | ||
80% { | ||
transform: translateY(-3px); | ||
} | ||
100% { | ||
transform: translateY(0); | ||
} | ||
} | ||
|
||
@keyframes dot3 { | ||
0% { | ||
transform: translateY(0); | ||
} | ||
20% { | ||
transform: translateY(0); | ||
} | ||
40% { | ||
transform: translateY(0); | ||
} | ||
60% { | ||
transform: translateY(-3px); | ||
} | ||
80% { | ||
transform: translateY(-6px); | ||
} | ||
100% { | ||
transform: translateY(-3px); | ||
} | ||
} |
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,25 @@ | ||
import { FC } from "react"; | ||
import classes from "./TypingIndicator.module.css"; | ||
import classnames from "classnames"; | ||
|
||
interface ITypingIndicator { | ||
className?: string; | ||
} | ||
|
||
const TypingIndicator: FC<ITypingIndicator> = props => { | ||
const classNames = classnames( | ||
classes.typingIndicator, | ||
props.className, | ||
"webchat-typing-indicator", | ||
); | ||
|
||
return ( | ||
<div className={classNames}> | ||
<div className={classes.dot}></div> | ||
<div className={classes.dot}></div> | ||
<div className={classes.dot}></div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TypingIndicator; |
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,2 @@ | ||
import TypingIndicator from "./TypingIndicator"; | ||
export default TypingIndicator; |
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