migrating from lottie-react to react-lottie
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a9684b8312
commit
b77d622a03
|
|
@ -3,18 +3,24 @@
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
top: 0;
|
||||||
|
// justify-content: center;
|
||||||
|
// align-items: center;
|
||||||
|
|
||||||
&__animation {
|
&__animation {
|
||||||
max-width: 100vh;
|
max-width: 50vh;
|
||||||
max-height: 100vw;
|
max-height: 50vw;
|
||||||
margin: auto;
|
margin: 0 auto;
|
||||||
-webkit-transform: scaleX(-1);
|
-webkit-transform: scaleX(-1);
|
||||||
transform: scaleX(-1);
|
transform: scaleX(-1);
|
||||||
animation: translate 2s infinite linear;
|
animation: translate 2s infinite linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__text {
|
&__text {
|
||||||
@apply text-7xl tracking-wider text-zuume text-white text-center;
|
@apply text-7xl tracking-wider text-zuume text-white text-center pt-8;
|
||||||
transform: translate(0, -50px);
|
transform: translate(0, -50px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import cloudPageTransition from "../../assets/animations/transition-nuages-pages";
|
import cloudPageTransition from "../../assets/animations/transition-nuages-pages";
|
||||||
import Lottie from "lottie-react";
|
import Lottie from "react-lottie";
|
||||||
|
|
||||||
export default function Clouds() {
|
export default function Clouds() {
|
||||||
|
const defaultOptions = {
|
||||||
|
loop: true,
|
||||||
|
autoplay: true,
|
||||||
|
animationData: cloudPageTransition,
|
||||||
|
rendererSettings: {
|
||||||
|
preserveAspectRatio: "xMidYMid slice",
|
||||||
|
},
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<Lottie
|
<div className='cloud-animation'>
|
||||||
className='cloud-animation'
|
<Lottie options={defaultOptions} />
|
||||||
animationData={cloudPageTransition}
|
</div>
|
||||||
speed={21}
|
|
||||||
loop={false}
|
|
||||||
autoplay
|
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Lottie from "lottie-react";
|
import Lottie from "react-lottie";
|
||||||
|
|
||||||
import loadingTruck from "../../assets/animations/chargement-vehicules-boom.json";
|
import loadingTruck from "../../assets/animations/chargement-vehicules-boom.json";
|
||||||
|
|
||||||
import { useUser } from "../../hooks/useUser";
|
import { useUser } from "../../hooks/useUser";
|
||||||
|
|
||||||
export default function Loading() {
|
export default function Loading() {
|
||||||
|
|
@ -9,9 +9,20 @@ export default function Loading() {
|
||||||
|
|
||||||
if (!screensTranslations || !screensTranslations?.ui?.loading) return;
|
if (!screensTranslations || !screensTranslations?.ui?.loading) return;
|
||||||
|
|
||||||
|
const defaultOptions = {
|
||||||
|
loop: true,
|
||||||
|
autoplay: true,
|
||||||
|
animationData: loadingTruck,
|
||||||
|
rendererSettings: {
|
||||||
|
preserveAspectRatio: "xMidYMid slice",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='loading'>
|
<div className='loading'>
|
||||||
<Lottie className='loading__animation' animationData={loadingTruck} loop autoplay />
|
<div className='loading__animation'>
|
||||||
|
<Lottie options={defaultOptions} />
|
||||||
|
</div>
|
||||||
<p className='loading__text'>{screensTranslations.ui.loading}...</p>
|
<p className='loading__text'>{screensTranslations.ui.loading}...</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
import React from "react";
|
|
||||||
import Lottie from "lottie-react";
|
|
||||||
|
|
||||||
import animationData from "../../assets/animations/test.json";
|
|
||||||
|
|
||||||
export default function TestAnimation() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<p>salut</p>
|
|
||||||
{/* <Lottie className='renardLoading' animationData={animationData} loop autoplay /> */}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import Lottie from "lottie-react";
|
import Lottie from "react-lottie";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import Loading from "../animations/Loading";
|
import Loading from "../animations/Loading";
|
||||||
|
|
||||||
|
|
@ -59,18 +59,31 @@ export default function ResultsModals({ resultsDatas }) {
|
||||||
return (
|
return (
|
||||||
<Modal className='results-modal' open={isModalOpen} onClose={goRating}>
|
<Modal className='results-modal' open={isModalOpen} onClose={goRating}>
|
||||||
<div className='modal-content-container game-question-container'>
|
<div className='modal-content-container game-question-container'>
|
||||||
<Lottie
|
<div className='modal-content-container__celebration'>
|
||||||
className='modal-content-container__celebration'
|
<Lottie
|
||||||
animationData={celebrationConfettis}
|
options={{
|
||||||
loop
|
loop: true,
|
||||||
autoplay
|
autoplay: true,
|
||||||
/>
|
animationData: celebrationConfettis,
|
||||||
<Lottie
|
rendererSettings: {
|
||||||
className='modal-content-container__celebration-confettis-fixe'
|
preserveAspectRatio: "xMidYMid slice",
|
||||||
animationData={celebrationConfettisFixe}
|
},
|
||||||
loop={false}
|
}}
|
||||||
autoplay
|
/>
|
||||||
/>
|
</div>
|
||||||
|
<div className='modal-content-container__celebration-confettis-fixe'>
|
||||||
|
<Lottie
|
||||||
|
options={{
|
||||||
|
loop: false,
|
||||||
|
autoplay: true,
|
||||||
|
animationData: celebrationConfettisFixe,
|
||||||
|
rendererSettings: {
|
||||||
|
preserveAspectRatio: "xMidYMid slice",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1 className='titling-construction '>
|
<h1 className='titling-construction '>
|
||||||
{currentScreenTranslations.results_screen_title}
|
{currentScreenTranslations.results_screen_title}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Lottie from "lottie-react";
|
import Lottie from "react-lottie";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
import animationDeplacement from "../../assets/animations/ecran-deplacement.json";
|
import animationDeplacement from "../../assets/animations/ecran-deplacement.json";
|
||||||
|
|
@ -17,6 +17,12 @@ export default function MoveAround({ setNextSlide }) {
|
||||||
animate: { x: "0%", opacity: 1 },
|
animate: { x: "0%", opacity: 1 },
|
||||||
exit: { x: "-100%", opacity: 0 },
|
exit: { x: "-100%", opacity: 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultOptions = {
|
||||||
|
loop: true,
|
||||||
|
autoplay: true,
|
||||||
|
animationData: animationDeplacement,
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
key='tutorial-move'
|
key='tutorial-move'
|
||||||
|
|
@ -38,12 +44,9 @@ export default function MoveAround({ setNextSlide }) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='modal-content-container__cover'>
|
<div className='modal-content-container__cover'>
|
||||||
<Lottie
|
<div className='tutorial-container__animated-cover'>
|
||||||
className='tutorial-container__animated-cover'
|
<Lottie options={defaultOptions} />
|
||||||
animationData={animationDeplacement}
|
</div>
|
||||||
loop
|
|
||||||
autoplay
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Lottie from "lottie-react";
|
import Lottie from "react-lottie";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
import animationPoints from "../../assets/animations/ecran-points.json";
|
import animationPoints from "../../assets/animations/ecran-points.json";
|
||||||
|
|
@ -19,6 +19,12 @@ export default function PointsAndTime({ setNextSlide, setPreviousSlide, startGam
|
||||||
exit: { x: "-100%", opacity: 0 },
|
exit: { x: "-100%", opacity: 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultOptions = {
|
||||||
|
loop: true,
|
||||||
|
autoplay: true,
|
||||||
|
animationData: animationPoints,
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
key='tutorial-points'
|
key='tutorial-points'
|
||||||
|
|
@ -46,12 +52,9 @@ export default function PointsAndTime({ setNextSlide, setPreviousSlide, startGam
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='modal-content-container__cover'>
|
<div className='modal-content-container__cover'>
|
||||||
<Lottie
|
<div className='tutorial-container__animated-cover'>
|
||||||
className='tutorial-container__animated-cover'
|
<Lottie options={defaultOptions} />
|
||||||
animationData={animationPoints}
|
</div>
|
||||||
loop
|
|
||||||
autoplay
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Lottie from "lottie-react";
|
import Lottie from "react-lottie";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
import animationPoints from "../../assets/animations/ecran-deroulement.json";
|
import animationDeroulement from "../../assets/animations/ecran-deroulement.json";
|
||||||
import Loading from "../animations/Loading";
|
import Loading from "../animations/Loading";
|
||||||
import { useUser } from "../../hooks/useUser";
|
import { useUser } from "../../hooks/useUser";
|
||||||
|
|
||||||
|
|
@ -18,6 +18,11 @@ export default function Walkthrough({ setNextSlide, setPreviousSlide }) {
|
||||||
animate: { x: "0%", opacity: 1 },
|
animate: { x: "0%", opacity: 1 },
|
||||||
exit: { x: "-100%", opacity: 0 },
|
exit: { x: "-100%", opacity: 0 },
|
||||||
};
|
};
|
||||||
|
const defaultOptions = {
|
||||||
|
loop: true,
|
||||||
|
autoplay: true,
|
||||||
|
animationData: animationDeroulement,
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
key='tutorial-walthrought'
|
key='tutorial-walthrought'
|
||||||
|
|
@ -43,12 +48,9 @@ export default function Walkthrough({ setNextSlide, setPreviousSlide }) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='modal-content-container__cover'>
|
<div className='modal-content-container__cover'>
|
||||||
<Lottie
|
<div className='tutorial-container__animated-cover'>
|
||||||
className='tutorial-container__animated-cover'
|
<Lottie options={defaultOptions} />
|
||||||
animationData={animationPoints}
|
</div>
|
||||||
loop
|
|
||||||
autoplay
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ export default function About() {
|
||||||
<AnimatedPage className='page-container page-container--about '>
|
<AnimatedPage className='page-container page-container--about '>
|
||||||
<div className='content-page '>
|
<div className='content-page '>
|
||||||
<Nav />
|
<Nav />
|
||||||
|
|
||||||
<Loading />
|
<Loading />
|
||||||
</div>
|
</div>
|
||||||
</AnimatedPage>
|
</AnimatedPage>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ import { useUser } from "../hooks/useUser";
|
||||||
import LanguageSelect from "../components/ui/LanguageSelect";
|
import LanguageSelect from "../components/ui/LanguageSelect";
|
||||||
|
|
||||||
import truckAnimation from "../assets/animations/chargement-vehicules";
|
import truckAnimation from "../assets/animations/chargement-vehicules";
|
||||||
import Lottie from "lottie-react";
|
|
||||||
|
import Lottie from "react-lottie";
|
||||||
import Loading from "../components/animations/Loading";
|
import Loading from "../components/animations/Loading";
|
||||||
|
|
||||||
export default function Welcome() {
|
export default function Welcome() {
|
||||||
|
|
@ -14,10 +15,21 @@ export default function Welcome() {
|
||||||
if (!screensTranslations || !screensTranslations.welcome) return <Loading />;
|
if (!screensTranslations || !screensTranslations.welcome) return <Loading />;
|
||||||
const currentScreenTranslations = screensTranslations.welcome;
|
const currentScreenTranslations = screensTranslations.welcome;
|
||||||
|
|
||||||
|
const defaultOptions = {
|
||||||
|
loop: true,
|
||||||
|
autoplay: true,
|
||||||
|
animationData: truckAnimation,
|
||||||
|
rendererSettings: {
|
||||||
|
preserveAspectRatio: "xMidYMid slice",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AnimatedPage className='page-container page-container--welcome'>
|
<AnimatedPage className='page-container page-container--welcome'>
|
||||||
<AppLogoMarkup />
|
<AppLogoMarkup />
|
||||||
<Lottie className='truck-animation' animationData={truckAnimation} loop autoplay />
|
<div className='truck-animation'>
|
||||||
|
<Lottie options={defaultOptions} />
|
||||||
|
</div>
|
||||||
<div className='interaction-buttons'>
|
<div className='interaction-buttons'>
|
||||||
<LanguageSelect />
|
<LanguageSelect />
|
||||||
<Link
|
<Link
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user