-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/Actualiza-Tu-Carro/Front…
…-end-ATC into categories-update
- Loading branch information
Showing
5 changed files
with
124 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { FC } from 'react'; | ||
import Image from 'next/image'; | ||
import { MainButton } from '~/components/button/button'; | ||
import Link from 'next/link'; | ||
|
||
interface notFoundProps {} | ||
|
||
const notFound: FC<notFoundProps> = ({}) => { | ||
return ( | ||
<div className="flex flex-col items-center h-screen w-screen gap-9 p-12"> | ||
<h1 className="text-center"> | ||
La pagina que estas buscando no parece existir | ||
</h1> | ||
<div> | ||
<h1 className="text-center font-medium text-secondary-lm text-4xl mb-2"> | ||
ERROR | ||
</h1> | ||
<Image | ||
src="https://i.postimg.cc/fLdFDym8/notFound.png" | ||
alt="404" | ||
width={500} | ||
height={500} | ||
className="object-cover mb-8" | ||
></Image> | ||
</div> | ||
<MainButton | ||
variant="tertiary" | ||
className="bg-primary-lm text-white border font-bold" | ||
> | ||
<Link href="/">Ir Pagina Principal</Link> | ||
</MainButton> | ||
</div> | ||
); | ||
}; | ||
|
||
export default notFound; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
'use client'; | ||
import React, { FC, useState, useEffect } from 'react'; | ||
import { BsChevronCompactLeft, BsChevronCompactRight } from 'react-icons/bs'; | ||
import { Images } from '~/assets/img'; | ||
|
||
interface SecondCarouselProps {} | ||
|
||
const slidesList = [ | ||
{ | ||
url: 'https://user-images.githubusercontent.com/124757365/267684986-ff0802dd-37d4-496a-9665-53dd8ae362b6.png', | ||
}, | ||
{ | ||
url: 'https://user-images.githubusercontent.com/124757365/267684986-ff0802dd-37d4-496a-9665-53dd8ae362b6.png', | ||
}, | ||
]; | ||
|
||
const mobileSlidesList = [ | ||
{ | ||
url: 'https://user-images.githubusercontent.com/124757365/267684987-30227360-5971-48d3-952e-ee05519a2002.png', | ||
}, | ||
{ | ||
url: 'https://user-images.githubusercontent.com/124757365/267684987-30227360-5971-48d3-952e-ee05519a2002.png', | ||
}, | ||
]; | ||
|
||
const SecondCarousel: FC<SecondCarouselProps> = ({}) => { | ||
const [currentIndex, setCurrentIndex] = useState(0); | ||
const isMobile = window.innerWidth <= 600; | ||
|
||
const prevSlide = () => { | ||
const isFirstSlide = currentIndex === 0; | ||
const newIndex = isFirstSlide ? slidesList.length - 1 : currentIndex - 1; | ||
setCurrentIndex(newIndex); | ||
}; | ||
|
||
const nextSlide = () => { | ||
const isLastSlide = currentIndex === slidesList.length - 1; | ||
const newIndex = isLastSlide ? 0 : currentIndex + 1; | ||
setCurrentIndex(newIndex); | ||
}; | ||
|
||
useEffect(() => { | ||
const interval = setInterval(() => { | ||
nextSlide(); | ||
}, 4000); | ||
|
||
return () => { | ||
clearInterval(interval); | ||
}; | ||
}, [currentIndex]); | ||
|
||
const backgroundImageStyle = isMobile | ||
? { | ||
backgroundImage: `url(${mobileSlidesList[currentIndex].url})`, | ||
} | ||
: { | ||
backgroundImage: `url(${slidesList[currentIndex].url})`, | ||
}; | ||
|
||
return ( | ||
<div | ||
className={`mt-[109px] md:mt-[60px] w-full h-screen m-auto relative group `} | ||
> | ||
<div | ||
style={backgroundImageStyle} | ||
className={`w-full bg-cover bg-no-repeat duration-700 ${ | ||
isMobile ? 'h-[calc(100%-109px)]' : 'h-[calc(100%-60px)]' | ||
}`} | ||
></div> | ||
<div className="hidden group-hover:block absolute top-[40%] md:top-[45%] -translate-x-0 translate-y-[-50%] left-5 text-2xl rounded-full p-2 bg-white/50 text-background-dm cursor-pointer"> | ||
<BsChevronCompactLeft onClick={prevSlide} size={30} /> | ||
</div> | ||
<div className="hidden group-hover:block absolute top-[40%] md:top-[45%] -translate-x-0 translate-y-[-50%] right-5 text-2xl rounded-full p-2 bg-white/50 text-background-dm cursor-pointer"> | ||
<BsChevronCompactRight onClick={nextSlide} size={30} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SecondCarousel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters