Skip to content

Instantly share code, notes, and snippets.

@kissu
Created February 11, 2025 21:26
Show Gist options
  • Save kissu/d0766b55413566dbb91fdcfc75ef0022 to your computer and use it in GitHub Desktop.
Save kissu/d0766b55413566dbb91fdcfc75ef0022 to your computer and use it in GitHub Desktop.
And example of a possible Dribble bucket integration
.btn-green {
text-decoration: none;
background-color: #3DBF59;
padding: 8px;
margin-top: 8px;
color: white;
width: 100%;
display: inline-block;
text-align: center;
}
.btn-green:hover {
background-color: #37AB51;
}
.card-product {
background-color: white;
padding: 16px;
border-radius: 8px;
width: 400px;
margin: auto;
box-shadow: 0 16px 36px rgba(0,0,0,0.2);
}
.card-product-top{
display: flex;
justify-content: space-between;
}
.card-product-top-image {
width: 50%;
flex-shrink: 0;
background-size: cover;
position: relative;
}
.card-product-top-image .position-icon {
position: absolute;
top: 8px;
left: 8px;
color: #FD77A0;
font-size: 18px;
}
.card-product-info {
flex-grow: 1;
padding: 0 16px;
}
.card-product-info i {
color: #FDB434;
}
.card-product-middle {
height: 100px;
width: 100%;
margin: 16px 0;
object-fit: cover;
object-position: center;
}
.card-product-bottom img {
height: 70px;
flex-grow: 1;
margin: 0 8px;
object-fit: cover;
}
.card-product-bottom img:first-child {
margin-left: 0;
}
.card-product-bottom img:last-child {
margin-right: 0;
}
.card-product-bottom {
display: flex;
}
.container {
width: 800px;
margin: 0 auto;
}
@media (max-width: 900px) {
.container {
width: 700px;
}
}
@media (max-width: 700px) {
.container {
width: 500px;
}
}
@media (max-width: 500px) {
.container {
width: 400px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Fancy product card</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
<h1 class="text-center">Code a fancy product card 😎</h1>
<div class="card-product">
<div class="card-product-top">
<div class="card-product-top-image"
style="background-image: url(https://random-pic-a92f0baa4c2c.herokuapp.com/perfume)">
<i class="fas fa-heart position-icon"></i>
</div>
<div class="card-product-info">
<div>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
</div>
<p><strong>Fancy product</strong></p>
<span>It's the best product, you should buy it!</span>
<a href="" class="btn-green">£200</a>
</div>
</div>
<img class="card-product-middle" src="https://random-pic-a92f0baa4c2c.herokuapp.com/makeup" alt="">
<div class="card-product-bottom">
<img src="https://source.unsplash.com/random" alt="" class="">
<img src="https://source.unsplash.com/random" alt="" class="">
<img src="https://source.unsplash.com/random" alt="" class="">
</div>
</div>
</div>
</body>
</html>
/* --- Fonts --- */
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;700&family=Poppins:wght@400;700");
@import url("https://use.fontawesome.com/releases/v6.1.2/css/all.css");
/* --- Components design --- */
@import url("components/container.css");
@import url("components/cards.css");
@import url("components/button.css");
/* --- Fonts & colors --- */
body {
font-family: "Open Sans", "Helvetica", "sans-serif";
padding-bottom: 200px;
margin: 0;
background-color: rgb(240,240,240);
}
h1, h2, h3 {
font-family: "Poppins", "sans-serif";
}
.text-center {
text-align: center;
margin-bottom: 48px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment