From 52267006159bb7833bcb7c851e4c31fe1674d2a3 Mon Sep 17 00:00:00 2001 From: nataSokolnikova <167069028+nataSokolnikova@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:43:12 +0300 Subject: [PATCH 1/5] add catalog --- readme.md | 6 +- src/images/link.png | Bin 0 -> 184 bytes src/images/link.svg | 3 + src/index.html | 359 ++++++++++++++++++++++++++++++++++- src/styles/blocks/card.css | 122 ++++++++++++ src/styles/blocks/header.css | 101 ++++++++++ src/styles/blocks/main.css | 39 ++++ src/styles/blocks/stars.css | 21 ++ src/styles/index.scss | 7 +- 9 files changed, 651 insertions(+), 7 deletions(-) create mode 100644 src/images/link.png create mode 100644 src/images/link.svg create mode 100644 src/styles/blocks/card.css create mode 100644 src/styles/blocks/header.css create mode 100644 src/styles/blocks/main.css create mode 100644 src/styles/blocks/stars.css diff --git a/readme.md b/readme.md index 705275c4af..9cc4969ad9 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,8 +30,8 @@ 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. diff --git a/src/images/link.png b/src/images/link.png new file mode 100644 index 0000000000000000000000000000000000000000..bca74ec0209d6ef740db061f872e322dc729acc8 GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^szA)b!3HEb^S(_0Q3W26#S9GG!XV7ZFl&wkP>``W z$lZxy-8q?;Am! + + 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..1f3808f31d --- /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: 100%; + 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..f1702e903d --- /dev/null +++ b/src/styles/blocks/header.css @@ -0,0 +1,101 @@ +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 { + color: var(--text-color); + 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 { + text-decoration: underline; + cursor: pointer; + color: var(--text-color); + text-decoration-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 { + text-decoration: underline; + cursor: pointer; + color: var(--card-color); + text-decoration-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'; From 9d5c27219245e072b7ef17b78b075225a0a25aa2 Mon Sep 17 00:00:00 2001 From: nataSokolnikova <167069028+nataSokolnikova@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:14:23 +0300 Subject: [PATCH 2/5] add new catalog --- src/styles/blocks/card.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/blocks/card.css b/src/styles/blocks/card.css index 1f3808f31d..7271babf2e 100644 --- a/src/styles/blocks/card.css +++ b/src/styles/blocks/card.css @@ -12,7 +12,7 @@ img { box-sizing: border-box; background-repeat: no-repeat; - width: 100%; + width: 160px; height: 134px; margin-bottom: 40px; } From 7531df94c920b4b621f8918c6070f435c0303080 Mon Sep 17 00:00:00 2001 From: nataSokolnikova <167069028+nataSokolnikova@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:27:24 +0300 Subject: [PATCH 3/5] add new catalog --- readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 9cc4969ad9..24db221f5b 100644 --- a/readme.md +++ b/readme.md @@ -35,9 +35,9 @@ Make all the changes smooth on hover (during 300ms): ❗️ 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) From 25f1c5caf5073be4130bf42edfbc99006f024150 Mon Sep 17 00:00:00 2001 From: nataSokolnikova <167069028+nataSokolnikova@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:25:59 +0300 Subject: [PATCH 4/5] add changes catalog --- src/styles/blocks/header.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/styles/blocks/header.css b/src/styles/blocks/header.css index f1702e903d..02b189b168 100644 --- a/src/styles/blocks/header.css +++ b/src/styles/blocks/header.css @@ -80,10 +80,8 @@ a:link { } .nav__is-active:hover { - text-decoration: underline; cursor: pointer; color: var(--card-color); - text-decoration-color: var(--card-color); } .nav__is-active::after { From 4db356195ff8629d4b4a903c3683f68a5aa0b053 Mon Sep 17 00:00:00 2001 From: nataSokolnikova <167069028+nataSokolnikova@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:55:48 +0300 Subject: [PATCH 5/5] add news changes catalog --- src/styles/blocks/header.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/styles/blocks/header.css b/src/styles/blocks/header.css index 02b189b168..80fe6d4171 100644 --- a/src/styles/blocks/header.css +++ b/src/styles/blocks/header.css @@ -12,7 +12,6 @@ body { a, a:link { - color: var(--text-color); text-decoration: none; } @@ -63,10 +62,8 @@ a:link { } .nav__link:hover { - text-decoration: underline; cursor: pointer; color: var(--text-color); - text-decoration-color: var(--text-color); } .nav__item {