task 2 added and updated and completed

master
mahdi 3 years ago
parent fe4397114a
commit e219fc859a
  1. 42
      package-lock.json
  2. 6
      package.json
  3. 6
      postcss.config.js
  4. 38
      src/App.css
  5. 25
      src/App.js
  6. 0
      src/App.scss
  7. 8
      src/App.test.js
  8. BIN
      src/assets/fonts/iransans/eot/IRANSansWeb.eot
  9. BIN
      src/assets/fonts/iransans/eot/IRANSansWeb_Black.eot
  10. BIN
      src/assets/fonts/iransans/eot/IRANSansWeb_Bold.eot
  11. BIN
      src/assets/fonts/iransans/eot/IRANSansWeb_Light.eot
  12. BIN
      src/assets/fonts/iransans/eot/IRANSansWeb_Medium.eot
  13. BIN
      src/assets/fonts/iransans/eot/IRANSansWeb_UltraLight.eot
  14. BIN
      src/assets/fonts/iransans/ttf/IRANSansWeb.ttf
  15. BIN
      src/assets/fonts/iransans/ttf/IRANSansWeb_Black.ttf
  16. BIN
      src/assets/fonts/iransans/ttf/IRANSansWeb_Bold.ttf
  17. BIN
      src/assets/fonts/iransans/ttf/IRANSansWeb_Light.ttf
  18. BIN
      src/assets/fonts/iransans/ttf/IRANSansWeb_Medium.ttf
  19. BIN
      src/assets/fonts/iransans/ttf/IRANSansWeb_UltraLight.ttf
  20. BIN
      src/assets/fonts/iransans/woff/IRANSansWeb.woff
  21. BIN
      src/assets/fonts/iransans/woff/IRANSansWeb_Black.woff
  22. BIN
      src/assets/fonts/iransans/woff/IRANSansWeb_Bold.woff
  23. BIN
      src/assets/fonts/iransans/woff/IRANSansWeb_Light.woff
  24. BIN
      src/assets/fonts/iransans/woff/IRANSansWeb_Medium.woff
  25. BIN
      src/assets/fonts/iransans/woff/IRANSansWeb_UltraLight.woff
  26. BIN
      src/assets/fonts/iransans/woff2/IRANSansWeb.woff2
  27. BIN
      src/assets/fonts/iransans/woff2/IRANSansWeb_Black.woff2
  28. BIN
      src/assets/fonts/iransans/woff2/IRANSansWeb_Bold.woff2
  29. BIN
      src/assets/fonts/iransans/woff2/IRANSansWeb_Light.woff2
  30. BIN
      src/assets/fonts/iransans/woff2/IRANSansWeb_Medium.woff2
  31. BIN
      src/assets/fonts/iransans/woff2/IRANSansWeb_UltraLight.woff2
  32. BIN
      src/assets/icons/discount.png
  33. 8
      src/assets/icons/vuesax-linear-heart.svg
  34. 3
      src/assets/images/Path2.svg
  35. BIN
      src/assets/images/goldon.png
  36. 8
      src/assets/images/o1.svg
  37. 673
      src/components/productDesign/ProductDesign.js
  38. 42
      src/components/productDesign/ProductDesign.scss
  39. 13
      src/index.css
  40. 15
      src/index.js
  41. 16
      src/index.scss
  42. 1
      src/logo.svg
  43. 30
      tailwind.config.js

42
package-lock.json generated

@ -14,7 +14,13 @@
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-scripts": "5.0.0", "react-scripts": "5.0.0",
"sass": "^1.45.0",
"web-vitals": "^2.1.2" "web-vitals": "^2.1.2"
},
"devDependencies": {
"autoprefixer": "^10.4.0",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.7"
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
@ -8065,6 +8071,11 @@
"url": "https://opencollective.com/immer" "url": "https://opencollective.com/immer"
} }
}, },
"node_modules/immutable": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz",
"integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw=="
},
"node_modules/import-cwd": { "node_modules/import-cwd": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz", "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz",
@ -13630,6 +13641,22 @@
"resolved": "https://registry.npmjs.org/sanitize.css/-/sanitize.css-13.0.0.tgz", "resolved": "https://registry.npmjs.org/sanitize.css/-/sanitize.css-13.0.0.tgz",
"integrity": "sha512-ZRwKbh/eQ6w9vmTjkuG0Ioi3HBwPFce0O+v//ve+aOq1oeCy7jMV2qzzAlpsNuqpqCBjjriM1lbtZbF/Q8jVyA==" "integrity": "sha512-ZRwKbh/eQ6w9vmTjkuG0Ioi3HBwPFce0O+v//ve+aOq1oeCy7jMV2qzzAlpsNuqpqCBjjriM1lbtZbF/Q8jVyA=="
}, },
"node_modules/sass": {
"version": "1.45.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.45.0.tgz",
"integrity": "sha512-ONy5bjppoohtNkFJRqdz1gscXamMzN3wQy1YH9qO2FiNpgjLhpz/IPRGg0PpCjyz/pWfCOaNEaiEGCcjOFAjqw==",
"dependencies": {
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
"source-map-js": ">=0.6.2 <2.0.0"
},
"bin": {
"sass": "sass.js"
},
"engines": {
"node": ">=8.9.0"
}
},
"node_modules/sass-loader": { "node_modules/sass-loader": {
"version": "12.4.0", "version": "12.4.0",
"resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-12.4.0.tgz", "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-12.4.0.tgz",
@ -21788,6 +21815,11 @@
"resolved": "https://registry.npmjs.org/immer/-/immer-9.0.7.tgz", "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.7.tgz",
"integrity": "sha512-KGllzpbamZDvOIxnmJ0jI840g7Oikx58lBPWV0hUh7dtAyZpFqqrBZdKka5GlTwMTZ1Tjc/bKKW4VSFAt6BqMA==" "integrity": "sha512-KGllzpbamZDvOIxnmJ0jI840g7Oikx58lBPWV0hUh7dtAyZpFqqrBZdKka5GlTwMTZ1Tjc/bKKW4VSFAt6BqMA=="
}, },
"immutable": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz",
"integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw=="
},
"import-cwd": { "import-cwd": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz", "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz",
@ -25650,6 +25682,16 @@
"resolved": "https://registry.npmjs.org/sanitize.css/-/sanitize.css-13.0.0.tgz", "resolved": "https://registry.npmjs.org/sanitize.css/-/sanitize.css-13.0.0.tgz",
"integrity": "sha512-ZRwKbh/eQ6w9vmTjkuG0Ioi3HBwPFce0O+v//ve+aOq1oeCy7jMV2qzzAlpsNuqpqCBjjriM1lbtZbF/Q8jVyA==" "integrity": "sha512-ZRwKbh/eQ6w9vmTjkuG0Ioi3HBwPFce0O+v//ve+aOq1oeCy7jMV2qzzAlpsNuqpqCBjjriM1lbtZbF/Q8jVyA=="
}, },
"sass": {
"version": "1.45.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.45.0.tgz",
"integrity": "sha512-ONy5bjppoohtNkFJRqdz1gscXamMzN3wQy1YH9qO2FiNpgjLhpz/IPRGg0PpCjyz/pWfCOaNEaiEGCcjOFAjqw==",
"requires": {
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
"source-map-js": ">=0.6.2 <2.0.0"
}
},
"sass-loader": { "sass-loader": {
"version": "12.4.0", "version": "12.4.0",
"resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-12.4.0.tgz", "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-12.4.0.tgz",

@ -9,6 +9,7 @@
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-scripts": "5.0.0", "react-scripts": "5.0.0",
"sass": "^1.45.0",
"web-vitals": "^2.1.2" "web-vitals": "^2.1.2"
}, },
"scripts": { "scripts": {
@ -34,5 +35,10 @@
"last 1 firefox version", "last 1 firefox version",
"last 1 safari version" "last 1 safari version"
] ]
},
"devDependencies": {
"autoprefixer": "^10.4.0",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.7"
} }
} }

@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

@ -1,38 +0,0 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@ -1,23 +1,16 @@
import logo from './logo.svg'; import "./App.scss";
import './App.css'; import ProductDesign from "./components/productDesign/ProductDesign";
// import { library } from "@fortawesome/fontawesome-svg-core";
// import { fab } from "@fortawesome/free-brands-svg-icons";
// import { faCheckSquare, faCoffee } from "@fortawesome/free-solid-svg-icons";
// library.add(fab, faCheckSquare, faCoffee);
function App() { function App() {
return ( return (
<div className="App"> <div className="App">
<header className="App-header"> <ProductDesign />
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div> </div>
); );
} }

@ -1,8 +0,0 @@
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<g id="vuesax_linear_heart" data-name="vuesax/linear/heart" transform="translate(-236 -188)">
<g id="heart">
<path id="Vector" d="M10.62,17.71a2.181,2.181,0,0,1-1.24,0C6.48,16.72,0,12.59,0,5.59A5.574,5.574,0,0,1,5.56,0,5.515,5.515,0,0,1,10,2.24,5.547,5.547,0,0,1,20,5.59C20,12.59,13.52,16.72,10.62,17.71Z" transform="translate(238 191.1)" fill="none" stroke="#e11010" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector-2" data-name="Vector" d="M0,0H24V24H0Z" transform="translate(236 188)" fill="none" opacity="0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 675 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="14.489" height="304.353" viewBox="0 0 14.489 304.353">
<path id="Path_2" data-name="Path 2" d="M14.489,0,0,10.8V291.9l14.489,12.457Z" fill="#f2f2f2"/>
</svg>

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 62 KiB

@ -0,0 +1,673 @@
import React from "react";
import "./ProductDesign.scss";
import book from "../../assets/images/goldon.png";
import heart from "../../assets/icons/vuesax-linear-heart.svg";
import discountImg from "../../assets/icons/discount.png";
// import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
const ProductDesign = ({
colors,
likeBtn,
discount,
discountPricePercent,
discountPrice,
productContent,
star,
productTags,
priceDirection,
productTitleAlignment,
}) => {
return (
<section className="w-11/12 mx-auto p-4 bg-white rounded-md shadow-md my-8">
{/* title holder */}
<div className="flex items-center justify-between mb-6">
<h2 className="text-lg text-$productTitle">آیتم محصولات</h2>
<button className="bg-indigo-500 text-white rounded shadow-lg p-2">
مشاهده تمام محصولات
</button>
</div>
<div className="flex justify-around">
{/* product items1 */}
<div className="product-items-holder">
{/* item1 */}
<div className="product-item">
{/*star img holder*/}
<div className="w-full relative">
{discountPricePercent && (
<div className="discountPriceBtn">
<p className="dicountPriceNum">
23<span>%</span>
</p>
</div>
)}
{likeBtn && (
<div className="likeBtnBg">
<img src={heart} alt="" className="w-full" />
</div>
)}
{discount && (
<div className="discountBtn">
<img src={discountImg} alt="" className="w-full" />
</div>
)}
{/* img Holder */}
<div className="flex-shrink-0">
<img src={book} alt="" className="w-full rounded-lg" />
</div>
{/* select Color */}
{colors && (
<div className="absolute right-2 bottom-2">
<ul className="flex ">
<li className="ml-1 text-selectColor1">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor2">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor3">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor4">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
</div>
)}
</div>
{/* content holder */}
<div className="mt-4">
<h2 className={`productTitle ${productTitleAlignment}`}>
نسخه چاپی علموم تجربه هفتم
</h2>
{productContent && (
<p className="productContent">
این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب
دیگری نیز دارد.
</p>
)}
</div>
{/* star holder */}
{star && (
<div className="flex items-center mt-2">
<ul className="flex">
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
<span className="text-xs text-productContent font-bold">
39
</span>
</div>
)}
{/* price holder */}
<div
className={`flex items-center justify-between ${priceDirection}`}
>
{/* price */}
<div className="mt-2">
<div
className={`${
priceDirection.indexOf("col") !== -1 ? "inline" : "flex"
}`}
>
<span className="text-xs text-borderColor ml-2">قیمت</span>
{discountPrice && (
<p className="line-through text-xs text-borderColor mr-2">
145<span>تومان</span>
</p>
)}
</div>
<p className="product-price-num inline">
145.000<span>تومان</span>
</p>
</div>
{/* add to cart */}
<button
className={`addToCart ${
priceDirection.indexOf("col") !== -1 ? "w-full" : ""
}`}
>
اضافه کردن به سبد خرید
</button>
</div>
{/* tag holder */}
{productTags && (
<div className="mt-2 flex flex-wrap">
<button className="product-tag">ارسال رایگان</button>
<button className="product-tag">برچسب های دیگر</button>
<button className="product-tag">دسته بندی به صورت کادو</button>
</div>
)}
</div>
</div>
{/* product items2 */}
<div className="product-items-holder">
{/* item1 */}
<div className="product-item">
{/*star img holder*/}
<div className="w-full relative">
{discountPricePercent && (
<div className="discountPriceBtn">
<p className="dicountPriceNum">
23<span>%</span>
</p>
</div>
)}
{likeBtn && (
<div className="likeBtnBg">
<img src={heart} alt="" className="w-full" />
</div>
)}
{discount && (
<div className="discountBtn">
<img src={discountImg} alt="" className="w-full" />
</div>
)}
{/* img Holder */}
<div className="flex-shrink-0">
<img src={book} alt="" className="w-full rounded-lg" />
</div>
{/* select Color */}
{colors && (
<div className="absolute right-2 bottom-2">
<ul className="flex ">
<li className="ml-1 text-selectColor1">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor2">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor3">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor4">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
</div>
)}
</div>
{/* content holder */}
<div className="mt-4">
<h2 className={`productTitle ${productTitleAlignment}`}>
نسخه چاپی علموم تجربه هفتم
</h2>
{productContent && (
<p className="productContent">
این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب
دیگری نیز دارد.
</p>
)}
</div>
{/* star holder */}
{star && (
<div className="flex items-center mt-2">
<ul className="flex">
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
<span className="text-xs text-productContent font-bold">
39
</span>
</div>
)}
{/* price holder */}
<div
className={`flex items-center justify-between ${priceDirection}`}
>
{/* price */}
<div className="mt-2">
<div
className={`${
priceDirection.indexOf("col") !== -1 ? "inline" : "flex"
}`}
>
<span className="text-xs text-borderColor ml-2">قیمت</span>
{discountPrice && (
<p className="line-through text-xs text-borderColor mr-2">
145<span>تومان</span>
</p>
)}
</div>
<p className="product-price-num inline">
145.000<span>تومان</span>
</p>
</div>
{/* add to cart */}
<button
className={`addToCart ${
priceDirection.indexOf("col") !== -1 ? "w-full" : ""
}`}
>
اضافه کردن به سبد خرید
</button>
</div>
{/* tag holder */}
{productTags && (
<div className="mt-2 flex flex-wrap">
<button className="product-tag">ارسال رایگان</button>
<button className="product-tag">برچسب های دیگر</button>
<button className="product-tag">دسته بندی به صورت کادو</button>
</div>
)}
</div>
</div>
{/* product items3 */}
<div className="product-items-holder">
{/* item1 */}
<div className="product-item">
{/*star img holder*/}
<div className="w-full relative">
{discountPricePercent && (
<div className="discountPriceBtn">
<p className="dicountPriceNum">
23<span>%</span>
</p>
</div>
)}
{likeBtn && (
<div className="likeBtnBg">
<img src={heart} alt="" className="w-full" />
</div>
)}
{discount && (
<div className="discountBtn">
<img src={discountImg} alt="" className="w-full" />
</div>
)}
{/* img Holder */}
<div className="flex-shrink-0">
<img src={book} alt="" className="w-full rounded-lg" />
</div>
{/* select Color */}
{colors && (
<div className="absolute right-2 bottom-2">
<ul className="flex ">
<li className="ml-1 text-selectColor1">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor2">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor3">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor4">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
</div>
)}
</div>
{/* content holder */}
<div className="mt-4">
<h2 className={`productTitle ${productTitleAlignment}`}>
نسخه چاپی علموم تجربه هفتم
</h2>
{productContent && (
<p className="productContent">
این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب
دیگری نیز دارد.
</p>
)}
</div>
{/* star holder */}
{star && (
<div className="flex items-center mt-2">
<ul className="flex">
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
<span className="text-xs text-productContent font-bold">
39
</span>
</div>
)}
{/* price holder */}
<div
className={`flex items-center justify-between ${priceDirection}`}
>
{/* price */}
<div className="mt-2">
<div
className={`${
priceDirection.indexOf("col") !== -1 ? "inline" : "flex"
}`}
>
<span className="text-xs text-borderColor ml-2">قیمت</span>
{discountPrice && (
<p className="line-through text-xs text-borderColor mr-2">
145<span>تومان</span>
</p>
)}
</div>
<p className="product-price-num inline">
145.000<span>تومان</span>
</p>
</div>
{/* add to cart */}
<button
className={`addToCart ${
priceDirection.indexOf("col") !== -1 ? "w-full" : ""
}`}
>
اضافه کردن به سبد خرید
</button>
</div>
{/* tag holder */}
{productTags && (
<div className="mt-2 flex flex-wrap">
<button className="product-tag">ارسال رایگان</button>
<button className="product-tag">برچسب های دیگر</button>
<button className="product-tag">دسته بندی به صورت کادو</button>
</div>
)}
</div>
</div>
{/* product items4 */}
<div className="product-items-holder">
{/* item1 */}
<div className="product-item">
{/*star img holder*/}
<div className="w-full relative">
{discountPricePercent && (
<div className="discountPriceBtn">
<p className="dicountPriceNum">
23<span>%</span>
</p>
</div>
)}
{likeBtn && (
<div className="likeBtnBg">
<img src={heart} alt="" className="w-full" />
</div>
)}
{discount && (
<div className="discountBtn">
<img src={discountImg} alt="" className="w-full" />
</div>
)}
{/* img Holder */}
<div className="flex-shrink-0">
<img src={book} alt="" className="w-full rounded-lg" />
</div>
{/* select Color */}
{colors && (
<div className="absolute right-2 bottom-2">
<ul className="flex ">
<li className="ml-1 text-selectColor1">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor2">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor3">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor4">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
</div>
)}
</div>
{/* content holder */}
<div className="mt-4">
<h2 className={`productTitle ${productTitleAlignment}`}>
نسخه چاپی علموم تجربه هفتم
</h2>
{productContent && (
<p className="productContent">
این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب
دیگری نیز دارد.
</p>
)}
</div>
{/* star holder */}
{star && (
<div className="flex items-center mt-2">
<ul className="flex">
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
<span className="text-xs text-productContent font-bold">
39
</span>
</div>
)}
{/* price holder */}
<div
className={`flex items-center justify-between ${priceDirection}`}
>
{/* price */}
<div className="mt-2">
<div
className={`${
priceDirection.indexOf("col") !== -1 ? "inline" : "flex"
}`}
>
<span className="text-xs text-borderColor ml-2">قیمت</span>
{discountPrice && (
<p className="line-through text-xs text-borderColor mr-2">
145<span>تومان</span>
</p>
)}
</div>
<p className="product-price-num inline">
145.000<span>تومان</span>
</p>
</div>
{/* add to cart */}
<button
className={`addToCart ${
priceDirection.indexOf("col") !== -1 ? "w-full" : ""
}`}
>
اضافه کردن به سبد خرید
</button>
</div>
{/* tag holder */}
{productTags && (
<div className="mt-2 flex flex-wrap">
<button className="product-tag">ارسال رایگان</button>
<button className="product-tag">برچسب های دیگر</button>
<button className="product-tag">دسته بندی به صورت کادو</button>
</div>
)}
</div>
</div>
{/* product items5 */}
<div className="product-items-holder">
{/* item1 */}
<div className="product-item">
{/*star img holder*/}
<div className="w-full relative">
{discountPricePercent && (
<div className="discountPriceBtn">
<p className="dicountPriceNum">
23<span>%</span>
</p>
</div>
)}
{likeBtn && (
<div className="likeBtnBg">
<img src={heart} alt="" className="w-full" />
</div>
)}
{discount && (
<div className="discountBtn">
<img src={discountImg} alt="" className="w-full" />
</div>
)}
{/* img Holder */}
<div className="flex-shrink-0">
<img src={book} alt="" className="w-full rounded-lg" />
</div>
{/* select Color */}
{colors && (
<div className="absolute right-2 bottom-2">
<ul className="flex ">
<li className="ml-1 text-selectColor1">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor2">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor3">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-selectColor4">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
</div>
)}
</div>
{/* content holder */}
<div className="mt-4">
<h2 className={`productTitle ${productTitleAlignment}`}>
نسخه چاپی علموم تجربه هفتم
</h2>
{productContent && (
<p className="productContent">
این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب
دیگری نیز دارد.
</p>
)}
</div>
{/* star holder */}
{star && (
<div className="flex items-center mt-2">
<ul className="flex">
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
<li className="ml-1 text-productStar">
{/* <FontAwesomeIcon icon="check-square" /> */}
</li>
</ul>
<span className="text-xs text-productContent font-bold">
39
</span>
</div>
)}
{/* price holder */}
<div
className={`flex items-center justify-between ${priceDirection}`}
>
{/* price */}
<div className="mt-2">
<div
className={`${
priceDirection.indexOf("col") !== -1 ? "inline" : "flex"
}`}
>
<span className="text-xs text-borderColor ml-2">قیمت</span>
{discountPrice && (
<p className="line-through text-xs text-borderColor mr-2">
145<span>تومان</span>
</p>
)}
</div>
<p className="product-price-num inline">
145.000<span>تومان</span>
</p>
</div>
{/* add to cart */}
<button
className={`addToCart ${
priceDirection.indexOf("col") !== -1 ? "w-full" : ""
}`}
>
اضافه کردن به سبد خرید
</button>
</div>
{/* tag holder */}
{productTags && (
<div className="mt-2 flex flex-wrap">
<button className="product-tag">ارسال رایگان</button>
<button className="product-tag">برچسب های دیگر</button>
<button className="product-tag">دسته بندی به صورت کادو</button>
</div>
)}
</div>
</div>
</div>
</section>
);
};
export default ProductDesign;
ProductDesign.defaultProps = {
colors: true,
likeBtn: true,
discount: true,
discountPricePercent: true,
discountPrice: true,
productContent: true,
star: true,
productTags: true,
priceDirection: "flex-row",
productTitleAlignment: "text-justify",
};

@ -0,0 +1,42 @@
.product-items-holder {
@apply w-full flex flex-wrap items-center justify-around my-10 px-4;
}
.product-item {
@apply w-full sm:w-60 md:w-72 mx-1 rounded-lg shadow-sm border p-2 my-3;
}
.discountPriceBtn {
@apply bg-discountPriceBg absolute left-2 top-4 rounded-md px-2 py-1;
}
.likeBtnBg {
@apply bg-likeBtnBg absolute left-2 top-10 rounded-md p-1;
}
.discountBtn {
@apply absolute left-2 top-20 rounded-md;
}
.dicountPriceNum {
@apply text-discountPriceTitle font-bold text-xs;
}
.productTitle {
@apply text-productTitle leading-4 text-base 2xl:text-lg;
}
.productContent {
@apply text-justify text-productContent mt-2 text-sm leading-6;
}
.addToCart {
@apply rounded-2xl px-2 py-3 border text-xs text-productPrice;
}
.product-price-num {
@apply text-sm text-productPrice font-semibold;
}
.product-tag {
@apply rounded bg-productTagBg text-productTag m-1 px-4 py-1 text-xs;
}

@ -1,13 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

@ -1,17 +1,14 @@
import React from 'react'; import React from "react";
import ReactDOM from 'react-dom'; import ReactDOM from "react-dom";
import './index.css'; import "./index.scss";
import App from './App'; import App from "./App";
import reportWebVitals from './reportWebVitals'; import reportWebVitals from "./reportWebVitals";
ReactDOM.render( ReactDOM.render(
<React.StrictMode> <React.StrictMode>
<App /> <App />
</React.StrictMode>, </React.StrictMode>,
document.getElementById('root') document.getElementById("root")
); );
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals(); reportWebVitals();

@ -0,0 +1,16 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "./components/productDesign/ProductDesign.scss";
@font-face {
font-family: "iransans-medium";
src: url(./assets/fonts/iransans/ttf/IRANSansWeb_Medium.ttf);
}
body {
font-family: iransans-medium;
direction: rtl;
background-color: #f5f5f5;
}

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

@ -0,0 +1,30 @@
module.exports = {
content: ["./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
textColor: (theme) => ({
...theme("colors"),
discountPriceTitle: "#4ACA53",
productTitle: "#246E8A",
productContent: "#707070",
productStar: "#F7FF00",
productPrice: "#132F52",
productBorderBtn: "FFF3F3",
productTag: "#38A1B6",
borderColor: "#dbdbdb",
selectColor1: "#924EEB",
selectColor2: "#89ECFF",
selectColor3: "#FC5353",
selectColor4: "#FCF653",
}),
backgroundColor: (theme) => ({
...theme("colors"),
productTagBg: "#E1FAFF",
likeBtnBg: "#FFF3F3",
discountPriceBg: "#F0FFF1",
counterBg: "#66B1EB",
incrementDecrementBg: "#2E7AB5",
}),
},
plugins: [],
};
Loading…
Cancel
Save