Create Card component

This commit is contained in:
Mathias Wagner 2025-02-16 21:36:05 +01:00
parent e575e0f5cd
commit 645ca38564
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import "./styles.sass";
export const Card = ({game}) => {
const openGame = () => {
window.open(game.url, "_blank");
}
return (
<div className="card">
{game.banner && <img src={game.banner} alt={game.title} />}
<div className="card-content">
<h2>{game.name}</h2>
<p>{game.description}</p>
<div className="btn-area">
<button className="btn btn-full" onClick={openGame}>Spielen</button>
<button className="btn btn-light">Informationen</button>
</div>
</div>
</div>
)
}

View File

@ -0,0 +1,23 @@
@use "@/styles/colors" as *
.card
width: 25rem
border-radius: 2rem
background-color: rgba($primary, 0.05)
.card-content
padding: 1rem 2rem 2rem 2rem
h2
margin: 0
p
color: $text-light
img
width: 100%
border-radius: 2rem 2rem 0 0
.btn-area
display: flex
gap: 0.5rem