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

add a HTML markup #4822

Open
wants to merge 4 commits 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
29 changes: 29 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- name: Upload HTML report(backstop data)
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: report
path: backstop_data
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@mate-academy/backstop-config": "latest",
"@mate-academy/bemlint": "latest",
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"@parcel/transformer-sass": "^2.12.0",
"backstopjs": "6.3.23",
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Create a pages with product card using `flexbox`, `BEM` and `SCSS` based on [thi

❗️ Replace `<your_account>` with your Github username and copy the links to `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://yuurex.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://yuurex.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
51 changes: 49 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,57 @@
<title>Product cards</title>
<link
rel="stylesheet"
href="./styles/index.scss"
href="./styles/main.scss"
/>
<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&display=swap"
rel="stylesheet"
/>
</head>

<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<div class="card__image"></div>

<h1 class="card__product-name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h1>
Comment on lines +35 to +37

Choose a reason for hiding this comment

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

Suggested change
<h1 class="card__product-name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h1>
<h2 class="card__product-name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h2>

It's expected to have multiple cards on the page. However, the h1 tag should be used just once per page

<h3 class="card__product-id">Product code: 195434</h3>

<div class="card__reviews">
<div class="card__stars">
<div class="card__star"></div>
<div class="card__star"></div>
<div class="card__star"></div>
<div class="card__star"></div>
<div class="card__star"></div>
Comment on lines +41 to +46

Choose a reason for hiding this comment

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

Suggested change
<div class="card__stars">
<div class="card__star"></div>
<div class="card__star"></div>
<div class="card__star"></div>
<div class="card__star"></div>
<div class="card__star"></div>
<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>

Consider using classes from the previous task

</div>
<p class="card__reviews-label">Reviews: 5</p>
</div>

<div class="card__price">
<p class="card__price-label card__price-label--1">Price:</p>
<p class="card__price-label card__price-label--2">$2,199</p>
</div>

<a

Choose a reason for hiding this comment

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

According to the code style rules, it's better to avoid using id selectors and use class selectors instead for styling. Make sure that the 'href' attribute does not contain '#', unless you are linking to an existing id.

href="#"
class="card__button"
data-qa="hover"
>
BUY
</a>
</div>
</body>
</html>
3 changes: 0 additions & 3 deletions src/styles/index.scss

This file was deleted.

148 changes: 148 additions & 0 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
$main-accent: #060b35;
$secondary: #616070;
$blue-accent: #00acdc;

body {
margin: 0;
}

.card {
box-sizing: border-box;
align-items: center;
width: 200px;
background-color: white;
border: 1px solid #f3f3f3;
border-radius: 5px;
padding: 32px 16px 16px;
font-family: Roboto, sans-serif;

&__image {
box-sizing: border-box;
background-image: url(../images/imac.jpeg);
width: 160px;
height: 134px;
background-size: cover;
margin: 0 auto;
}

&__product-name {
font-family: Roboto, sans-serif;
font-size: 12px;
font-weight: 500;
line-height: 18px;
text-align: left;
color: #{$main-accent};
width: 100%;
margin-top: 40px;
margin-bottom: 0;
}

&__product-id {
font-family: Roboto, sans-serif;
font-size: 10px;
font-weight: 400;
line-height: 14px;
text-align: left;
color: #{$secondary};
margin-top: 4px;
}

&__reviews {
display: flex;
align-items: flex-end;
justify-content: space-between;
margin-top: 16px;
}

&__stars {
display: flex;
margin: 0;
}

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

&__star:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
}

&__reviews-label {
font-family: Roboto, sans-serif;
font-size: 10px;
font-weight: 400;
line-height: 14px;
text-align: right;
color: #{$main-accent};
margin: 0;
}

&__price {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 24px;
}

&__price-label {
margin: 0;
}

&__price-label--1 {
font-family: Roboto, sans-serif;
font-size: 12px;
font-weight: 400;
line-height: 18px;
text-align: left;
color: #{$secondary};
}

&__price-label--2 {
font-family: Roboto, sans-serif;
font-size: 16px;
font-weight: 700;
line-height: 18px;
text-align: right;
color: #{$main-accent};
}

&__button {
align-items: center;
height: 40px;
color: white;
text-decoration: none;
font-family: Roboto, sans-serif;
font-size: 14px;
font-weight: 700;
text-align: center;
background-color: #{$blue-accent};
width: 100%;
display: flex;
justify-content: center;
margin-top: 16px;
border-radius: 5px;
}

&__button:hover {
box-sizing: border-box;
align-items: center;
color: #{$blue-accent};
text-decoration: none;
font-family: Roboto, sans-serif;
font-size: 14px;
font-weight: 700;
text-align: center;
border: solid #{$blue-accent} 1px;
background-color: white;
width: 100%;
height: 40px;
display: flex;
justify-content: center;
margin-top: 16px;
}
}
Loading