update feedback changes
This commit is contained in:
parent
f1038b42c7
commit
aef97f1149
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -17,7 +17,10 @@
|
||||||
.env.development.local
|
.env.development.local
|
||||||
.env.test.local
|
.env.test.local
|
||||||
.env.production.local
|
.env.production.local
|
||||||
|
.env
|
||||||
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
|
||||||
|
App.css
|
19
package-lock.json
generated
19
package-lock.json
generated
|
@ -14,6 +14,9 @@
|
||||||
"react-router-dom": "^7.1.1",
|
"react-router-dom": "^7.1.1",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"web-vitals": "^4.2.4"
|
"web-vitals": "^4.2.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"prettier": "3.4.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@alloc/quick-lru": {
|
"node_modules/@alloc/quick-lru": {
|
||||||
|
@ -13314,6 +13317,22 @@
|
||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/prettier": {
|
||||||
|
"version": "3.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
|
||||||
|
"integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"prettier": "bin/prettier.cjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/pretty-bytes": {
|
"node_modules/pretty-bytes": {
|
||||||
"version": "5.6.0",
|
"version": "5.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
|
||||||
|
|
|
@ -33,5 +33,8 @@
|
||||||
"last 1 firefox version",
|
"last 1 firefox version",
|
||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"prettier": "3.4.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -1,25 +1,22 @@
|
||||||
import React from 'react';
|
import React from "react";
|
||||||
import "../styleing/body.css";
|
import "../styleing/body.css";
|
||||||
import Pagination from './Pagination';
|
import Pagination from "./Pagination";
|
||||||
import AddPostForm from './addPost';
|
import AddPostForm from "./addPost";
|
||||||
|
|
||||||
function Body({ filteredData, setFilteredData, currentPage, setCurrentPage }) {
|
function Body({ filteredData, setFilteredData, currentPage, setCurrentPage }) {
|
||||||
const postsPerPage = 6;
|
const postsPerPage = 6;
|
||||||
|
|
||||||
|
|
||||||
const handleAddPost = (newPost) => {
|
const handleAddPost = (newPost) => {
|
||||||
const postWithId = { ...newPost, id: Date.now() };
|
const postWithId = { ...newPost, id: Date.now() };
|
||||||
const updatedData = [postWithId, ...filteredData];
|
const updatedData = [postWithId, ...filteredData];
|
||||||
setFilteredData(updatedData);
|
setFilteredData(updatedData);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleDeletePost = (id) => {
|
const handleDeletePost = (id) => {
|
||||||
const updatedData = filteredData?.filter((post) => post?.id !== id);
|
const updatedData = filteredData?.filter((post) => post?.id !== id);
|
||||||
setFilteredData(updatedData);
|
setFilteredData(updatedData);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const indexOfLastPost = currentPage * postsPerPage;
|
const indexOfLastPost = currentPage * postsPerPage;
|
||||||
const indexOfFirstPost = indexOfLastPost - postsPerPage;
|
const indexOfFirstPost = indexOfLastPost - postsPerPage;
|
||||||
const currentPosts = filteredData?.slice(indexOfFirstPost, indexOfLastPost);
|
const currentPosts = filteredData?.slice(indexOfFirstPost, indexOfLastPost);
|
||||||
|
@ -28,24 +25,25 @@ function Body({ filteredData, setFilteredData, currentPage, setCurrentPage }) {
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<ul>
|
<ul>
|
||||||
|
{filteredData?.length > 0 ? (
|
||||||
{filteredData.length > 0 ? (
|
currentPosts?.map((post) => (
|
||||||
currentPosts.map((post) => (
|
|
||||||
<li key={post?.id}>
|
<li key={post?.id}>
|
||||||
<h1>Title: {post?.title}</h1>
|
<h1>Title: {post?.title}</h1>
|
||||||
<p><b>Content:</b> {post?.body}</p>
|
<p>
|
||||||
<button onClick={() => handleDeletePost(post.id)}>Delete</button>
|
<b>Content:</b> {post?.body}
|
||||||
|
</p>
|
||||||
|
<button onClick={() => handleDeletePost(post?.id)} >Delete</button>
|
||||||
</li>
|
</li>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<li>No posts found</li>
|
<li>No posts found</li>
|
||||||
)}
|
)}
|
||||||
</ul>
|
</ul>
|
||||||
<AddPostForm onAddPost={handleAddPost} />
|
<AddPostForm onAddPost={handleAddPost} />
|
||||||
<Pagination
|
<Pagination
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
totalPages={totalPages}
|
totalPages={totalPages}
|
||||||
onPageChange={(page) => setCurrentPage(page)}
|
onPageChange={(page) => setCurrentPage(page)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
import React,{useState} from "react";
|
import React, { useState } from "react";
|
||||||
function DarkMode(){
|
function DarkMode() {
|
||||||
const [theme,setTheme] = useState("light");
|
const [theme, setTheme] = useState("light");
|
||||||
const toggleTheme = ()=>{
|
const toggleTheme = () => {
|
||||||
setTheme(theme === "light" ? "dark" : "light");
|
setTheme(theme === "light" ? "dark" : "light");
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: theme === "light" ? "#fff" : "#333",
|
backgroundColor: theme === "light" ? "#fff" : "#333",
|
||||||
color: theme === "light" ? "#000" : "#fff",
|
color: theme === "light" ? "#000" : "#fff",
|
||||||
height: "100vh",
|
height: "100vh",
|
||||||
transition: "background-color 0.3s",
|
transition: "background-color 0.3s",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<h1>{theme.charAt(0).toUpperCase()+theme.slice(1)}Mode</h1>
|
<h1>{theme.charAt(0).toUpperCase() + theme.slice(1)}Mode</h1>
|
||||||
<button onClick={toggleTheme}> Toggle Theme</button>
|
<button onClick={toggleTheme}> Toggle Theme</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default DarkMode;
|
export default DarkMode;
|
||||||
|
|
|
@ -1,48 +1,47 @@
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import Body from "./Body";
|
import Body from "./Body";
|
||||||
import SearchBar from "./SearchBar";
|
import SearchBar from "./SearchBar";
|
||||||
|
import useFetch from "../hooks/useFetch";
|
||||||
import "../styleing/layout.css";
|
import "../styleing/layout.css";
|
||||||
import { api_url } from "../env";
|
|
||||||
|
const my_key = process.env.REACT_APP_API_KEY;
|
||||||
|
|
||||||
const Layout = () => {
|
const Layout = () => {
|
||||||
const [data, setData] = useState([]);
|
|
||||||
const [filteredData, setFilteredData] = useState([]);
|
const [filteredData, setFilteredData] = useState([]);
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
|
|
||||||
const fetchData = async () => {
|
const { data, loading, error } = useFetch(my_key);
|
||||||
try {
|
|
||||||
const res = await fetch(api_url);
|
|
||||||
const fetchedData = await res?.json();
|
|
||||||
setData(fetchedData);
|
|
||||||
setFilteredData(fetchedData);
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Error fetching data:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (data) {
|
||||||
|
setFilteredData(data);
|
||||||
|
}
|
||||||
|
}, [data]);
|
||||||
|
|
||||||
const handleSearch = (searchTerm) => {
|
const handleSearch = (searchTerm) => {
|
||||||
if (!searchTerm) {
|
if (!searchTerm) {
|
||||||
setFilteredData(data);
|
setFilteredData(data);
|
||||||
} else {
|
} else {
|
||||||
const filtered = data.filter(
|
const filtered = data?.filter(
|
||||||
(post) =>
|
(post) =>
|
||||||
post?.title.toLowerCase().includes(searchTerm?.toLowerCase()) ||
|
post?.title?.toLowerCase().includes(searchTerm?.toLowerCase()) ||
|
||||||
post?.body.toLowerCase().includes(searchTerm?.toLowerCase())
|
post?.body?.toLowerCase().includes(searchTerm?.toLowerCase())
|
||||||
);
|
);
|
||||||
if(filtered.length>0){
|
if (filtered?.length > 0) {
|
||||||
setFilteredData([filtered[0]]);
|
setFilteredData(filtered);
|
||||||
}else{
|
} else {
|
||||||
setFilteredData([]);
|
setFilteredData([]);
|
||||||
}
|
}
|
||||||
setCurrentPage(1);
|
setCurrentPage(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
if (loading) {
|
||||||
fetchData();
|
return <div>Loading....</div>;
|
||||||
}, []);
|
}
|
||||||
|
if (error) {
|
||||||
|
return <div>Error: {error}</div>;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div className="contentPage">
|
<div className="contentPage">
|
||||||
<div className="header">
|
<div className="header">
|
||||||
|
@ -52,7 +51,7 @@ const Layout = () => {
|
||||||
<div className="body">
|
<div className="body">
|
||||||
<Body
|
<Body
|
||||||
filteredData={filteredData}
|
filteredData={filteredData}
|
||||||
setFilteredData={setFilteredData}
|
setFilteredData={setFilteredData}
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
setCurrentPage={setCurrentPage}
|
setCurrentPage={setCurrentPage}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from "react";
|
||||||
import "../styleing/pagination.css"
|
import "../styleing/pagination.css";
|
||||||
const Pagination = ({ currentPage, totalPages, onPageChange }) => {
|
const Pagination = ({ currentPage, totalPages, onPageChange }) => {
|
||||||
const handlePageChange = (page) => {
|
const handlePageChange = (page) => {
|
||||||
onPageChange(page);
|
onPageChange(page);
|
||||||
|
@ -7,11 +7,19 @@ const Pagination = ({ currentPage, totalPages, onPageChange }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="pagination">
|
<div className="pagination">
|
||||||
<button onClick={() => handlePageChange(currentPage - 1)} disabled={currentPage === 1}>
|
<button
|
||||||
|
onClick={() => handlePageChange(currentPage - 1)}
|
||||||
|
disabled={currentPage === 1}
|
||||||
|
>
|
||||||
Previous
|
Previous
|
||||||
</button>
|
</button>
|
||||||
<span>Page {currentPage} of {totalPages}</span>
|
<span>
|
||||||
<button onClick={() => handlePageChange(currentPage + 1)} disabled={currentPage === totalPages}>
|
Page {currentPage} of {totalPages}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
onClick={() => handlePageChange(currentPage + 1)}
|
||||||
|
disabled={currentPage === totalPages}
|
||||||
|
>
|
||||||
Next
|
Next
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from "react";
|
||||||
import '../styleing/SearchBar.css';
|
import "../styleing/SearchBar.css";
|
||||||
|
|
||||||
const SearchBar = ({ onSearch }) => {
|
const SearchBar = ({ onSearch }) => {
|
||||||
const [searchTerm, setSearchTerm] = useState('');
|
const [searchTerm, setSearchTerm] = useState("");
|
||||||
|
|
||||||
const handleInputChange = (event) => {
|
const handleInputChange = (event) => {
|
||||||
const value = event?.target?.value;
|
const value = event?.target?.value;
|
||||||
setSearchTerm(value);
|
setSearchTerm(value);
|
||||||
onSearch(value);
|
onSearch(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,32 +1,34 @@
|
||||||
|
import React, { useState } from "react";
|
||||||
import React, { useState } from 'react';
|
import "../styleing/addPost.css";
|
||||||
import "../styleing/addPost.css"
|
|
||||||
const AddPostForm = ({ onAddPost }) => {
|
const AddPostForm = ({ onAddPost }) => {
|
||||||
const [newPost, setNewPost] = useState({ title: '', body: '' });
|
const [newPost, setNewPost] = useState({ title: "", body: "" });
|
||||||
|
|
||||||
const handleSubmit = (e) => {
|
const handleSubmit = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (newPost.title && newPost.body) {
|
if (newPost.title && newPost.body) {
|
||||||
onAddPost(newPost);
|
onAddPost(newPost);
|
||||||
setNewPost({ title: '', body: '' });
|
setNewPost({ title: "", body: "" });
|
||||||
} else {
|
} else {
|
||||||
alert('Title and Body are required!');
|
alert("Title and Body are required!");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="addPostForm">
|
<div className="addPostForm">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Post Title"
|
placeholder="Post Title"
|
||||||
value={newPost.title}
|
value={newPost.title}
|
||||||
onChange={(e) => setNewPost({ ...newPost, title: e.target.value })}
|
onChange={(e) => setNewPost((prevState)=>({ ...prevState, title: e.target.value }))}
|
||||||
/>
|
/>
|
||||||
<textarea
|
<textarea
|
||||||
placeholder="Post Content"
|
placeholder="Post Content"
|
||||||
value={newPost.body}
|
value={newPost.body}
|
||||||
onChange={(e) => setNewPost({ ...newPost, body: e.target.value })}
|
onChange={(e) => setNewPost({ ...newPost, body: e.target.value })}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<button onClick={handleSubmit}>Add Post</button>
|
<button onClick={handleSubmit}>Add Post</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
export const api_url = "https://jsonplaceholder.typicode.com/posts";
|
|
28
src/hooks/useFetch.js
Normal file
28
src/hooks/useFetch.js
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
|
const useFetch = (url) => {
|
||||||
|
const [data, setData] = useState([]);
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [error, setError] = useState(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const fetchData = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
try {
|
||||||
|
const res = await fetch(url);
|
||||||
|
if (!res.ok) {
|
||||||
|
throw new Error("Failed to fetch data");
|
||||||
|
}
|
||||||
|
const result = await res.json();
|
||||||
|
setData(result);
|
||||||
|
} catch (err) {
|
||||||
|
setError(err.message);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fetchData();
|
||||||
|
}, [url]);
|
||||||
|
return { data, loading, error };
|
||||||
|
};
|
||||||
|
export default useFetch;
|
|
@ -1,31 +1,32 @@
|
||||||
|
:root {
|
||||||
|
--borderColor: #ccc;
|
||||||
|
--bgColor: #f9f9f9;
|
||||||
|
--bFocus: #4caf50;
|
||||||
|
}
|
||||||
.searchBar {
|
.searchBar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
}
|
|
||||||
|
|
||||||
.search {
|
|
||||||
padding: 10px;
|
|
||||||
font-size: 1.2em;
|
|
||||||
width: 300px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search:focus {
|
|
||||||
border-color: #4CAF50;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
.search{
|
|
||||||
display: flex;
|
|
||||||
margin-left: 85cap;
|
|
||||||
padding: 10px;
|
|
||||||
border: 1px solid black;
|
|
||||||
border-radius: 10px ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search {
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 1.2em;
|
||||||
|
width: 300px;
|
||||||
|
border: 1px solid var(--borderColor);
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: var(--bgColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
.search:focus {
|
||||||
|
border-color: var(--bFocus);
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
.search {
|
||||||
|
position: absolute;
|
||||||
|
margin-left: 50cap;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid var(black);
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
|
@ -1,36 +1,40 @@
|
||||||
|
:root {
|
||||||
|
--borderColor: #ccc;
|
||||||
|
--bgColor: #f9f9f9;
|
||||||
|
--bgCol: #4caf50;
|
||||||
|
--bgColHover: #45a049;
|
||||||
|
}
|
||||||
.addPostForm {
|
.addPostForm {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.addPostForm input,
|
.addPostForm input,
|
||||||
.addPostForm textarea {
|
.addPostForm textarea {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid var(--borderColor);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.addPostForm button {
|
.addPostForm button {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
background-color: #4CAF50;
|
background-color: var(--bgCol);
|
||||||
color: white;
|
color: var(--bgColor);
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.addPostForm button:hover {
|
.addPostForm button:hover {
|
||||||
background-color: #45a049;
|
background-color: var(--bgColHover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.addPostForm input:focus,
|
.addPostForm input:focus,
|
||||||
.addPostForm textarea:focus {
|
.addPostForm textarea:focus {
|
||||||
border-color: #4CAF50;
|
border-color: var(--bgCol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,27 @@
|
||||||
.App{
|
:root {
|
||||||
|
--borderColor: black;
|
||||||
/* background-image: linear-gradient(to right, rgba(255,0,0,0), rgba(255, 0, 0, 0.163)); */
|
}
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto auto auto;
|
||||||
|
gap: 20px;
|
||||||
|
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
border: 2px solid var(--borderColor);
|
||||||
|
background-image: linear-gradient(rgba(135, 207, 235, 0.588),rgba(230, 116, 116, 0.295));
|
||||||
|
font-family: Georgia, 'Times New Roman', Times, serif;
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 5px;
|
||||||
|
|
||||||
|
}
|
||||||
|
button{
|
||||||
|
background-color: skyblue;
|
||||||
|
border-radius: 10px;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ul{
|
button:hover{
|
||||||
list-style-type: none;
|
background-color: rgba(230, 116, 116, 0.632);
|
||||||
display: grid;
|
}
|
||||||
grid-template-columns: auto auto auto;
|
|
||||||
gap: 20px;
|
|
||||||
|
|
||||||
}
|
|
||||||
li{
|
|
||||||
border: 2px solid black;
|
|
||||||
}
|
|
|
@ -1,13 +1,18 @@
|
||||||
.header{
|
:root {
|
||||||
background-image:linear-gradient(skyblue,rgb(230, 116, 116)) ;
|
--imgBG_LG1: skyblue;
|
||||||
height: auto;
|
--imgBG_LG2: rgb(230, 116, 116);
|
||||||
width: 100%;
|
--headingColor: black;
|
||||||
padding: 5px;
|
|
||||||
margin-top: -16px;
|
|
||||||
}
|
}
|
||||||
.heading{
|
.header {
|
||||||
text-align: center;
|
background-image: linear-gradient(var(--imgBG_LG1), var(--imgBG_LG2));
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
height: auto;
|
||||||
font-size: xx-large;
|
width: 100%;
|
||||||
color: black;
|
padding: 5px;
|
||||||
|
margin-top: -16px;
|
||||||
|
}
|
||||||
|
.heading {
|
||||||
|
text-align: center;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
font-size: xx-large;
|
||||||
|
color: var(--headingColor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,35 @@
|
||||||
|
:root {
|
||||||
|
--border: #ccc;
|
||||||
|
--bgColor: #f9f9f9;
|
||||||
|
--bgHover: #ddd;
|
||||||
|
--paginationBG: #4caf50;
|
||||||
|
--paginationCol: white;
|
||||||
|
}
|
||||||
.pagination {
|
.pagination {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination button {
|
.pagination button {
|
||||||
padding: 8px 12px;
|
padding: 8px 12px;
|
||||||
margin: 0 5px;
|
margin: 0 5px;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid var(--border);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: #f9f9f9;
|
background-color: var(--bgColor);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination button:hover {
|
.pagination button:hover {
|
||||||
background-color: #ddd;
|
background-color: var(--bgHover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination .active {
|
.pagination .active {
|
||||||
background-color: #4CAF50;
|
background-color: var(--paginationBG);
|
||||||
color: white;
|
color: var(--paginationCol);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination .disabled {
|
.pagination .disabled {
|
||||||
background-color: #f2f2f2;
|
background-color: var(--bgColor);
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue