parent
de3b96cbb9
commit
d083715028
8 changed files with 97 additions and 105 deletions
After Width: | Height: | Size: 120 KiB |
After Width: | Height: | Size: 1.3 KiB |
@ -1,112 +1,103 @@ |
|||||||
import React from "react"; |
import React from "react"; |
||||||
|
import Button from "../../Button"; |
||||||
import "./BlogDesign2.scss"; |
import CommentIcon from "../../MiniComponents/CommentIcon"; |
||||||
|
import NewTagDesign from "../../NewTagDesign"; |
||||||
import blogFeaturedImage2 from "../assets/blog-featured-image2.jpg"; |
|
||||||
import blogAuthorImg from "../assets/blog-author.png"; |
|
||||||
import whiteCommentIcon from "../assets/white-comment-icon.svg"; |
|
||||||
|
|
||||||
const BlogDesign2 = ({ |
const BlogDesign2 = ({ |
||||||
|
blogTitle, |
||||||
blogSubTitle, |
blogSubTitle, |
||||||
|
featuredImage, |
||||||
dateButton, |
dateButton, |
||||||
tagButton, |
tagButton, |
||||||
blogAuthor, |
blogAuthor, |
||||||
|
blogAuthorImg, |
||||||
blogComments, |
blogComments, |
||||||
commentNumBgColor, |
|
||||||
commentNumTextColor, |
|
||||||
commentNumTopPosition, |
|
||||||
commentNumRightPosition, |
|
||||||
}) => { |
}) => { |
||||||
return ( |
return ( |
||||||
<section className="w-4/12 mx-auto p-4 bg-white rounded-md shadow-md my-8"> |
<div |
||||||
<div |
className="group min-w-[550px] relative flex flex-col justify-end p-4 cursor-pointer" |
||||||
className="parent relative flex flex-col justify-end p-3 cursor-pointer" |
// style={{
|
||||||
style={{ |
// backgroundImage: `url(${featuredImage})`,
|
||||||
backgroundImage: `url(${blogFeaturedImage2})`, |
// backgroundSize: "100% 100%",
|
||||||
backgroundSize: "100% 100%", |
// backgroundRepeat: "no-repeat",
|
||||||
backgroundRepeat: "no-repeat", |
// // minHeight: "300px",
|
||||||
// minHeight: "300px",
|
// height: "calc(100vh/3)",
|
||||||
height: "calc(100vh/3)", |
// maxHeight: "300px",
|
||||||
maxHeight: "300px", |
// }}
|
||||||
}} |
> |
||||||
> |
{dateButton && ( |
||||||
{dateButton && ( |
<Button |
||||||
<button className="bg-yellow-100 rounded p-1 text-sm absolute left-2 top-4"> |
text={"1400/09/19"} |
||||||
1400/09/19 |
className={ |
||||||
</button> |
"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"> |
)} |
||||||
تگ |
{tagButton && ( |
||||||
</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 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> |
||||||
)} |
)} |
||||||
<div className="z-10 child-text"> |
{blogSubTitle && ( |
||||||
<h2 className="text-white text-base font-bold leading-6"> |
<h2 className="text-white text-base mt-2 font-sansbold leading-6"> |
||||||
آیا مواد غذایی پر فیبر مفید هستند؟ |
شما چه فکری می کنید |
||||||
</h2> |
</h2> |
||||||
{blogSubTitle && ( |
)} |
||||||
<h2 className="text-white text-base mt-2 font-bold leading-6"> |
|
||||||
شما چه فکری می کنید |
|
||||||
</h2> |
|
||||||
)} |
|
||||||
</div> |
|
||||||
<div className="z-10 flex item-center justify-between w-full mt-4"> |
|
||||||
{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> |
|
||||||
</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> |
|
||||||
</div> |
|
||||||
)} |
|
||||||
</div> |
|
||||||
<div |
|
||||||
style={{ |
|
||||||
zIndex: 0, |
|
||||||
background: |
|
||||||
"linear-gradient(0deg, rgba(0,0,0,1) 0%, rgba(2,0,36,0) 100%)", |
|
||||||
}} |
|
||||||
className="absolute right-0 bottom-0 h-full w-full" |
|
||||||
></div> |
|
||||||
</div> |
</div> |
||||||
</section> |
<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="author" className="w-8" /> |
||||||
|
<p className="mr-2 text-sm text-white">{blogAuthor}</p> |
||||||
|
</div> |
||||||
|
)} |
||||||
|
{blogComments && ( |
||||||
|
<div className="flex items-center"> |
||||||
|
<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> |
||||||
|
<div |
||||||
|
style={{ |
||||||
|
zIndex: 0, |
||||||
|
background: |
||||||
|
"linear-gradient(0deg, rgba(0,0,0,1) 0%, rgba(2,0,36,0) 100%)", |
||||||
|
}} |
||||||
|
className="absolute right-0 bottom-0 h-full w-full" |
||||||
|
></div> |
||||||
|
</div> |
||||||
); |
); |
||||||
}; |
}; |
||||||
|
|
||||||
export default BlogDesign2; |
export default BlogDesign2; |
||||||
|
|
||||||
// background color i used in commnet number background color
|
BlogDesign2.defaultProps = { |
||||||
// bg-lightGrayBgColor
|
blogTitle: `آیا مواد غذای پر فیبر و مفید هستند؟`, |
||||||
// bg-white
|
blogSubTitle: `شما چه فکری می کنید`, |
||||||
|
|
||||||
// text color i used for comment number text color:
|
featuredImage: "images/blog-featured-image2.jpg", |
||||||
// text-grayTextColor
|
|
||||||
// text-white
|
blogAuthor: `حامد دژبانی نسب`, |
||||||
|
blogAuthorImg: "images/blog-author.png", |
||||||
|
|
||||||
|
blogComments: `زمان مطالعه 30 دقیقه`, |
||||||
|
|
||||||
BlogDesign2.defaultProps = { |
|
||||||
blogSubTitle: true, |
|
||||||
dateButton: true, |
dateButton: true, |
||||||
tagButton: false, |
tagButton: false, |
||||||
blogAuthor: true, |
|
||||||
blogComments: true, |
|
||||||
|
|
||||||
commentNumBgColor: "bg-white", |
|
||||||
commentNumTextColor: "text-grayTextColor", |
|
||||||
commentNumTopPosition: "-top-2", |
|
||||||
commentNumRightPosition: "-right-2", |
|
||||||
}; |
}; |
||||||
|
Loading…
Reference in new issue