diff --git a/components/ScrollToTop.tsx b/components/ScrollToTop.tsx new file mode 100644 index 0000000..92d6657 --- /dev/null +++ b/components/ScrollToTop.tsx @@ -0,0 +1,17 @@ +import React from 'react'; +import Image from 'next/image'; +import styles from '../styles/ScrollToTop.module.scss'; + +export const ScrollToTop = () => { + return ( + + scroll to top button + + ); +}; diff --git a/pages/index.tsx b/pages/index.tsx index b0efff2..9cc3f84 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,6 +1,7 @@ import styles from '../styles/Index.module.scss'; import Image from 'next/image'; import { OpenHours } from '../components/OpenHours'; +import { ScrollToTop } from '../components/ScrollToTop'; export default function Index() { return ( @@ -16,6 +17,7 @@ export default function Index() { alt='main' width={528} height={237} + loading='lazy' />

Kauppa&Ravintola&Kahvila&Baari

@@ -29,6 +31,7 @@ export default function Index() { alt='shop keepers' width={251} height={251} + loading='lazy' /> info@livonsaarenosuuskauppa.fi @@ -43,6 +46,7 @@ export default function Index() { alt='facebook' width={300} height={300} + loading='lazy' /> @@ -53,6 +57,7 @@ export default function Index() { alt='facebook' width={300} height={300} + loading='lazy' /> @@ -86,6 +91,7 @@ export default function Index() { alt='restaurant' width={506} height={89} + loading='lazy' />

Alla kesäkauden tarjoilut

@@ -122,6 +128,7 @@ export default function Index() { alt='yhteystyö' width={496} height={326} + loading='lazy' /> @@ -139,6 +146,8 @@ export default function Index() { + +
); diff --git a/public/angle-top.png b/public/angle-top.png new file mode 100755 index 0000000..1c6697e Binary files /dev/null and b/public/angle-top.png differ diff --git a/styles/ScrollToTop.module.scss b/styles/ScrollToTop.module.scss new file mode 100644 index 0000000..3a5defa --- /dev/null +++ b/styles/ScrollToTop.module.scss @@ -0,0 +1,13 @@ +.scrollToTopButton { + padding: 1.5rem 3rem; + border-radius: 0.5rem; + transition: all 0.3s; + margin: 1rem; +} + +.scrollToTopButton:hover { + opacity: 0.5; +} + +.scrollToTopImage { +} diff --git a/styles/globals.scss b/styles/globals.scss index 93ed102..671cf35 100644 --- a/styles/globals.scss +++ b/styles/globals.scss @@ -4,6 +4,7 @@ body { margin: 0; font-family: 'Quicksand'; letter-spacing: 0.8px; + scroll-behavior: smooth; } @font-face {