diff --git a/readme.md b/readme.md index 705275c4af..24db221f5b 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Create HTML page with catalog. Develop semantic page structure as shown on [the - add `data-qa="card-hover"` (not just `hover`) to the link `Buy` inside the first card - nav links color is not `black` any more (nav links should have `#060b35` color) - add class `is-active` to the first link (`Apple`) in navigation -- use `
` tag for cards container +- use `
` tag for cards container - use grid for cards with different number of columns: - 1 for the smaller screens - 2 starting at `488px` @@ -30,14 +30,14 @@ Make all the changes smooth on hover (during 300ms): ## Checklist ❗️ Replace `` with your Github username and copy the links to `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_catalog/) -- [TEST REPORT LINK](https://.github.io/layout_catalog/report/html_report/) +- [DEMO LINK](https://nataSokolnikova.github.io/layout_catalog/) +- [TEST REPORT LINK](https://nataSokolnikova.github.io/layout_catalog/report/html_report/) ❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it. -- [ ] All component follow BEM and use SCSS -- [ ] repaeted sizes and special colors are put to variables -- [ ] Grid is used for the columns -- [ ] cards are shown in 1, 2, 3 or 4 columns based on screen resolution -- [ ] All changes on `:hover` are smooth -- [ ] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules) +- [x] All component follow BEM and use SCSS +- [x] repaeted sizes and special colors are put to variables +- [x] Grid is used for the columns +- [x] cards are shown in 1, 2, 3 or 4 columns based on screen resolution +- [x] All changes on `:hover` are smooth +- [x] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules) diff --git a/src/images/link.png b/src/images/link.png new file mode 100644 index 0000000000..bca74ec020 Binary files /dev/null and b/src/images/link.png differ diff --git a/src/images/link.svg b/src/images/link.svg new file mode 100644 index 0000000000..5bbad70210 --- /dev/null +++ b/src/images/link.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/index.html b/src/index.html index 9cff78eeb7..934237ec81 100644 --- a/src/index.html +++ b/src/index.html @@ -1,3 +1,4 @@ + @@ -20,8 +21,364 @@ href="styles/index.scss" /> + -

Catalog

+ +
+ + + +
+ + +
+
+ imac + +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ +

Reviews:5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac + +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ +

Reviews:5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac + +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ +

Reviews:5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac + +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ +

Reviews:5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac + +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ +

Reviews:5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac + +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ +

Reviews:5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac + +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ +

Reviews:5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac + +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ +

Reviews:5

+
+ +
+

Price:

+

$2,199

+
+ + +
+
diff --git a/src/styles/blocks/card.css b/src/styles/blocks/card.css new file mode 100644 index 0000000000..7271babf2e --- /dev/null +++ b/src/styles/blocks/card.css @@ -0,0 +1,122 @@ +.card { + box-sizing: border-box; + width: 200px; + max-height: 408px; + padding: 32px 16px 16px; + border: 1px solid #f3f3f3; + border-radius: 5px; + + transition: transform 300ms; +} + +img { + box-sizing: border-box; + background-repeat: no-repeat; + width: 160px; + height: 134px; + margin-bottom: 40px; +} + +.card__title { + width: 100%; + height: 36px; + margin: 0 0 4px; + font-weight: 500; + font-size: 12px; + line-height: 18px; + color: var(--text-color); +} + +.card:hover { + cursor: pointer; + transform: scale(1.2); + .card__title { + color: #34568b; + } +} + +[data-qa='nav-hover']:hover { + color: #00acdc; +} + +[data-qa='card-hover']:hover { + background-color: #fff; + color: #00acdc; +} + +.card__category { + width: 98px; + height: 14px; + box-sizing: border-box; + margin: 0 0 16px; + font-weight: normal; + font-size: 10px; + line-height: 14px; + color: var(--category-color); +} + +.card__grade { + display: flex; + justify-content: space-between; + align-items: center; + height: 16px; + width: 100%; + margin: 0; +} + +.card__review { + background-position: center; + background-repeat: no-repeat; + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: var(--text-color); + margin: 0; + padding: 0; +} + +.card__p { + display: flex; + justify-content: space-between; + height: 18px; + margin-top: 24px; + margin-bottom: 16px; + width: 100%; +} + +.card__price { + text-align: center; + font-size: 12px; + line-height: 18px; + margin: 0; + color: var(--category-color); +} + +.card__geld { + text-align: center; + font-weight: bold; + font-size: 16px; + line-height: 18px; + margin: 0; +} + +.button { + width: 100%; + height: 40px; + border-radius: 5px; + font-weight: bold; + font-size: 14px; + line-height: 16px; + text-transform: uppercase; + text-align: center; + color: #fff; + border: 1px solid var(--card-color); + background-color: var(--card-color); + padding: 0; +} + +.button:hover { + border: 1px solid var(--card-color); + color: var(--card-color); + background-color: white; +} diff --git a/src/styles/blocks/header.css b/src/styles/blocks/header.css new file mode 100644 index 0000000000..80fe6d4171 --- /dev/null +++ b/src/styles/blocks/header.css @@ -0,0 +1,96 @@ +body { + margin: 0; + padding: 0; + font-family: Roboto, sans-serif; + font-weight: 500; + font-style: normal; + + --card-color: #00acdc; + --text-color: #060b35; + --category-color: #616070; +} + +a, +a:link { + text-decoration: none; +} + +.header { + box-sizing: border-box; + height: 60px; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + background: #fff; +} + +.header__left { + max-width: 100%; + max-height: 40px; + padding: 10px 0; +} + +.logo { + width: 40px; + height: 40px; + margin: 0; + padding: 0; +} + +.nav__list { + box-sizing: border-box; + display: flex; + flex-direction: row; + align-items: center; + text-transform: uppercase; + + max-width: 1200px; + font-size: 12px; + line-height: 60px; + + gap: 20px; + margin: 0; + padding: 0; + list-style: none; +} + +.nav__link { + height: 60px; + display: block; + color: var(--text-color); +} + +.nav__link:hover { + cursor: pointer; + color: var(--text-color); +} + +.nav__item { + color: var(--card-color); +} + +.nav__is-active { + box-sizing: border-box; + color: var(--card-color); + position: relative; +} + +.nav__is-active:hover { + cursor: pointer; + color: var(--card-color); +} + +.nav__is-active::after { + position: absolute; + display: block; + background-image: url(../../images/link.png); + width: 100%; + height: 4px; + content: ''; +} + +[data-qa='nav-hover']:hover { + color: var(--card-color); + text-decoration: none; +} diff --git a/src/styles/blocks/main.css b/src/styles/blocks/main.css new file mode 100644 index 0000000000..3dfed187ca --- /dev/null +++ b/src/styles/blocks/main.css @@ -0,0 +1,39 @@ +.main { + box-sizing: border-box; + width: 944px; + height: 100vh; + justify-content: space-evenly; + margin: 0 auto; + padding: 50px 40px; + display: grid; + + --column-count: 4; + + grid-template-columns: repeat(var(--column-count), minmax(200px, 1fr)); + grid-template-rows: repeat(2, 408px); + gap: 46px 48px; +} + +@media (min-width: 300px) { + .main { + --column-count: 1; + } +} + +@media (min-width: 488px) { + .main { + --column-count: 2; + } +} + +@media (min-width: 768px) { + .main { + --column-count: 3; + } +} + +@media (min-width: 1024px) { + .main { + --column-count: 4; + } +} diff --git a/src/styles/blocks/stars.css b/src/styles/blocks/stars.css new file mode 100644 index 0000000000..56d49a4069 --- /dev/null +++ b/src/styles/blocks/stars.css @@ -0,0 +1,21 @@ +.stars { + display: flex; + justify-content: center; + align-items: center; + height: 16px; + margin: 0; + padding: 0; +} + +.stars__star { + width: 16px; + height: 16px; + margin-right: 4px; + background-position: center; + background-repeat: no-repeat; + background-image: url(../../images/star.svg); +} + +.stars--4 :nth-child(-n + 4) { + background-image: url(../../images/star-active.svg); +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..c3061c54c3 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,4 @@ -body { - margin: 0; -} +@import './blocks/header.css'; +@import './blocks/main.css'; +@import './blocks/card.css'; +@import './blocks/stars.css';