Skip to content

Commit

Permalink
feat: card DONE
Browse files Browse the repository at this point in the history
  • Loading branch information
maitrakhatri committed Jan 30, 2022
1 parent 8c18245 commit d491964
Show file tree
Hide file tree
Showing 3 changed files with 254 additions and 0 deletions.
94 changes: 94 additions & 0 deletions card/card.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
@import url(../style.css);
@import url(../badge/badge.css);

.card {
display: flex;
flex-direction: column;
width: 15rem;
border: 1px solid black;
border-radius: .25rem;
background-color: var(--bg-cus);
}

.card-title {
border-bottom: 1px solid black;
padding: 0.5rem;
font-weight: bold;

}

.card-body {
padding: 0.5rem;
}

.card-title.dismiss {
display: flex;
align-items: center;
}

.card-title.dismiss img {
width: 2rem;
margin-left: auto;
}

.card-title.dismiss img:hover {
cursor: pointer;
}

.card-with-image {
width: fit-content;
}

.card-img img {
border-radius: .25rem;
}

.card-with-image .card-title {
border: none;
}

.horizontal {
display: flex;
flex-flow: row;
}

.card-with-image.horizontal {
height: 150px;
width: 30rem;
}

.card-side-body {
display: flex;
flex-direction: column;
}

.vertical {
width: min-content;
}

.text-overlay {
width: min-content;
}

.text-overlay .card-title {
padding: 0;
margin: 0;
}

.text-overlay .card-title {
position: relative;
}

.text-overlay .card-overlay-title {
position: absolute;
bottom: 1rem;
padding: 0.5rem;
}

.card-with-badge {
position: relative;
}

.shadow {
filter: drop-shadow(0 0 0.25rem black);
}
159 changes: 159 additions & 0 deletions card/card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>card</title>
<link rel="stylesheet" href="card.css">
<style>

/* ONLY FOR DISPLAY PURPOSES. NOT PART OF COMPONENT */

body {
margin: 2rem;
display: inline-flex;
flex-flow: row wrap;
}

body > div {
margin: 2rem;
}

</style>
</head>
<body>

<div class="card">

<div class="card-title">
Text only Card
</div>

<div class="card-body">
<p>
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Expedita, dicta!
</p>
</div>

</div>

<div class="card card-with-badge">

<div class="card-title">
Card with Badge
</div>

<div class="card-body">
<p>
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Expedita, dicta!
</p>
</div>

<span class="badge blue">5</span>

</div>

<div class="card">

<div class="card-title dismiss">
Card with dismiss
<img src="close_black_24dp.svg" alt="close button">
</div>

<div class="card-body">
<p>
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Expedita, dicta!
</p>
</div>

</div>


<div class="card card-with-image">

<div class="card-img">
<img src="https://picsum.photos/300/150" alt="card image">
</div>

<div class="card-title">
Card with Image
</div>

<div class="card-body">
Lorem ipsum dolor sit amet.
</div>

</div>

<div class="card card-with-image shadow">

<div class="card-img">
<img src="https://picsum.photos/300/150" alt="card image">
</div>

<div class="card-title">
Card with Shadow
</div>

<div class="card-body">
Lorem ipsum dolor sit amet.
</div>

</div>

<div class="card card-with-image horizontal">

<div class="card-img">
<img src="https://picsum.photos/150/150" alt="card image">
</div>

<div class="card-side-body">

<div class="card-title">
Horizontal Card
</div>

<div class="card-body">
Lorem ipsum dolor sit Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsam, doloremque? amet consectetur adipisicing elit. Perspiciatis, odio.
</div>
</div>

</div>

<div class="card card-with-image vertical">

<div class="card-img">
<img src="https://picsum.photos/200/300" alt="card image">
</div>

<div class="card-title">
Vertical/Standard Card
</div>

<div class="card-body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil, necessitatibus?
</div>

</div>

<div class="card card-with-image text-overlay">

<div class="card-title">
<div class="card-img">
<img src="https://picsum.photos/300/150" alt="card image">
</div>
<div class="card-overlay-title">
Text Overlay
</div>
</div>

<div class="card-body">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Similique, eaque.
</div>


</div>

</body>
</html>
1 change: 1 addition & 0 deletions card/close_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d491964

Please sign in to comment.