Animation not fluid with ReactCSSTransitionGroup

Currently, I am in the process of developing an image carousel that showcases images moving smoothly from right to left. However, despite its functionality, there seems to be a slight jaggedness in the animation that I can't seem to resolve. Interestingly, when I tested the carousel on a fiddle, it performed better compared to my actual site. I suspect that the dimensions of the images might be causing this issue. For further details and to view the fiddle, please visit here.

React code

    const ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;

    const ImageArray = ["https://media-cdn.tripadvisor.com/media/photo-s/09/c7/bc/96/the-bull-ring-arena.jpg", "https://media-cdn.tripadvisor.com/media/photo-s/0d/0a/cb/5d/the-bull-ring-arena-ext.jpg"];

    class CarouselImage extends React.Component{

     componentDidMount(){

     }

     render(){
         return (
            <div className="all-detail-images">
             <img  ref="bull" className="blurred-background" src={this.props.src} alt="detail image"/>
             <img  ref="bullRing" className="detail-image-style" src={this.props.src} alt="detail image"/>
            </div>

         )
     }
    }

    class Carousel extends React.Component{

     constructor(props) {
        super(props);
        this.state = {position: 0};
      }

     componentDidMount(){
       setInterval( () => {
         if(this.state.position){
           this.setState({position: 0});
         }else{
             this.setState({position: 1});
         }

       },6000);

      }

     render(){
       return (
        <div className="image-gallery-div">
          <ReactCSSTransitionGroup transitionName="carousel-image"
                                   transitionLeaveTimeout={1000}
                                   transitionEnterTimeout={1000}>

           <CarouselImage src={ImageArray[this.state.position]} key={this.state.position}/>

         </ReactCSSTransitionGroup>
           </div>
       )
     }
    }

         class HelloWidget extends React.Component{
           constructor(props) {
             super(props);
             this.handleChange = this.handleChange.bind(this)
             this.state = {
                   name: ''
             };
           }

           handleChange(e) {
             this.setState({
               name: e.target.value
             });
           }

           render() {
               return <div className="max-width-carousel">
                   <Carousel /> </div>;
           }
         }

         React.render(<HelloWidget />, document.getElementById('container'));

CSS

 .max-width-carousel{
      width: 100%;
      max-width: 100%;
      overflow: hidden;
      height: 75vh;
    }

    .all-detail-images{
      z-index: 0;
      width: 100%;
      height: 75vh;
      position: relative;
      overflow: hidden;
      float: left;
    }

    .blurred-background{
        filter:blur(3px);
        width: 100%;
        height: 100%;
    }


    .image-gallery-div{
      top: 0;
      width: 100%;
      text-align: center;
      overflow: hidden;
    }

    .detail-image-style{
      height : 75vh;
      max-width: 100%;
      position: absolute;
      z-index: 5;
      left: 0;
      right: 0;
      margin: auto;
    }



      .carousel-image-enter {
       margin-left: 100%;
      }

      .carousel-image-enter.carousel-image-enter-active {
         margin-left: 0%;
         transition: all 1s linear;
      }

      .carousel-image-leave {
        position: absolute;
        top:0;
        left:0;
      }

      .carousel-image-leave.carousel-image-leave-active {
         transition: all 1s linear;
         left: -100%;
      }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Looking to integrate WhatsApp into your next.js website for optimal responsiveness?

I am trying to incorporate WhatsApp into my next.js responsive website. I have already added an icon which successfully opens the WhatsApp web version when clicked in desktop view. However, I want to make sure that when a user accesses the website on mobi ...

the nextjs model is throwing a 400 bad request error when fetching data

I need some assistance with my web application. Whenever I try to create a record by sending data to the API endpoint, it always returns a 400 bad request error on the front end. Surprisingly, when I tested the same request in Insomnia, everything worked p ...

Prevent deletion of already uploaded images in Blueimp by disabling the delete button

After using the blueimp upload script to upload files, I noticed that the file information is saved in a data table along with the upload timestamp. However, when I go to edit the form, the files reappear. The simple task I want to achieve is disabling th ...

What is the best way to structure a hierarchy in an array or object data using Node.js?

I have the following data arrangement: [{ Country: 'USA', State: 'CA', City: 'LA', District: 'LA-1',Town: 'LA-1,LA-1a,LA_AZ_A',Area: 'Area 51'}, { Country: 'USA', State: 'CA&ap ...

Identify numbers and words within a sentence and store them in an array

Looking to split a string into an array based on type, extracting numbers and floats. The current code is able to extract some values but not complete. var arr = "this is a string 5.86 x10ā€˜9/l 1.90 7.00" .match(/\d+\.\d+|\d+&bsol ...

Operator not recognized in React Native

I encountered an error while running my application. Here are the versions I am using: "@react-native-community/masked-view": "^0.1.10", "@react-navigation/bottom-tabs": "^5.7.3", "@react-navigation/drawer" ...

Customize your Material-UI theme with a unique hover effect for contained buttons

Currently, I am in the process of setting up a theme for Material-Ui on my React application. Within the app, there are two types of buttons that I utilize - contained and outlined. The issue lies with the hover effect on the contained button (while the ou ...

JavaScript: Invoking a nested function within a namespace

script1.js var MyNamespace = {}; MyNamespace.addNewFunction = function(a,b,c) { function doSomething() { // Perform some action here } } script2.js MyNamespace.addNewFunction.doSomething() ?? Iā€™m a bit unsure on how to access the content ...

Acquire the current audio video stream directly from the web browser

Currently, I am utilizing a JavaScript library that internally invokes getUserMedia. My objective is to access the stream object that has already been initiated. Unfortunately, the library does not provide any means to retrieve it. Is there a method avai ...

SwitchMap in Typescript allows you to switch to a

In my TypeScript code, I have implemented multiple interfaces, components, and a key/interface map. interface FooProps { 'keyInFoo': string } const Foo = (props: FooProps) => {} interface BarProps { 'keyInBar': string } cons ...

Is there a way to convert an empty string to zero in MySQL?

Can you help with answering my question? My question pertains to saving an empty string "" value in my table and storing it as a 0 value in the MySQL database. Here is a visual representation: Table -> MySQL "" 0 Thank you for your assi ...

Display a variety of body background images depending on the user's selection

Is it possible to change the background of the page when an option is selected from a dropdown menu? Additionally, can this be achieved with a smooth fade in and fade out animation? Here is a code example on CodePen. body ...

Fine-tuning the design of the Box Model layout

I can't seem to get the table in my code to center properly and not be stuck against the left border. Despite trying various solutions, the table in column 2 is floating off to the left and touching the border. I need it to be more centered within the ...

The bottom of the page refuses to remain anchored

I've exhausted all possible solutions and my footer just refuses to stay at the bottom of the page. Working with Opencart has made it challenging for me to pinpoint the root cause, leaving me utterly perplexed. The issue persists on pages with minim ...

Guide to Spidermonkey Bytecode Documentation

I've been searching for a comprehensive guide to spidermonkey's bytecodes for some time now, or at least something that gives me an overview of their purpose. Does anyone know of a good resource for this? Thank you! ...

Troubles encountered with example code: Nested class in an exported class - Integrating Auth0 with React and Node.js

I am currently attempting to execute tutorial code in order to create an authentication server within my React project. Below is the code snippet provided for me to run: // src/Auth/Auth.js const auth0 = require('auth0-js'); class Auth { co ...

Mapbox GL - Incorporate a non-scaling polygon feature during zoom operations

Is there a method to incorporate a polygon that maintains its size regardless of zooming? Currently, when adding a polygon circle shape with a 10-meter radius and zooming out, the polygon shrinks in size as expected. However, is it feasible to include a s ...

Angular Inner Class

As a newcomer to Angular, I have a question about creating nested classes in Angular similar to the .NET class structure. public class BaseResponse<T> { public T Data { get; set; } public int StatusCo ...

React re-rendering only when arrays are filtered, and not when new elements are added

I need help with a table simulation where I can add and remove products. The issue I'm facing is that the component only updates when an item is removed, not when a new row is added. Currently, I am utilizing the useState hook. Below is my array data ...

Allowing CSS to break long words but not spaces for better readability

Imagine you have the following paragraph: thisisaverylongwordthatneverbreaks Applying word-wrap:break-word; results in: thisisaverylongwordthat neverbreaks This works well, but what if I try: this is avery long word that has spaces The output becom ...