Refactor SheetHeader
styles and layout: adjust attribute card design, improve responsiveness, and streamline conditional rendering logic.
This commit is contained in:
@@ -114,28 +114,28 @@ export default function SheetHeader({jsonData}: { jsonData: CharacterData }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex justify-between items-center py-3 px-10">
|
<div className="flex justify-between items-center py-5 px-5 gap-6">
|
||||||
<div className="w-[20%] h-[20%] rounded-full overflow-hidden">
|
<div className="w-[30%] h-full rounded-md bg-gray-600 overflow-hidden"
|
||||||
<img src="#" alt="char bild"/>
|
style={{height: '12.5em', width: '9.375em'}}>
|
||||||
|
<img src="#" alt="char bild" className="object-cover w-full h-full"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-col gap-2 w-[80%]">
|
<div className="w-[70%] flex flex-col gap-2 w-[80%]">
|
||||||
<div className="flex justify-between">
|
<div className="w-[100%] flex justify-between">
|
||||||
{attributes.map(attr => (
|
{attributes.map(attr => (
|
||||||
<div key={attr.id} className="w-[10%] text-center">
|
<div key={attr.id} className="">
|
||||||
<div className="relative group cursor-help">
|
<div className="relative group cursor-help flex items-center justify-center">
|
||||||
<div className="font-bold">{attr.short}</div>
|
<div>{attr.short}</div>
|
||||||
<span
|
<span
|
||||||
className="absolute left-1/2 transform -translate-x-1/2 bottom-full mb-1 px-2 py-1 bg-gray-800 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 whitespace-nowrap">
|
className="absolute left-1/2 transform -translate-x-1/2 bottom-full bg-gray-800 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200 whitespace-nowrap">
|
||||||
{attr.name}
|
{attr.name}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div>{attr.value}</div>
|
<span className="font-bold" style={{fontSize: '1.5em'}}>{attr.value}</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{jsonData.attr.lp && (
|
|
||||||
<div className="w-[100%] flex pt-2">
|
<div className="w-[100%] flex pt-2">
|
||||||
<span className="relative group cursor-help">
|
<span className="relative group cursor-help">
|
||||||
LP
|
LP
|
||||||
@@ -155,9 +155,7 @@ export default function SheetHeader({jsonData}: { jsonData: CharacterData }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
{jsonData.attr.ae > 0 && (
|
|
||||||
<div className="w-[100%] flex pt-2">
|
<div className="w-[100%] flex pt-2">
|
||||||
<span className="relative group cursor-help">
|
<span className="relative group cursor-help">
|
||||||
AP
|
AP
|
||||||
@@ -177,9 +175,7 @@ export default function SheetHeader({jsonData}: { jsonData: CharacterData }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
{jsonData.attr.kp > 0 && (
|
|
||||||
<div className="w-[100%] flex pt-2">
|
<div className="w-[100%] flex pt-2">
|
||||||
<span className="relative group cursor-help">
|
<span className="relative group cursor-help">
|
||||||
KP
|
KP
|
||||||
@@ -199,9 +195,7 @@ export default function SheetHeader({jsonData}: { jsonData: CharacterData }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
{jsonData.attr.sp > 0 && (
|
|
||||||
<div className="w-[100%] flex pt-2">
|
<div className="w-[100%] flex pt-2">
|
||||||
<span className="relative group cursor-help">
|
<span className="relative group cursor-help">
|
||||||
SP
|
SP
|
||||||
@@ -225,7 +219,6 @@ export default function SheetHeader({jsonData}: { jsonData: CharacterData }) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
Reference in New Issue
Block a user