Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced css files with tailwind classes #670

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions client/src/Animations.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,50 @@
opacity: 1;
}
}


/* contributors animation */
.contributor-card:hover {
transform: scale(1.05);
box-shadow: 0 4px 6px rgba(5, 205, 208, 0.752);
}

.contributor-card:hover p {
text-shadow: 1px 1px 2px rgb(0, 225, 255), 0 0 0.2em rgb(0, 191, 255), 0 0 0.8em rgb(135, 206, 235);
color: rgb(0, 0, 0);
font-weight: 500;
}

.contributor-card:hover h2 {
text-shadow: 1px 1px 2px rgba(237, 9, 176, 0.926), 0 0 0.2em rgb(0, 191, 255), 0 0 0.8em rgb(135, 206, 235);
color: white;
font-size: 1.04rem;
font-weight: 600;
text-decoration: wavy;
}

.contributor-card:hover .contributor-avatar {
border: 3.5px solid #89e6f0;
width: 5.2rem;
box-shadow: -2px 4px 10px 1px rgba(1, 41, 218, 0.75);
height: 5.2rem;
}

.contributor-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(152deg, #0077b6 50%, #023e8a 50%);
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
transform: translate(-100%, -100%);
opacity: 0;
z-index: -1;
}

.contributor-card:hover::before {
transform: translate(0, 0);
opacity: 1;
}
70 changes: 0 additions & 70 deletions client/src/Pages/Book.css

This file was deleted.

17 changes: 8 additions & 9 deletions client/src/Pages/Book.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect, useState } from 'react'
import { useParams } from 'react-router-dom';
import "./Book.css"

const Book = () => {
const { id } = useParams();
Expand All @@ -23,19 +22,19 @@ const Book = () => {


return (
<div className="book-container">
<div className='book-cover'>
<div className="book-container flex flex-col md:flex-row max-w-[900px] m-5 p-4 border border-[#e2e8f0] rounded-lg bg-white my-20 mx-auto shadow-md">
<div className='book-cover w-[35%] h-auto object-cover rounded-lg mx-auto my-0 md:m-0'>
<img
src={book?.imageLinks?.smallThumbnail}
alt="image"y
className=" book_img"
className=" book_img w-full"
/>
</div>
<div className="book-details">
<h1 className="book-title">{book?.title}</h1>
<h2 className="book-author">{book?.authors[0]}</h2>
<p className="book-description">{book?.description}</p>
<div className="published-date">
<div className="book-details md:w-[65%] w-full p-8 md:p-0 mx-auto my-0 md:m-0 ml-4 flex flex-col justify-center">
<h1 className="book-title m-0 font-bold text-2xl">{book?.title}</h1>
<h2 className="book-author text-xl text-[#4a5568] my-0 mx-1">{book?.authors[0]}</h2>
<p className="book-description text-[#718096] my-2">{book?.description}</p>
<div className="published-date font-bold text-lg mt-4">
<span>Published: </span>
<span>{book?.publishedDate}</span>
</div>
Expand Down
3 changes: 0 additions & 3 deletions client/src/Pages/Cart.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
text-align: left;
}

.cart-table th {
/* background-color: #f2f2f2; */
}

.item-image {
max-width: 60px;
Expand Down
58 changes: 29 additions & 29 deletions client/src/Pages/Cart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
addItemToCart,
removeItemFromCart,
} from "../api/api.js";
import "./Cart.css";
// import "./Cart.css";
import Preloader from "../Components/Preloader";
import { useToast } from "../Context/ToastContext";
import { useNavigate } from "react-router-dom";
Expand Down Expand Up @@ -100,36 +100,36 @@ function Cart() {
const renderCartItems = () => {

return data.items.map((item) => (
<table className="cart-table">
<tr key={item.id}>
<td>
<table className="cart-table w-full border-collapse mt-5">
<tr key={item.id} className="mb-[10px] border-b border-[#e0e0e0]">
<td className=" border border-[#ddd] p-2 text-left">
<img
src={item.image || "https://via.placeholder.com/150"}
alt={item.name}

className="rounded-lg block w-[10vw] h-[20vh]"
/>
</td>
<td className="font-semibold">{item.name}</td>
<td>${item.price.toFixed(2)}</td>
<td>
<td className="font-semibold border border-[#ddd] p-2 text-left">{item.name}</td>
<td className=" border border-[#ddd] p-2 text-left">${item.price.toFixed(2)}</td>
<td className=" border border-[#ddd] p-2 text-left">
<button
onClick={() => handleRemoveItem(item.id)}
className="quantity-button"
className="quantity-button bg-[#007bff] text-white border-none py-[5px] px-[10px] text-sm cursor-pointer ml-[5px] rounded-md"
>
-
</button>
<span>{item.quantity}</span>
<button
onClick={() => handleAddItem(item)}
className="quantity-button"
className="quantity-button bg-[#007bff] text-white border-none py-[5px] px-[10px] text-sm cursor-pointer ml-[5px] rounded-md"
>
+
</button>
</td>
<td>
<td className=" border border-[#ddd] p-2 text-left">
<button
onClick={() => handleRemoveItem(item.id)}
className="remove-btn"
className="remove-btn bg-[#F95454] text-white border-none py-[10px] px-5 text-xs cursor-pointer rounded-md transition-none delay-[400ms] ease-in hover:bg-[#C62E2E] hover:scale-105"
>
Remove
</button>
Expand All @@ -140,9 +140,9 @@ function Cart() {
};

const renderSuggestedProducts = () => (
<div className="suggested-products space-y-4">
<h2 className="dark:text-white font-semibold font-poppins underline underline-offset-4">Suggested Products</h2>
<ul className="flex gap-5">
<div className="suggested-products mt-5 space-y-4">
<h2 className="dark:text-white text-xl font-semibold font-poppins underline underline-offset-4">Suggested Products</h2>
<ul className="flex list-none p-0 gap-5">
<div className="dark:text-white border-2 pb-2 rounded-md overflow-hidden h-max shadow-lg w-[10vw]">
<div className="font-dmsans flex flex-col items-center">
<div className="p-4">
Expand Down Expand Up @@ -209,14 +209,14 @@ function Cart() {
return (
<>
<Preloader />
<div className="cart-container dark:bg-[rgb(40,40,40)]">
<h1 className="cart-header dark:text-white">Shopping Cart</h1>
<div className="cart-container max-w-[800px] my-5 mx-auto p-5 border border-[#ddd] rounded-lg shadow-sm dark:bg-[rgb(40,40,40)]">
<h1 className="cart-header text-2xl mb-3 font-bold dark:text-white">Shopping Cart</h1>
<div className="w-full justify-center items-center flex">
<img src="/error.png"/>
</div>
<p className="font-dmsans text-center text-red-400">{error}</p>
<div className="w-full justify-center flex mt-5">
<button onClick={handleRetry} className="retry-button dark:text-white">
<button onClick={handleRetry} className="retry-button dark:text-white bg-[#002147] text-white border-none p-8 text-base cursor-pointer mt-3 rounded-md text-center border-2 border-[#002147] hover:text-[#002147] hover:bg-[#F4F4F4] hover:font-semibold">
Retry
</button>
</div>
Expand All @@ -228,26 +228,26 @@ function Cart() {
return (
<>
<Preloader />
<div className="cart-container dark:bg-[rgb(40,40,40)]">
<h1 className="cart-header dark:text-white">Shopping Cart</h1>
<div className="cart-container max-w-[800px] my-5 mx-auto p-5 border border-[#ddd] rounded-lg shadow-sm dark:bg-[rgb(40,40,40)]">
<h1 className="cart-header text-2xl mb-3 font-bold dark:text-white">Shopping Cart</h1>
{data && data.items && data.items.length > 0 ? (
<>
<table className="cart-table">
<table className="cart-table w-full border-collapse mt-5">
<thead>
<tr>
<th>Image</th>
<th>Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Action</th>
<th className="border-none p-4 text-center font-bold bg-[#dde8f9]">Image</th>
<th className="border-none p-4 text-center font-bold bg-[#dde8f9]">Name</th>
<th className="border-none p-4 text-center font-bold bg-[#dde8f9]">Price</th>
<th className="border-none p-4 text-center font-bold bg-[#dde8f9]">Quantity</th>
<th className="border-none p-4 text-center font-bold bg-[#dde8f9]">Action</th>
</tr>
</thead>
<tbody>{renderCartItems()}</tbody>
</table>
<div className="cart-summary">
<div className="cart-total dark:text-white">
<div className="cart-summary mt-5 flex justify-between items-center">
<div className="cart-total text-lg dark:text-white">
Total: <span className="font-medium">${data ? data.total.toFixed(2) : "0.00"}</span> </div>
<button className="checkout-button dark:text-white">
<button className="checkout-button bg-[#28a745] text-white border-none py-[10px] px-5 text-base cursor-pointer rounded-md transition delay-[400ms] ease-in dark:text-white hover:bg-[#218838] hover:scale-105">
Proceed to Checkout
</button> </div>
</>
Expand Down
31 changes: 0 additions & 31 deletions client/src/Pages/Contact.css

This file was deleted.

8 changes: 4 additions & 4 deletions client/src/Pages/Contact.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ function Contact() {
Get in Touch
</h1>

<p className="mb-5 text-[#10a5f5] smalltitlefont dark:text-white">
<p className="mb-5 text-[#10a5f5] smalltitlefont text-xl font-normal tracking-wide dark:text-white">
We are here for you. How can we help?
</p>
<form className="flex flex-col gap-4" onSubmit={handleSubmit}>
<div className="flex flex-col">
<label htmlFor="name" className="formlevel dark:text-white">
<label htmlFor="name" className="formlevel text-black p-1 tracking-wide text-xs md:text-xl font-normal dark:text-white">
Name:
</label>
<input
Expand All @@ -89,7 +89,7 @@ function Contact() {
/>
</div>
<div className="flex flex-col">
<label htmlFor="email" className="formlevel dark:text-white">
<label htmlFor="email" className="formlevel text-black p-1 tracking-wide text-xs md:text-xl font-normal dark:text-white">
Email:
</label>
<input
Expand All @@ -104,7 +104,7 @@ function Contact() {
/>
</div>
<div className="flex flex-col">
<label htmlFor="message" className="formlevel dark:text-white">
<label htmlFor="message" className="formlevel text-black p-1 tracking-wide text-xs md:text-xl font-normal dark:text-white">
Message:
</label>
<textarea
Expand Down
Loading
Loading