Enhance card UI with improved styles and hover effects

Adjusted styling for better visuals and responsiveness, including background, shadows, and dimensions. Added interactive hover effects for a dynamic user experience and refined card elements like gloss, label, and tag designs.
This commit is contained in:
2026-02-07 12:54:04 +01:00
parent bc894de505
commit f7730df3ec

View File

@@ -559,62 +559,61 @@ export default function App() {
alignItems: "center", alignItems: "center",
}} }}
> >
{/* Slot-Container: bleibt ruhig, Karte darf drüber schauen */}
<div <div
style={{ style={{
width: "100%",
height: "100%", height: "100%",
minHeight: 0, minHeight: 0,
minWidth: 0,
borderRadius: 18, borderRadius: 18,
border: `1px solid ${stylesTokens.panelBorder}`, border: `1px solid ${stylesTokens.panelBorder}`,
background: stylesTokens.panelBg, background: "rgba(0,0,0,0.10)",
boxShadow: "0 14px 40px rgba(0,0,0,0.45)", backdropFilter: "blur(8px)",
backdropFilter: "blur(10px)", boxShadow: "0 12px 30px rgba(0,0,0,0.30)",
padding: 12, padding: 12,
overflow: "hidden", overflow: "visible", // ✅ Karte darf raus ragen
position: "relative",
display: "grid", display: "grid",
alignItems: "center",
justifyItems: "start",
}} }}
> >
{/* Card itself (like a real identity card) */} {/* Die Karte selbst (kleiner als Container) */}
<div <div
style={{ style={{
width: "100%", width: "78%", // ✅ nicht volle Breite
height: "100%", maxWidth: 320,
minHeight: 0, aspectRatio: "63 / 88", // typisch Kartenformat
borderRadius: 16, borderRadius: 16,
border: `2px solid ${borderColor}`, border: `2px solid ${borderColor}`,
boxShadow: `0 0 0 1px rgba(255,255,255,0.06), 0 16px 50px rgba(0,0,0,0.45)`, boxShadow: `0 18px 55px rgba(0,0,0,0.55), 0 0 26px rgba(124,77,255,0.22)`,
overflow: "hidden", overflow: "hidden",
position: "relative", position: "relative",
background: ` background: "rgba(0,0,0,0.15)",
radial-gradient(120% 140% at 20% 10%, rgba(255,255,255,0.10), transparent 55%), transform: "translateY(-10px) rotate(-0.6deg)", // ✅ schaut leicht raus
linear-gradient(180deg, rgba(0,0,0,0.14), rgba(0,0,0,0.28)) transformOrigin: "center bottom",
`, transition: "transform 180ms ease, box-shadow 180ms ease",
display: "grid", cursor: "pointer",
gridTemplateRows: "1fr",
}} }}
> onMouseMove={(e) => {
{/* Subtle gloss */} // einfacher Tilt ohne extra libs
<div const rect = e.currentTarget.getBoundingClientRect();
style={{ const x = (e.clientX - rect.left) / rect.width; // 0..1
position: "absolute", const y = (e.clientY - rect.top) / rect.height; // 0..1
inset: 0, const rx = (0.5 - y) * 6; // tilt range
background: const ry = (x - 0.5) * 8;
"linear-gradient(120deg, rgba(255,255,255,0.08) 0%, transparent 35%, transparent 65%, rgba(255,255,255,0.04) 100%)",
pointerEvents: "none",
opacity: 0.8,
}}
/>
{/* Image fill */} e.currentTarget.style.transform = `translateY(-16px) rotate(-0.6deg) perspective(700px) rotateX(${rx}deg) rotateY(${ry}deg)`;
<div }}
style={{ onMouseLeave={(e) => {
position: "absolute", e.currentTarget.style.transform = "translateY(-10px) rotate(-0.6deg)";
inset: 0, }}
display: "grid", onMouseEnter={(e) => {
placeItems: "center", e.currentTarget.style.transform = "translateY(-18px) rotate(-0.6deg)";
background: "rgba(0,0,0,0.20)", e.currentTarget.style.boxShadow = `0 26px 70px rgba(0,0,0,0.62), 0 0 34px ${borderColor}`;
}} }}
> >
{/* Image */}
<img <img
src={img} src={img}
alt={name} alt={name}
@@ -624,12 +623,24 @@ export default function App() {
height: "100%", height: "100%",
objectFit: "cover", objectFit: "cover",
transform: "scale(1.02)", transform: "scale(1.02)",
filter: "contrast(1.02) saturate(1.05)", filter: "contrast(1.02) saturate(1.06)",
display: "block",
}} }}
/> />
</div>
{/* Bottom label plate */} {/* Gloss */}
<div
style={{
position: "absolute",
inset: 0,
background:
"linear-gradient(120deg, rgba(255,255,255,0.10) 0%, transparent 35%, transparent 70%, rgba(255,255,255,0.06) 100%)",
pointerEvents: "none",
opacity: 0.7,
}}
/>
{/* Bottom label glass */}
<div <div
style={{ style={{
position: "absolute", position: "absolute",
@@ -637,7 +648,7 @@ export default function App() {
right: 10, right: 10,
bottom: 10, bottom: 10,
borderRadius: 12, borderRadius: 12,
background: "rgba(0,0,0,0.42)", background: "rgba(0,0,0,0.45)",
border: "1px solid rgba(255,255,255,0.10)", border: "1px solid rgba(255,255,255,0.10)",
backdropFilter: "blur(6px)", backdropFilter: "blur(6px)",
padding: "10px 12px", padding: "10px 12px",
@@ -650,7 +661,7 @@ export default function App() {
color: stylesTokens.textMain, color: stylesTokens.textMain,
fontWeight: 900, fontWeight: 900,
fontSize: 14, fontSize: 14,
letterSpacing: 0.3, letterSpacing: 0.2,
lineHeight: 1.1, lineHeight: 1.1,
textShadow: "0 10px 30px rgba(0,0,0,0.55)", textShadow: "0 10px 30px rgba(0,0,0,0.55)",
}} }}
@@ -682,7 +693,7 @@ export default function App() {
</div> </div>
</div> </div>
{/* Tiny corner stamp */} {/* Corner tag */}
<div <div
style={{ style={{
position: "absolute", position: "absolute",
@@ -693,8 +704,8 @@ export default function App() {
letterSpacing: 1.2, letterSpacing: 1.2,
padding: "4px 8px", padding: "4px 8px",
borderRadius: 999, borderRadius: 999,
color: "rgba(255,255,255,0.72)", color: "rgba(255,255,255,0.75)",
border: "1px solid rgba(255,255,255,0.12)", border: "1px solid rgba(255,255,255,0.14)",
background: "rgba(0,0,0,0.28)", background: "rgba(0,0,0,0.28)",
backdropFilter: "blur(6px)", backdropFilter: "blur(6px)",
textTransform: "uppercase", textTransform: "uppercase",
@@ -703,12 +714,29 @@ export default function App() {
Identity Identity
</div> </div>
</div> </div>
{/* optional: kleiner Slot-Titel (kannst du löschen) */}
<div
style={{
position: "absolute",
left: 14,
top: 12,
fontSize: 12,
fontWeight: 900,
color: stylesTokens.textDim,
opacity: 0.85,
pointerEvents: "none",
}}
>
Spielerkarte
</div>
</div> </div>
</div> </div>
); );
}; };
return ( return (
<div style={styles.page}> <div style={styles.page}>
<div style={styles.bgFixed} aria-hidden="true"> <div style={styles.bgFixed} aria-hidden="true">