Create Card component
This commit is contained in:
parent
e575e0f5cd
commit
645ca38564
23
src/components/Card/Card.jsx
Normal file
23
src/components/Card/Card.jsx
Normal 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>
|
||||
)
|
||||
}
|
23
src/components/Card/styles.sass
Normal file
23
src/components/Card/styles.sass
Normal 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
|
Loading…
x
Reference in New Issue
Block a user