Skip to content

Commit

Permalink
Update home slider
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanNavasJN committed Jun 27, 2023
1 parent b6f44e4 commit a822ab0
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 37 deletions.
Binary file removed client/public/images/hero1.jpg
Binary file not shown.
Binary file removed client/public/images/hero2.jpg
Binary file not shown.
Binary file removed client/public/images/hero3.jpg
Binary file not shown.
Binary file added client/public/images/snow1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/images/snow2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/images/snow3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/images/snow4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/app/components/DarkModeSwitch.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Image from 'next/image';
import styles from '../styles/DarkModeSwitch.module.css';
import styles from '../../styles/DarkModeSwitch.module.css';

interface Props {
toggleDarkMode: () => void;
Expand Down
70 changes: 34 additions & 36 deletions client/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
import { Box, Typography } from '@mui/material';
import Slider from 'react-slick';
import Image from 'next/image';
import styles from '../styles/HomePage.module.css';

const images = [
{
src: '/images/snow1.jpg',
alt: 'snow1'
},
{
src: '/images/snow2.jpg',
alt: 'snow2'
},
{
src: '/images/snow3.jpg',
alt: 'snow3'
},
{
src: '/images/snow4.jpg',
alt: 'snow4'
}
];

export default function HomePage() {
return (
<>
<div className={styles.HomePage}>
<Slider
arrows={false}
dots
infinite
speed={500}
speed={1500}
slidesToShow={1}
slidesToScroll={1}
className={styles.Slider}
autoplay
autoplaySpeed={2500}
>
<>
<Box display="flex" justifyContent="center">
<Image
src="/images/hero1.jpg"
alt="hero"
width={800}
height={400}
/>
</Box>
</>

<>
<Box display="flex" justifyContent="center">
<Image
src="/images/hero2.jpg"
alt="hero"
width={800}
height={400}
/>
</Box>
</>

<>
<Box display="flex" justifyContent="center">
<Image
src="/images/hero3.jpg"
alt="hero"
width={800}
height={400}
/>
</Box>
</>
{images.map(img => (
<div key={img.alt} className={styles.ImageContainer}>
<Image className={styles.Image} src={img.src} alt={img.alt} fill />
</div>
))}
</Slider>

<Box display="flex" justifyContent="center" sx={{ p: 4, mt: 2 }}>
<Typography variant="h1">Welcome to the shop!</Typography>
<Typography variant="h1" fontSize={60}>
Welcome to the shop!
</Typography>
</Box>
</>
</div>
);
}
File renamed without changes.
16 changes: 16 additions & 0 deletions client/src/styles/HomePage.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.HomePage {
position: absolute;
left: 0;
width: 100%;
}

.Slider .ImageContainer {
height: 465px;
position: relative;
}

.Slider .ImageContainer img {
max-width: 2000px;
margin: 0 auto;
object-fit: cover;
}

0 comments on commit a822ab0

Please sign in to comment.