Skip to content
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

pag cartões #5153

Open
wants to merge 1 commit into
base: master
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
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs

❗️ Replace `<your_account>` with your GitHub username and copy the links to the `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_product-cards/report/html_report/)
- [DEMO LINK](https://nataliaso23.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://nataliaso23.github.io/layout_product-cards/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

Expand Down
65 changes: 59 additions & 6 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,71 @@
<!doctype html>
<html lang="en">
<html

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The <html> tag is self-closing, which is incorrect. The <html> tag should not be self-closing. It should be written as <html lang="en" class="page"> without the trailing slash.

lang="en"
class="page"
>
<head>
<meta charset="UTF-8" />
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Product cards</title>
<title>card cards</title>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./styles/index.scss"
href="./styles/main.scss"
/>
</head>
<body>
<h1>Product cards</h1>
<body class="page__body">
<div
class="card"
data-qa="card"
>
<div class="card__banner">
<img
src="./images/imac.jpeg"
class="card__photo"
alt="Apple iMac card photo"
/>
</div>
<div class="card__title">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</div>
<div class="card__code">Product code: 195434</div>
<div class="card__rating">
<div class="stars stars--4">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
</div>
<div class="card__number-reviews">Reviews: 5</div>
</div>
<div class="card__price">
<div class="card__price-label">Price:</div>
<div class="card__price-number">$2,199</div>
</div>
<div class="card__buy-button">
<a
href="#"
class="card__button-element"
data-qa="hover"
>
Buy
</a>
</div>
</div>
</body>
</html>
86 changes: 86 additions & 0 deletions src/styles/blocks/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
.card {
padding: 32px 16px 16px;
width: 200px;

box-sizing: border-box;
border: 1px solid #f3f3f3;
border-radius: 5px;

&__banner {
margin-bottom: 40px;
}

&__photo {
height: 134px;
width: 160px;
display: block;
margin: 0 auto;
}

&__title {
font-weight: 500;
font-size: 12px;
line-height: 18px;
margin-bottom: 4px;
}

&__code {
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: $secondary-color;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $secondary-color is used here, but it's important to ensure that this variable is defined somewhere in your SCSS files. If it's not defined, it will cause an error during compilation.

margin-bottom: 16px;
}

&__rating {
display: flex;
justify-content: space-between;
margin-bottom: 24px;
}

&__number-reviews {
line-height: 14px;
font-size: 10px;
font-weight: 400;
}

&__price {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
line-height: $primary-lineheight;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $primary-lineheight is used here, but it's important to ensure that this variable is defined somewhere in your SCSS files. If it's not defined, it will cause an error during compilation.


&-label {
font-size: 12px;
color: $secondary-color;
}

&-number {
font-weight: bold;
font-size: 16px;
}
}

&__button-element {
display: block;
height: 40px;
border-radius: 5px;
box-sizing: border-box;

color: white;
font-weight: bold;
text-align: center;
align-content: center;
text-transform: uppercase;
text-decoration: none;
background-color: $blue-accent-color;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $blue-accent-color is used here, but it's important to ensure that this variable is defined somewhere in your SCSS files. If it's not defined, it will cause an error during compilation.

border: 1px solid $blue-accent-color;

&:hover {
color: $blue-accent-color;
background-color: white;
cursor: pointer;
}
}
}
5 changes: 5 additions & 0 deletions src/styles/blocks/page.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.page__body {
margin: 0;
font-family: Roboto, serif;
color: $main-color;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $main-color is used here, but it's important to ensure that this variable is defined somewhere in your SCSS files. If it's not defined, it will cause an error during compilation.

}
16 changes: 16 additions & 0 deletions src/styles/blocks/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.stars {
display: flex;

&__star {
height: 16px;
width: 16px;
margin-right: 4px;
background-repeat: no-repeat;
background-position: center;
background-image: url('../images/star.svg');
}

&--4 &__star:nth-child(-n + 4) {
background-image: url('../images/star-active.svg');
}
}
4 changes: 4 additions & 0 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import 'utils/variables';
@import 'blocks/stars';
@import 'blocks/page';
@import 'blocks/card';
4 changes: 4 additions & 0 deletions src/styles/utils/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$main-color: #060b35;
$secondary-color: #616070;
$primary-lineheight: 18px;
$blue-accent-color: #00acdc;
Loading