You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
139 lines
4.4 KiB
139 lines
4.4 KiB
import React from "react"; |
|
|
|
import "./BlogDesign2.scss"; |
|
|
|
import blogFeaturedImage2 from "../../../assets/images/blog-featured-image2.jpg"; |
|
import blogAuthorImg from "../../../assets/images/blog-author.png"; |
|
|
|
import commentIcon from "../../../assets/icons/light-gray-comment-icon.svg"; |
|
import whiteCommentIcon from "../../../assets/icons/white-comment-icon.svg"; |
|
|
|
import playBtn from "./play-button.svg"; |
|
|
|
const BlogDesign2 = ({ |
|
blogSubTitle, |
|
dateButton, |
|
tagButton, |
|
blogAuthor, |
|
blogComments, |
|
commentNumBgColor, |
|
commentNumTextColor, |
|
commentNumTopPosition, |
|
commentNumRightPosition, |
|
}) => { |
|
return ( |
|
<section className="w-4/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-productTitle bg-green-100 p-2 rounded text-base"> |
|
طراحی بلاگ 2 |
|
</h2> |
|
</div> |
|
<div className="mb-6"> |
|
<p className="leading-10"> |
|
آدرس: |
|
<span className="bg-blue-400 text-white rounded shadow-sm px-2 py-1 mx-2"> |
|
blogs/design2 |
|
</span> |
|
</p> |
|
</div> |
|
{/* blog UI Design2 */} |
|
<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", |
|
backgroundColor: "red", |
|
}} |
|
> |
|
{dateButton && ( |
|
<button className="bg-yellow-100 rounded p-1 text-sm absolute left-2 top-4"> |
|
1400/09/19 |
|
</button> |
|
)} |
|
{tagButton && ( |
|
<button className="bg-yellow-100 rounded p-1 text-sm absolute left-2 top-4"> |
|
تگ |
|
</button> |
|
)} |
|
<div className="z-10 child-text"> |
|
<h2 className="text-white text-base font-bold leading-6"> |
|
آیا مواد غذایی پر فیبر مفید هستند؟ |
|
</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 className="absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2"> |
|
<div |
|
className={` rounded-full p-4 group-hover:scale-125 transform transition-transform duration-300 bg-playButtonIcon`} |
|
> |
|
<img src={playBtn} alt="" /> |
|
</div> |
|
</div> |
|
</div> |
|
</section> |
|
); |
|
}; |
|
|
|
export default BlogDesign2; |
|
|
|
// background color i used in commnet number background color |
|
// bg-lightGrayBgColor |
|
// bg-white |
|
|
|
// text color i used for comment number text color: |
|
// text-grayTextColor |
|
// text-white |
|
|
|
BlogDesign2.defaultProps = { |
|
blogSubTitle: true, |
|
dateButton: true, |
|
tagButton: false, |
|
blogAuthor: true, |
|
blogComments: true, |
|
|
|
commentNumBgColor: "bg-white", |
|
commentNumTextColor: "text-grayTextColor", |
|
commentNumTopPosition: "-top-2", |
|
commentNumRightPosition: "-right-2", |
|
};
|
|
|