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 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="parent relative flex flex-col justify-end p-3 cursor-pointer" className="group min-w-[550px] relative flex flex-col justify-end p-4 cursor-pointer"
style={{ // style={{
backgroundImage: `url(${blogFeaturedImage2})`, // backgroundImage: `url(${featuredImage})`,
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 className="bg-yellow-100 rounded p-1 text-sm absolute left-2 top-4"> <Button
1400/09/19 text={"1400/09/19"}
</button> className={
"w-fit bg-yellow-100 p-2 rounded text-xs font-sansbold absolute left-2 top-4"
}
/>
)} )}
{tagButton && ( {tagButton && (
<button className="bg-yellow-100 rounded p-1 text-sm absolute left-2 top-4"> <NewTagDesign
تگ title={"تگ"}
</button> 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"> <div className="z-10 transition-all duration-300 transfrom group-hover:-translate-y-1">
<h2 className="text-white text-base font-bold leading-6"> {blogTitle && (
آیا مواد غذایی پر فیبر مفید هستند؟ <h2 className="text-base text-justify text-white font-sansbold leading-6">
{blogTitle}
</h2> </h2>
)}
{blogSubTitle && ( {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> </h2>
)} )}
</div> </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 && ( {blogAuthor && (
<div className="flex items-center transition duration-200 transform hover:-translate-y-1"> <div className="flex items-center transition duration-200 transform hover:-translate-y-1">
<img src={blogAuthorImg} alt="" className="w-8 h-8" /> <img src={blogAuthorImg} alt="author" className="w-8" />
<p className="text-sm text-white font-light mr-2"> <p className="mr-2 text-sm text-white">{blogAuthor}</p>
حامد دژبانی نسب
</p>
</div> </div>
)} )}
{blogComments && ( {blogComments && (
<div className="flex items-center"> <div className="flex items-center">
<p className="text-sm text-white font-light ml-2"> <p className="ml-2 text-sm text-white">{blogComments}</p>
زمان مطالعه 30 دقیقه <CommentIcon
</p> commentClassName="w-7"
<div className="relative"> icon={"images/white-comment-icon.svg"}
<img src={whiteCommentIcon} alt="" className="w-7 h-7" /> commentNum={"26"}
<span 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"
className={`comment-num absolute ${commentNumBgColor} ${commentNumTextColor} ${commentNumTopPosition} ${commentNumRightPosition}`} />
>
26
</span>
</div>
</div> </div>
)} )}
</div> </div>
@ -84,29 +82,22 @@ const BlogDesign2 = ({
className="absolute right-0 bottom-0 h-full w-full" className="absolute right-0 bottom-0 h-full w-full"
></div> ></div>
</div> </div>
</section>
); );
}; };
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",
}; };

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

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

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

@ -455,18 +455,6 @@ $red: #e92424;
// * end Alert Component // * 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 // TODO Start CardDesign3 Component
.scrollYDesign::-webkit-scrollbar { .scrollYDesign::-webkit-scrollbar {

Loading…
Cancel
Save