presentation not transitioning smoothly as the next slide appears

Initially, my aim is to center the slideshow on the page but I am uncertain about how to achieve it.

This is how my current webpage appears:

https://i.sstatic.net/E6bzQ.png

Furthermore, as shown in the image, the sliding effect of the blue slide is moving towards the right instead of fading out, and I want to hide it completely.

In the diagram, the slides are supposed to move left (indicated by red arrows) while staying hidden when going right (indicated by blue arrows). https://i.sstatic.net/K9gG4.png

Any suggestions on how I can implement this?

Link to the page:

import "./Home.css";
import React from "react";
import { Link } from "react-router-dom";
import {Slideshow, SlideshowItem } from "../components/slideShow.js"
import BitCoinImg from "../images/bitcoin.jpg"
import ethImg from "../images/eth.jpg"
import litecoinImg from "../images/Litecoin.jpg"


function Home() {
  return(
    <div style={{textAlign:"center", fontFamily:"Comic Sans MC", fontSize:"100"}}>
      THIS IS THE HOME PAGE

      <nav>
        <Link to="/bitcoin" style={{margin: "10px"}}> Bitcoin </Link>
        <Link to="/litecoin" style={{margin: "10px"}}> LiteCoin </Link>
        <Link to="/ethereum" style={{margin: "10px"}}> Ethereum </Link>
      </nav>

      <Slideshow>
      <SlideshowItem>
          <img src= {BitCoinImg}/>
        </SlideshowItem>
        <SlideshowItem>
          <img src= {litecoinImg}/>
        </SlideshowItem>
        <SlideshowItem>
          <img src= {ethImg}/>
        </SlideshowItem>
      </Slideshow>
    </div>
  )
}

export default Home;

Corresponding CSS file:

.gallery-container {
    overflow: hidden;
    position: relative;
  }

.gallery-slider {
    position: absolute;
    display: flex;
    height: 100%;
    justify-content: center;
    align-items: center;
  }

Answer №1

To showcase one image per slide, adjust the slider property: items to show to 1. This will ensure that your slider displays the items at the correct width, with subsequent images not visible.

If you are unable to set this property in your slider, consider styling the slider container and slide item to control the display of images.

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

Filtering JSON data by date range in React JS

I have a dataset with JSON data containing ISO dates, and my goal is to filter out entries based on the "date_created" field falling within a specific date range. The time component should be ignored in this comparison, and the original JSON data should re ...

Utilizing React with a Bootstrap Select element populated by an API call. Following form submission, I aim to automatically deselect the previously selected

After submitting the form, I am trying to reset the state to an empty value for the dropdown menu, but the selected item still appears before submitting the form. Any assistance in identifying the issue would be greatly appreciated. Thank you. Please see ...

How can I adjust the padding and width attributes of the mat-menu in Angular 5

Today, I am struggling with a piece of code. Whenever I click on the Details button, it is supposed to open a mat-menu. However, for some reason, I cannot seem to adjust the padding or width of the menu: <div id="box-upload" [hidden]="hiddenBoxUpload" ...

Text display appears uneven

After downloading the 'exo' font from Google Fonts, I was pleased with how it appeared on my htc smartphone. However, on my laptop screen, it looked as if a swarm of caterpillars had nibbled away at it. I attempted various techniques like anti-a ...

Using an array of objects with useState

I have a search box where I can paste a column from Excel. Upon input, I parse the data and create an array of entries. Next, I loop through each entry and utilize a custom hook to retrieve information from my graphql endpoint. For instance: If 3 entrie ...

The Next Js API is experiencing difficulties resolving

I'm just starting out with back-end development so I could use some assistance with my current project. I am working on a next.js application that applies a black and white filter to an image when it is uploaded. In the index.js file, once a file is s ...

Leveraging recompose utility within the structure

I am exploring the use of recompose utility functions as a React element, enabling me to incorporate them into JSX as higher-order components (HOC). const enhancedInput = props => { return (<OnlyUpdateForKeys keys={['name']> ...

Extensive content within the v-autocomplete field

I am trying to use the v-autocomplete component to display the entire text of the selected item. On initial selection, everything displays correctly: https://i.sstatic.net/LFZ2c.png However, once it is chosen, only a portion of the text is shown, leavin ...

Creating a personalized notification box that is compatible with various screen sizes and web browsers on android devices with the help of

After successfully implementing a custom alert box to hide the header with JavaScript, I encountered an issue when trying to use it on different browsers and Android devices. The alert box appeared misplaced on the page and was too big for certain Android ...

Next.js with Node.js (Express) backend does not have the capability to set cookies

I recently utilized a tutorial on implementing HTTP-Only cookies in my project, which can be found at the following link: While the backend functionality is operational and I am able to view the cookie in Postman, I'll share the backend code for refe ...

Is there a way to maintain image proportions when resizing the window?

I'm in the process of developing a classroom-themed website with interactive overlaying images. The goal is to have various pictures that users can click on to access different resources from different websites. My main challenge right now is getting ...

Enhance user experience with the Material UI Range Slider by enabling the thumb to automatically snap to the nearest value within

Seeking a slider with specific marks on predetermined intervals, including one mark that represents the desired value. When the thumb is close to the desired value, a friction effect should automatically snap the thumb to that position. ...

experiencing difficulties in deploying GitHub repository using npm run deploy

Trying to deploy my GitHub repo but encountering an error when running npm run deploy. How can I resolve this? > [email protected] predeploy > npm run build > [email protected] build > vite build vite v5.1.1 building for productio ...

What is the best way to organize images when adding them to the Strapi media library?

I am facing an issue with the order of images while uploading them using a drag and drop file input in my post car form. Currently, the images are being uploaded to strapi in the order of their size, from larger to smaller. Is there a way to upload them b ...

The Tailwind plug-ins, specifically the tailwind-scrollbar-hide, seem to be malfunctioning within remix.js

I recently added a new plugin called tailwind-scrollbar-hide to my project. import type { Config } from "tailwindcss"; export default { content: ["./app/**/*.{ts,tsx,jsx,js}"], theme: { extend: { fontFamily: { sta ...

Is there a way to make the footer adapt to the varying heights of the grid sections as they grow in size?

Currently, I am facing an issue with the positioning of the page footer. Despite my efforts, it does not remain at the bottom as intended. Please refer to the image for a visual representation of the problem. How can this be rectified? It is worth noting ...

Achieving Right Alignment of SVG Next to an <h4> in Bootstrap 5

I'm encountering an issue where I am attempting to align an SVG icon to the right of an H4 element and center it vertically using Bootstrap 5, but it's not working as intended. <div class="container-fluid"> <div class="r ...

Create a variety of colors with a simple click

A form has been created for the footer where clicking on an input causes the text and border-bottom to transition from grey to white. Visit Code Pen HTML: <div class="footer"> <div class="footerContainer"> <form> <inp ...

Stacked React-bootstrap Carousels displayed in a vertical column

I am struggling to create a simple straight carousel on my webpage. However, I am facing issues with the rendering as all the images are stacking vertically and the indicators are misaligned. I believe there might be a simple solution that I am overlookin ...

React component fails to update upon state change via Redux

I've noticed that my state is changing in the console, but my Book component isn't being refreshed when the state changes. In my app, I have two containers/components: BookList, which renders a list of all available books, and the Book component, ...