Skip to content

Commit

Permalink
add product preview component
Browse files Browse the repository at this point in the history
  • Loading branch information
singodiyashubham87 committed Jun 15, 2023
1 parent 34d4583 commit ad3d233
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Frontend-Projects/ProductPreviewComponent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Product Preview Component

Product Preview Component using HTML and CSS. It is responsive too.
This component is reusable too.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions Frontend-Projects/ProductPreviewComponent/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- displays site properly based on user's device -->


<title>Product preview card component</title>
<link rel="stylesheet" href="styles.css">

<!-- Feel free to remove these styles or customise in your own stylesheet -->
<style>
.attribution {
font-size: 11px;
text-align: center;
}

.attribution a {
color: hsl(228, 45%, 44%);
}
</style>
</head>

<body>
<main>
<div class="container">
<div class="image">
<picture>
<source media="(min-width:700px)" class="desktopImage" srcset="images/image-product-desktop.jpg">
<img src="images/image-product-mobile.jpg" alt="">
</picture>
</div>
<div class="text">
<span class="perfume">PERFUME</span>
<h1>
Gabrielle Essence Eau De Parfum
</h1>
<p>
A floral, solar and voluptuous interpretation composed by Olivier Polge,
Perfumer-Creator for the House of CHANEL.
</p>
<div class="price">
<span class="price">$149.99</span>
<span class="smallPrice">$169.99</span>
</div>
<button>
<img class="cart" src="images/icon-cart.svg" alt="">
Add to Cart
</button>
</div>
</div>
</main>

<footer>
<div class="attribution">
Coded by <a href="https://app.netlify.com/teams/mistermickey">Master Mickey</a>.
</div>
</footer>

</body>

</html>
135 changes: 135 additions & 0 deletions Frontend-Projects/ProductPreviewComponent/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,[email protected],700&family=Montserrat:wght@400;700&display=swap');

:root{
--dark-cyan: hsl(158, 36%, 37%);
--cream: hsl(30, 38%, 92%);
--very-dark-blue:hsl(212, 21%, 14%);
--dark-grayish-blue:hsl(228, 12%, 48%);
--white:hsl(0, 0%, 100%);
}
*{
margin: 0;
padding: 0;
}
body{
background-color: var(--cream);
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

picture{
max-width: 100%;
}
img{
max-width: 100%;
border-top-left-radius: .625rem;
border-top-right-radius: .625rem;
}

h1{
font-family: 'Fraunces',sans-serif;
color: var(--very-dark-blue);
margin: .8rem 0;
font-size: 1.6rem;
}

p{
font-size: 11px;
font-family: 'Montserrat', sans-serif;
color: var(--dark-grayish-blue);
font-weight: 600;
margin: .5rem 0 1rem;
line-height: 1.5;
}

button{
display: flex;
align-items: center;
justify-content: center;
padding: .8rem;
background-color: var(--dark-cyan);
border-radius: .625rem;
border: 1px var(--dark-cyan);
color: var(--white);
font-family: 'Montserrat';
font-weight: 700;
min-width: 100%;
}

button:hover{
cursor: pointer;
background-color: hsl(157, 18%, 45%);
}


.container{
background-color: var(--white);
border-radius: .625rem;
display: flex;
/* flex-direction: column; */
justify-content: center;
align-items: center;
margin: 1rem;
}

div.text{
padding: 1.5rem 2rem;
}

.perfume{
letter-spacing: .3rem;
font-size: 70%;
font-family: 'Montserrat', sans-serif;
color: var(--dark-grayish-blue);
font-weight: 700;
}

div.price{
display: flex;
align-items: center;
margin-bottom: 1.5rem;
}

span.price{
font-family: 'Fraunces', sans-serif;
color: var(--dark-cyan);
font-size: 1.7rem;
}

.smallPrice{
font-family: 'Montserrat', sans-serif;
color: var(--dark-grayish-blue);
font-size: .8rem;
font-weight: 700;
margin-left: 1rem;
}

img.cart{
margin-right: .5rem;
}

.attribution{
font-size: .6rem;
font-weight: 700;
font-family: 'Montserrat';
}

@media screen and (max-width:700px) {
.container{
max-width: 500px;
flex-direction: column;
}
}

@media screen and (min-width:700px){
.container{
max-width: 700px;
}
img{
border-bottom-left-radius: .625rem;
border-top-right-radius: 0;
}
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,11 @@ Happy Coding! -->
<td align="center"> <a href="https://github.com/pranjay-poddar/Dev-Geeks/tree/main/Frontend-Projects/RatingComponent"> RatingComponent </a></td>
</tr>

<tr align="center">
<td align="center"> 241.</td>
<td align="center"> <a href="https://github.com/pranjay-poddar/Dev-Geeks/tree/main/Frontend-Projects/ProductPreviewComponent"> ProductPreviewComponent </a></td>
</tr>


</table>

Expand Down

0 comments on commit ad3d233

Please sign in to comment.