update 6 files

master
mahdi andalib 3 years ago
parent de3b96cbb9
commit d083715028
  1. BIN
      public/images/blog-featured-image2.jpg
  2. 11
      public/images/white-comment-icon.svg
  3. 115
      src/components/Blogss/design2/index.js
  4. 2
      src/components/Blogss/index.js
  5. 4
      src/components/Button/index.js
  6. 2
      src/components/MiniComponents/index.js
  7. 12
      src/index.scss

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="33.241" height="33.241" viewBox="0 0 33.241 33.241">
<g id="vuesax_linear_message" data-name="vuesax/linear/message" transform="translate(-684 -186)">
<g id="message" transform="translate(684 186)">
<path id="Vector" d="M9,23.546H8.31C2.77,23.546,0,22.16,0,15.235V8.31Q0,0,8.31,0H19.39Q27.7,0,27.7,8.31v6.925q0,8.31-8.31,8.31H18.7a1.4,1.4,0,0,0-1.108.554l-2.078,2.77a1.968,1.968,0,0,1-3.324,0L10.111,24.1A1.565,1.565,0,0,0,9,23.546Z" transform="translate(2.77 2.77)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector-2" data-name="Vector" d="M.495.5H.507" transform="translate(21.661 14.735)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-3" data-name="Vector" d="M.495.5H.507" transform="translate(16.12 14.735)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-4" data-name="Vector" d="M.495.5H.507" transform="translate(10.578 14.735)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-5" data-name="Vector" d="M0,0H33.241V33.241H0Z" fill="none" opacity="0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -1,77 +1,75 @@
import React from "react";
import "./BlogDesign2.scss";
import blogFeaturedImage2 from "../assets/blog-featured-image2.jpg";
import blogAuthorImg from "../assets/blog-author.png";
import whiteCommentIcon from "../assets/white-comment-icon.svg";
import Button from "../../Button";
import CommentIcon from "../../MiniComponents/CommentIcon";
import NewTagDesign from "../../NewTagDesign";
const BlogDesign2 = ({
blogTitle,
blogSubTitle,
featuredImage,
dateButton,
tagButton,
blogAuthor,
blogAuthorImg,
blogComments,
commentNumBgColor,
commentNumTextColor,
commentNumTopPosition,
commentNumRightPosition,
}) => {
return (
<section className="w-4/12 mx-auto p-4 bg-white rounded-md shadow-md my-8">
<div
className="parent relative flex flex-col justify-end p-3 cursor-pointer"
style={{
backgroundImage: `url(${blogFeaturedImage2})`,
backgroundSize: "100% 100%",
backgroundRepeat: "no-repeat",
// minHeight: "300px",
height: "calc(100vh/3)",
maxHeight: "300px",
}}
className="group min-w-[550px] relative flex flex-col justify-end p-4 cursor-pointer"
// style={{
// backgroundImage: `url(${featuredImage})`,
// backgroundSize: "100% 100%",
// backgroundRepeat: "no-repeat",
// // minHeight: "300px",
// height: "calc(100vh/3)",
// maxHeight: "300px",
// }}
>
{dateButton && (
<button className="bg-yellow-100 rounded p-1 text-sm absolute left-2 top-4">
1400/09/19
</button>
<Button
text={"1400/09/19"}
className={
"w-fit bg-yellow-100 p-2 rounded text-xs font-sansbold absolute left-2 top-4"
}
/>
)}
{tagButton && (
<button className="bg-yellow-100 rounded p-1 text-sm absolute left-2 top-4">
تگ
</button>
<NewTagDesign
title={"تگ"}
icon={false}
tagClassName={
"w-fit bg-yellow-100 p-2 rounded text-xs font-sansbold absolute left-2 top-4"
}
/>
)}
<div className="z-10 child-text">
<h2 className="text-white text-base font-bold leading-6">
آیا مواد غذایی پر فیبر مفید هستند؟
<div className="z-10 transition-all duration-300 transfrom group-hover:-translate-y-1">
{blogTitle && (
<h2 className="text-base text-justify text-white font-sansbold leading-6">
{blogTitle}
</h2>
)}
{blogSubTitle && (
<h2 className="text-white text-base mt-2 font-bold leading-6">
<h2 className="text-white text-base mt-2 font-sansbold leading-6">
شما چه فکری می کنید
</h2>
)}
</div>
<div className="z-10 flex item-center justify-between w-full mt-4">
<div className="w-full flex item-center justify-between mt-4 z-10">
{blogAuthor && (
<div className="flex items-center transition duration-200 transform hover:-translate-y-1">
<img src={blogAuthorImg} alt="" className="w-8 h-8" />
<p className="text-sm text-white font-light mr-2">
حامد دژبانی نسب
</p>
<img src={blogAuthorImg} alt="author" className="w-8" />
<p className="mr-2 text-sm text-white">{blogAuthor}</p>
</div>
)}
{blogComments && (
<div className="flex items-center">
<p className="text-sm text-white font-light ml-2">
زمان مطالعه 30 دقیقه
</p>
<div className="relative">
<img src={whiteCommentIcon} alt="" className="w-7 h-7" />
<span
className={`comment-num absolute ${commentNumBgColor} ${commentNumTextColor} ${commentNumTopPosition} ${commentNumRightPosition}`}
>
26
</span>
</div>
<p className="ml-2 text-sm text-white">{blogComments}</p>
<CommentIcon
commentClassName="w-7"
icon={"images/white-comment-icon.svg"}
commentNum={"26"}
className="w-5 h-5 bg-white text-[#818181] text-[10px] border-[#818181] font-sansbold absolute top-0 right-0 transform translate-x-1 -translate-y-2"
/>
</div>
)}
</div>
@ -84,29 +82,22 @@ const BlogDesign2 = ({
className="absolute right-0 bottom-0 h-full w-full"
></div>
</div>
</section>
);
};
export default BlogDesign2;
// background color i used in commnet number background color
// bg-lightGrayBgColor
// bg-white
BlogDesign2.defaultProps = {
blogTitle: `آیا مواد غذای پر فیبر و مفید هستند؟`,
blogSubTitle: `شما چه فکری می کنید`,
// text color i used for comment number text color:
// text-grayTextColor
// text-white
featuredImage: "images/blog-featured-image2.jpg",
blogAuthor: `حامد دژبانی نسب`,
blogAuthorImg: "images/blog-author.png",
blogComments: `زمان مطالعه 30 دقیقه`,
BlogDesign2.defaultProps = {
blogSubTitle: true,
dateButton: true,
tagButton: false,
blogAuthor: true,
blogComments: true,
commentNumBgColor: "bg-white",
commentNumTextColor: "text-grayTextColor",
commentNumTopPosition: "-top-2",
commentNumRightPosition: "-right-2",
};

@ -20,7 +20,7 @@ function Blogs() {
return (
<div className="w-full flex flex-col items-center">
<select
className="b-10 w-20 bg-gray-200"
className="w-20 bg-gray-200 mb-10"
onChange={(e) => setType(e.target.value)}
>
{Object.keys(list).map((option, index) => (

@ -26,7 +26,9 @@ export default Button;
Button.defaultProps = {
className:
"bg-red-400 text-white hover:bg-gray-900 border border-b-4 border-lightBlueBorderColor rounded text-sm px-4 py-4",
text: "اطلاعات بیشتر",
iconHolderClassName: "bg-darkGreenBg mr-2",
iconClassName: "w-4",
text: "اطلاعات بیشتر",
icon: false,
};

@ -13,7 +13,7 @@ function Blogs() {
return (
<div className="w-full flex flex-col items-center">
<select
className="w-20 bg-gray-200 mb-20"
className="w-20 bg-gray-200 mb-10"
onChange={(e) => setType(e.target.value)}
>
{Object.keys(list).map((option, index) => (

@ -455,18 +455,6 @@ $red: #e92424;
// * end Alert Component
// TODO Start Blogs/Design2 Component
.child-text {
transition: all 0.4s;
}
.parent:hover .child-text {
transition: all 0.4s;
transform: translateY(-7px) !important;
}
// * end Blogs/Design2 Component
// TODO Start CardDesign3 Component
.scrollYDesign::-webkit-scrollbar {

Loading…
Cancel
Save