I created an onClick function to change my data and image what my task to and animation on it like when onClick execute animation also added I need to set like fadeUp mean mean data is changing its go up and fade with animation you can SEE my code sandbox link this is my Reactjs app.
.parent {
display: flex;
justify-content:space-evenly;
align-items: center;
}
.left img {
flex: 50%;
top: 3206px;
left: 164px;
width: 150px;
height: 300px;
animation:ease-in-out 1s;
opacity: 1;
}
.right{
flex: 50%;
width: 1%;
height: 10%;
right: 15px;
cursor: pointer;
color: black;
font-weight: 500;
font-size: 1.2em;
font: normal normal normal 17px/30px Poppins;
letter-spacing: 0px;
opacity: 0.9;
}
.animation {
transition: ease-in-out;
transition-delay: 1000s;
color: blue;
transform: translate3d(75%,200%,0);
transform: translate3d(75%,0,0);
transform: translate3d(75%,-100%,0);
}
import { render } from "react-dom";
import React, { useState, useCallback } from "react";
// import { useTransition, animated } from "react-spring";
import "./styles.css";
import image1 from "../img/first.jpg";
import image2 from "../img/second.jpg";
import image3 from "../img/thrid.jpg";
let content = [ "Solytics’ Global Watchlists are a comprehensive collection of caution lists from all major sanctioning bodies, law enforcement agencies and financial regulators worldwide. We continually update, add regulatory and enhanced due diligence data and lists, offering you the most up-to-date and accurate information to help protect your business",
"We collect, maintain and update record of individuals elected or appointed to a PEP position or their immediate relatives or close associates. The research and identification of such individuals are based on the definition provided by the FATF and expanded definitions offered by the Wolfsberg Group, USA PATRIOT Act, EU Money Laundering Directive and the World Bank, as well as country-specific PEP definitions. The list also includes board members, chairmen, directors and senior executives of state-owned enterprises",
"Our database currently pull together negative news from ~10mn webpages rom 20,000+ sources for 50+ languages. The crawlers have capability to extract information from Json, Pdf, CSV based data"
];
const image = [image1, image2, image3];
function App() {
let [count, setCount] = useState(0);
const click = () => {
if (count < 2) {
setCount(count => count + 1);
} else {
setCount(0);
}
};
// window.addEventListener('scroll', onScroll, false)
return (
<div className="parent">
<div className="left" onClick={click}>
<img src={image[count]} alt="hello" />
</div>
<div className=" right simple-trans-main" onClick={click}>
<div>
<p>{content[count]}</p>
</div>
</div>
</div>
);
}
export default App;