diff --git a/frontend/src/Pages/picpagination.tsx b/frontend/src/Pages/picpagination.tsx index c1b221b342028d2b91140bcc7c8d0821e0dd70c2..09a477791e06ca6c87446bacaf1b8fb45fb29108 100644 --- a/frontend/src/Pages/picpagination.tsx +++ b/frontend/src/Pages/picpagination.tsx @@ -1,14 +1,15 @@ import React from "react"; type num = { - total: number, + // total: number, page: number, setPage: Function } -export default function Pagination ({total, page, setPage} : num) { - const numPages = Math.ceil(total / 15); - +// export function PaginationLeft ({total, page, setPage} : num) { + // const numPages = Math.ceil(total / 15); +export function PaginationLeft ({ page, setPage} : num) { + const numPages = 3 return (
))} */} +
+ ); +}; +// export function PaginationRight ({total, page, setPage} : num) { +// const numPages = Math.ceil(total / 15); +export function PaginationRight ({ page, setPage} : num) { + const numPages = 3; + return ( +
diff --git a/frontend/src/home/body.tsx b/frontend/src/home/body.tsx index ccf19a4134def697acbd826bd654eda91e60ff3c..73c68cf2c61f9c12030a17134937b8210057cda4 100644 --- a/frontend/src/home/body.tsx +++ b/frontend/src/home/body.tsx @@ -3,7 +3,7 @@ import { Outlet, useSearchParams } from "react-router-dom"; import Theme from "./theme"; import Citylist from "../Pages/citylist"; import { getPicure } from "../Pages/pic"; -import Pagination from "../Pages/picpagination"; +import { PaginationLeft ,PaginationRight} from "../Pages/picpagination"; const initSearchParams = { theme: "", city: "" }; @@ -12,7 +12,7 @@ export default function Body() { const [searchParams, setSearchParams] = useSearchParams(initSearchParams); const [page, setPage] = useState(1); const offset = (page - 1) * limit; - + const [selected, setSelected] = useState(1); let getPics = getPicure(); useEffect(() => { @@ -48,25 +48,35 @@ export default function Body() { ); }); + const pre = () =>{ + setSelected(selected -1) + }; + + const next = () =>{ + setSelected(selected + 1) + }; + return (
- -
- {Idpics.slice(offset, offset + limit).map((pic, index: number) => ( -
- -

{pic.name}

+
+ +
+
+
+ + +
+
+
+
+ + + +
- ))} - +
@@ -75,3 +85,18 @@ export default function Body() { // Body Page ); } +{/*
*/} + {/* {Idpics.slice(offset, offset + limit).map((pic, index: number) => ( +
+ +

{pic.name}

+
+ ))} */} + {/* */} + {/* */} \ No newline at end of file diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index 0ca9fa0d57e5bdae107c5dc188f5a16d8028391a..ac6c416ea47f5809ceff275c8d3cdbdf66b898ae 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -5,15 +5,18 @@ module.exports = { extend: { keyframes: { wave: { - '0%': { left: '100' }, + '0%': { left: '100%' }, '4%': { left: '0' }, '33.33%': { left: '0' }, - '37.33%': { left: '-100' }, - '100%': { left: '-100' }, + '37.33%': { left: '-100%' }, + '66.66%': { left: '-100%' }, + '70.66%': { left: '-200%' }, + '99.99%': { left: '-200%' }, + '100%': { left: '0%' }, } }, animation: { - wave : 'wave 10s ease-in-out' + wave : 'wave 12s ease-in-out' } }, },