Skip to content

Carrot store fetch challenge #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: nicoleta-tuturuga
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions carrot-store-UI/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
264 changes: 264 additions & 0 deletions carrot-store-UI/details/details.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
.container {
width: 100%;
}

/* Main content */
.main-content-product {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}


/* Product details + image container */
.product-details-page {
display: flex;
justify-content: center;
flex-wrap: wrap;
margin: 40px 0;
padding: 20px;

}

.product-details-page > div {
width: 90%;
display: flex;
flex-direction: column;
align-items: center;
}

.product-details-page > div > a > img {
width: 100%;
height: 100%;
margin-bottom: 30px;
}

.product-title {
font-weight: 700;
font-size: 20px;
margin-bottom: 30px;
}

.pricing-details {
align-self: flex-end;
}

.pricing-details > p {
margin-top: 40px;
margin-bottom: 10px;
font-size: 15px;
font-weight: 500;
}

.pricing-details span {
color: #EC7A23;
font-weight: 500;

}

.pricing-details > button {
background-color: #EC7A23;
width: 150px;
height: 40px;
border: none;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 30px;
}

.submit{
display: flex;
align-items: center;
}

.add-to-cart {
font-size: 15px;
color: #ffffff;
text-decoration: none;
margin-right: 5px;
}


/* Comments section */
.comments-section {
width: 100%;
}

.comments-section > div {
display: flex;
margin: 20px;
}

.comments-section img {
width: 70px;
height: 70px;
border-radius: 50%;
margin-right: 10px;
}

.user-comment > p:first-child {
font-size: 20px;
font-weight: 500;
}

.user-comment > p {
margin-bottom: 10px;
}


/* Comments form */
.form-container {
display: flex;
justify-content: center;
width: 100%;
margin: 70px 0 100px 0;
}

.form {
width: 80%;
display: flex;
flex-direction: column;
}

.form > p {
font-size: 30px;
margin-bottom: 20px;
}

.form > label {
margin: 10px 0;
}

.form > input {
padding: 2px;
border-radius: 5%;
border: 1px solid #9F9F9F;
}


@media only screen and (min-width: 768px) {
.product-details-page > div > a > img {
width: 80%;
height: 100%;
margin-bottom: 40px;
}
.product-details-page > div > p {
line-height: 34px;
}
.pricing-details > p {
margin-bottom: 20px;
font-size: 25px;
}
.pricing-details > button {
width: 200px;
height: 70px;
}
.add-to-cart {
font-size: 20px;
}

/* Comments section */
.comments-section {
width: 90%;
}
.comments-section > div {
font-size: 20px;
line-height: 25px;
}
.comments-section img {
width: 150px;
height: 150px;
margin-right: 30px;

}
.user-comment > p:first-child {
font-size: 30px;
}
.user-comment > p {
margin-bottom: 50px;
}

/* Comments form */
.form > p {
font-size: 30px;
}
.form > label {
font-size: 20px;

}

.form > input {
width: 100%;
font-size: 20px;
padding: 5px;
margin-bottom: 20px;
}
}

@media only screen and (min-width: 1000px) {
.product-details-page > div {
width: 45%;
}
.product-details-page > div > a > img {
width: 100%;
height: 100%;
}
.product-details-page > div > p {
line-height: 28px;
width: 80%;
}
.pricing-details > p {
margin-bottom: 10px;
font-size: 20px;
}
.pricing-details > button {
width: 150px;
height: 40px;
}
.add-to-cart {
font-size: 15px;
}

/* Comments section */
.comments-section {
width: 80%;
}
.comments-section > div {
font-size: 18px;
line-height: 28px;
}
.comments-section img {
width: 70px;
height: 70px;
margin-right: 10px;

}
.user-comment > p:first-child {
font-size: 20px;
}
.user-comment > p {
margin-bottom: 10px;
}

/* Coments form */
.form-container {
margin-top: 100px;
}
.form{
width: 25%;
}
.form > p {
font-size: 30px;
}
.form > label {
font-size: 18px;

}

.form > input {
font-size: 18px;
margin-bottom: 10px;
}
}
76 changes: 76 additions & 0 deletions carrot-store-UI/details/details.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../home/home.css">
<link rel="stylesheet" type="text/css" href="../list/list.css">
<link rel="stylesheet" ty="text/css" href="details.css">
<title>Document</title>
</head>

<body>
<div class="container">

<!-- Header -->
<header></header>


<div class="main-content-product">
<div class="product-details-page">
<div>
<a href="#">
<img class="product-img">
</a>
</div>
<div>
<!-- <div class="product-description"> -->
<p class="product-title"></p>
<p class="product-description"></p>
<div class="pricing-details">
<p> <span class="product-price"></span> <span class="product-currency"></span></p>
<button type="submit">
<a class="add-to-cart" href="#">
Add to cart
</a>
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="shopping-cart"
class="svg-inline--fa fa-shopping-cart fa-w-18" role="img"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
<path fill="currentColor"
d="M528.12 301.319l47.273-208C578.806 78.301 567.391 64 551.99 64H159.208l-9.166-44.81C147.758 8.021 137.93 0 126.529 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24h69.883l70.248 343.435C147.325 417.1 136 435.222 136 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-15.674-6.447-29.835-16.824-40h209.647C430.447 426.165 424 440.326 424 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-22.172-12.888-41.332-31.579-50.405l5.517-24.276c3.413-15.018-8.002-29.319-23.403-29.319H218.117l-6.545-32h293.145c11.206 0 20.92-7.754 23.403-18.681z">
</path>
</svg></button>
</div>
</div>
</div>

<div class="comments-section"></div>

<div class="form-container">
<form class="form">
<p>Leave a comment</p>
<label for="name">Name</label>
<input type="text" id="name" placeholder="Name">
<label for="e-mail">E-mail</label>
<input type="email" id="e-mail" placeholder="E-mail">
<label for="comment">Comment</label>
<textarea id="comment" cols="30" rows="6"></textarea>
</form>
</div>
</div>

<!-- Footer -->
<footer></footer>

</div>


<script src="details.js"></script>
<script src="../reusable/header/header.js"></script>
<script src="../reusable/footer/footer.js"></script>
</body>

</html>
Loading