This React project demonstrates an interactive assistant animation system. It allows users to toggle between animations, control talking states, and view an animated assistant built with Lottie Player and styled with Ant Design and Emotion.
AssistantAnimationSample.jsx
: The main component allowing users to interact with and control the assistant animations.Assistant.jsx
: A reusable assistant component that displays the animation with a glowing container and optional "talking" state.animation-loading.json
: Lottie file for the loading animation.animation-wave.json
: Lottie file for the wave animation.AssistantAnimationSample
ComponentThis component provides a demo UI for controlling the assistant animation. Users can select an animation type and toggle whether the assistant is "talking."
import AssistantAnimationSample from "./AssistantAnimationSample";
function App() {
return (
<div className="App">
<AssistantAnimationSample />
</div>
);
}
The Assistant
component is a reusable unit that displays the animated assistant with a glowing container and configurable animation and talking states.
Assistant
Prop | Type | Description |
---|---|---|
isTalking |
Boolean | Controls whether the assistant "talks". |
src |
String | Lottie animation source file. |
<Assistant src="path-to-animation.json" isTalking={true} />
isTalking
prop is true
.This project uses Emotion for styling. Below is an example of the GlowContainer
style:
const Styled = {
GlowContainer: styled.div`
width: 278px;
height: 278px;
background: #ffffff;
box-shadow: 0px 0px 40.57px 20.285px rgba(5, 101, 223, 0.08);
border-radius: 633.273px;
display: flex;
justify-content: center;
align-items: center;
`,
};
This project uses the following libraries: