parent
ba9fab8a61
commit
c4c3a36ae6
3 changed files with 107 additions and 5 deletions
@ -0,0 +1,70 @@ |
||||
import React from "react"; |
||||
|
||||
const Design2D = ({ array }) => { |
||||
return ( |
||||
<section className="flex items-center justify-around"
|
||||
style={{height: '420px'}} |
||||
> |
||||
{array.map((item, index) => ( |
||||
<div |
||||
className={`flex flex-col justify-center h-full`} |
||||
style={{ flex: item.flex, |
||||
// display:'-webkit-box',
|
||||
// display:'flex',
|
||||
// maxHeight: '400px',
|
||||
// minHeight: '400px'
|
||||
|
||||
}} |
||||
key={index} |
||||
> |
||||
{item.items.map((item1, index) => ( |
||||
<div |
||||
className={`flex p-2 ${item1.bg}`} |
||||
style={{ flex: item1.flex }} |
||||
key={index} |
||||
> |
||||
<div className="bg-gray-200 w-full h-full flex items-center rounded-xl justify-center" |
||||
style={{ |
||||
backgroundImage: `url(${item1.image})`, |
||||
backgroundSize: 'cover', |
||||
backgroundRepeat: 'no-repeat', |
||||
backgroundPosition: 'center' |
||||
}} |
||||
> |
||||
{/* <p>inside div</p> */} |
||||
{/* <img src={item1.image} className=' rounded-xl' style={{ |
||||
objectFit: 'cover', |
||||
display: 'block', |
||||
minWidth: '100%' |
||||
}}/> */} |
||||
</div> |
||||
</div> |
||||
))} |
||||
</div> |
||||
))} |
||||
</section> |
||||
); |
||||
}; |
||||
|
||||
export default Design2D; |
||||
|
||||
Design2D.defaultProps = { |
||||
array: [ |
||||
{ |
||||
flex: 5, |
||||
items: [{ bg: "bg-red-500", flex: 1 }], |
||||
}, |
||||
{ |
||||
flex: 3, |
||||
items: [ |
||||
{ bg: "bg-blue-500", flex: 1 }, |
||||
{ bg: "bg-yellow-500", flex: 1 }, |
||||
], |
||||
}, |
||||
{ |
||||
flex: 3, |
||||
items: [{ bg: "bg-green-500", flex: 1 }], |
||||
}, |
||||
|
||||
], |
||||
}; |
Loading…
Reference in new issue