From 0df7591668d6481035ba81c95360fd722ab3051f Mon Sep 17 00:00:00 2001 From: olga Date: Mon, 9 Dec 2024 21:59:44 +0400 Subject: [PATCH 1/3] create a files catalog --- readme.md | 8 +- src/index.html | 354 ++++++++++++++++++++++++++++++++++++- src/index.scss | 14 ++ src/styles/card.scss | 95 ++++++++++ src/styles/header.scss | 12 ++ src/styles/index.scss | 3 - src/styles/main.scss | 21 +++ src/styles/navigation.scss | 55 ++++++ src/styles/stars.scss | 16 ++ src/styles/variables.scss | 6 + 10 files changed, 575 insertions(+), 9 deletions(-) create mode 100644 src/index.scss create mode 100644 src/styles/card.scss create mode 100644 src/styles/header.scss delete mode 100644 src/styles/index.scss create mode 100644 src/styles/main.scss create mode 100644 src/styles/navigation.scss create mode 100644 src/styles/stars.scss create mode 100644 src/styles/variables.scss diff --git a/readme.md b/readme.md index 874ca70d97..cb0706286f 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Create an HTML page with a catalog. Develop semantic page structure as shown on - add `data-qa="card-hover"` (not just `hover`) to the link `Buy` inside the first card - nav links color is not `black` anymore (nav links should have `#060b35` color) - add the class `is-active` to the first link (`Apple`) in the navigation -- use `
` tag for cards container +- use `
` tag for cards container - use the grid for cards with different numbers of columns: - 1 for the smaller screens - 2 starting at `488px` @@ -32,9 +32,9 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs ## Checklist -❗️ Replace `` with your GitHub username and copy the links to the `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_catalog/) -- [TEST REPORT LINK](https://.github.io/layout_catalog/report/html_report/) +❗️ Replace ``with your GitHub username and copy the links to the `Pull Request` description: +- [DEMO LINK](https://olga-wukelan.github.io/layout_catalog/) +- [TEST REPORT LINK](https://olga-wukelan.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/index.html b/src/index.html index 9cff78eeb7..7d9fc3c4d3 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,6 @@ + + -

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/index.scss b/src/index.scss new file mode 100644 index 0000000000..0df83e8ac6 --- /dev/null +++ b/src/index.scss @@ -0,0 +1,14 @@ +body { + margin: 0; + font-family: Roboto, sans-serif; + font-weight: 400; + color: #060b35; +} + +@import './styles/variables'; +@import './styles/header'; +@import './styles/navigation'; +@import './styles/card'; +@import './styles/stars'; +@import './styles/main'; + diff --git a/src/styles/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..353bb52893 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,95 @@ +.card { + box-sizing: border-box; + border: 1px solid #f3f3f3; + border-radius: 5px; + width: 200px; + padding: 32px 16px 16px; + transition: transform 300ms; + + &:hover { + transform: scale(1.2); + } + + &__image { + display: block; + width: 160px; + height: 134px; + margin: auto; + } + + &__title { + font-size: 12px; + font-weight: 500; + line-height: 18px; + color: $primary-color; + padding-top: 40px; + margin: 0; + &:hover { + color: #34568b; + } + } + + &__code { + font-size: 10px; + line-height: 14px; + color: $secondary-color; + margin: 0; + padding: 4px 0 16px; + } + + &__reviews-block { + display: flex; + justify-content: space-between; + height: 16px; + margin-bottom: 24px; + align-items: center; + } + + &__reviews { + font-size: 10px; + line-height: 14px; + color: $primary-color; + margin: 0; + } + + &__value { + justify-content: space-between; + display: flex; + padding-bottom: 16px; + } + + &__price { + font-size: 12px; + line-height: 18px; + color: $secondary-color; + margin: 0; + } + + &__price-number { + font-weight: $font-weigth-bold; + font-size: 16px; + line-height: 18px; + color: $primary-color; + align-items: end; + margin: 0; + } + + &__button { + width: $main-width; + height: 40px; + border: 1px solid $main-color; + border-radius: 5px; + background-color: $main-color; + text-transform: uppercase; + color: $text-color; + font-size: 14px; + font-weight: $font-weigth-bold; + line-height: 16px; + padding: 0; + + &__button:hover { + background-color: $text-color; + color: $main-color; + } + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..f7a4981094 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,12 @@ +.header { + display: flex; + background-color: #fff; + justify-content: space-between; + align-items: center; + padding: 0 50px; + + &__logo { + width: 40px; + height: 40px; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss deleted file mode 100644 index 293d3b1f13..0000000000 --- a/src/styles/index.scss +++ /dev/null @@ -1,3 +0,0 @@ -body { - margin: 0; -} diff --git a/src/styles/main.scss b/src/styles/main.scss new file mode 100644 index 0000000000..42e2d581fa --- /dev/null +++ b/src/styles/main.scss @@ -0,0 +1,21 @@ +.main { + box-sizing: border-box; + height: 100vh; + display: grid; + grid-template-columns: repeat(1, 200px); + gap: 46px 48px; + justify-content: center; + padding: 50px 40px; + + @media (min-width: 488px) { + grid-template-columns: repeat(2, 200px); + } + + @media (min-width: 768px) { + grid-template-columns: repeat(3, 200px); + } + + @media (min-width: 1024px) { + grid-template-columns: repeat(4, 200px); + } +} diff --git a/src/styles/navigation.scss b/src/styles/navigation.scss new file mode 100644 index 0000000000..c2d2c93be0 --- /dev/null +++ b/src/styles/navigation.scss @@ -0,0 +1,55 @@ +.nav { + display: flex; + justify-content: center; + margin: 0; + + &__list { + display: flex; + justify-content: center; + align-items: center; + padding: 0; + margin: 0; + } + + &__item { + display: flex; + justify-content: center; + height: 60px; + + &:not(:last-child) { + margin-right: 20px; + } + } + + &__link { + text-transform: uppercase; + text-decoration: none; + color: $primary-color; + line-height: 60px; + margin: 0; + font-size: 12px; + font-weight: 500; + + &:hover { + cursor: pointer; + color: $main-color; + } + } +} + +.is-active { + position: relative; + color: $main-color; + + &::after { + display: block; + content: ''; + border-radius: 8px; + background-color: $main-color; + height: 4px; + position: absolute; + bottom: 0; + left: 0; + right: 0; + } +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..b76ea53745 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,16 @@ +.stars { + display: flex; + + &__star { + width: 16px; + height: 16px; + margin-right: 4px; + background-repeat: no-repeat; + background-position: center; + background-image: url(./images/star.svg); + } + + &__star:nth-child(-n + 4) { + background-image: url(./images/star-active.svg); + } +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..3596850d20 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,6 @@ +$main-color: #00acdc; +$main-width: 166px; +$font-weigth-bold: 700; +$primary-color: #060b35; +$secondary-color: #616070; +$text-color: #fff; From 71cf361728ebd5d3877ddc61e0e1abf3135ac6e8 Mon Sep 17 00:00:00 2001 From: olga Date: Tue, 10 Dec 2024 10:17:09 +0400 Subject: [PATCH 2/3] fix comments to catalog --- src/index.html | 4 ++-- src/index.scss | 14 -------------- src/styles/{ => blocks}/card.scss | 6 +++--- src/styles/{ => blocks}/header.scss | 0 src/styles/{ => blocks}/main.scss | 0 src/styles/{ => blocks}/navigation.scss | 0 src/styles/{ => blocks}/stars.scss | 4 ++-- src/styles/index.scss | 13 +++++++++++++ src/styles/{ => utils}/variables.scss | 3 +-- 9 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 src/index.scss rename src/styles/{ => blocks}/card.scss (94%) rename src/styles/{ => blocks}/header.scss (100%) rename src/styles/{ => blocks}/main.scss (100%) rename src/styles/{ => blocks}/navigation.scss (100%) rename src/styles/{ => blocks}/stars.scss (66%) create mode 100644 src/styles/index.scss rename src/styles/{ => utils}/variables.scss (82%) diff --git a/src/index.html b/src/index.html index 7d9fc3c4d3..4748a32a5d 100644 --- a/src/index.html +++ b/src/index.html @@ -18,7 +18,7 @@ /> @@ -31,7 +31,7 @@ class="header__logo" > Moyo Logo diff --git a/src/index.scss b/src/index.scss deleted file mode 100644 index 0df83e8ac6..0000000000 --- a/src/index.scss +++ /dev/null @@ -1,14 +0,0 @@ -body { - margin: 0; - font-family: Roboto, sans-serif; - font-weight: 400; - color: #060b35; -} - -@import './styles/variables'; -@import './styles/header'; -@import './styles/navigation'; -@import './styles/card'; -@import './styles/stars'; -@import './styles/main'; - diff --git a/src/styles/card.scss b/src/styles/blocks/card.scss similarity index 94% rename from src/styles/card.scss rename to src/styles/blocks/card.scss index 353bb52893..b215e2fad3 100644 --- a/src/styles/card.scss +++ b/src/styles/blocks/card.scss @@ -66,7 +66,7 @@ } &__price-number { - font-weight: $font-weigth-bold; + font-weight: 700; font-size: 16px; line-height: 18px; color: $primary-color; @@ -83,11 +83,11 @@ text-transform: uppercase; color: $text-color; font-size: 14px; - font-weight: $font-weigth-bold; + font-weight: 700; line-height: 16px; padding: 0; - &__button:hover { + &:hover { background-color: $text-color; color: $main-color; } diff --git a/src/styles/header.scss b/src/styles/blocks/header.scss similarity index 100% rename from src/styles/header.scss rename to src/styles/blocks/header.scss diff --git a/src/styles/main.scss b/src/styles/blocks/main.scss similarity index 100% rename from src/styles/main.scss rename to src/styles/blocks/main.scss diff --git a/src/styles/navigation.scss b/src/styles/blocks/navigation.scss similarity index 100% rename from src/styles/navigation.scss rename to src/styles/blocks/navigation.scss diff --git a/src/styles/stars.scss b/src/styles/blocks/stars.scss similarity index 66% rename from src/styles/stars.scss rename to src/styles/blocks/stars.scss index b76ea53745..c1b1edaf7b 100644 --- a/src/styles/stars.scss +++ b/src/styles/blocks/stars.scss @@ -7,10 +7,10 @@ margin-right: 4px; background-repeat: no-repeat; background-position: center; - background-image: url(./images/star.svg); + background-image: url(./../images/star.svg); } &__star:nth-child(-n + 4) { - background-image: url(./images/star-active.svg); + background-image: url(./../images/star-active.svg); } } diff --git a/src/styles/index.scss b/src/styles/index.scss new file mode 100644 index 0000000000..303102c878 --- /dev/null +++ b/src/styles/index.scss @@ -0,0 +1,13 @@ +body { + margin: 0; + font-family: Roboto, sans-serif; + font-weight: 400; + color: #060b35; +} + +@import './utils/variables'; +@import './blocks/header'; +@import './blocks/navigation'; +@import './blocks/card'; +@import './blocks/stars'; +@import './blocks/main'; diff --git a/src/styles/variables.scss b/src/styles/utils/variables.scss similarity index 82% rename from src/styles/variables.scss rename to src/styles/utils/variables.scss index 3596850d20..741f165b6d 100644 --- a/src/styles/variables.scss +++ b/src/styles/utils/variables.scss @@ -1,6 +1,5 @@ -$main-color: #00acdc; $main-width: 166px; -$font-weigth-bold: 700; $primary-color: #060b35; $secondary-color: #616070; +$main-color: #00acdc; $text-color: #fff; From 40ce3a06a62b142dc6c8404548ef14a394680b05 Mon Sep 17 00:00:00 2001 From: olga Date: Tue, 10 Dec 2024 16:44:02 +0400 Subject: [PATCH 3/3] fix comment to card --- src/index.html | 130 ++++++++++++------------------------ src/styles/blocks/card.scss | 20 +++--- src/styles/index.scss | 2 - 3 files changed, 52 insertions(+), 100 deletions(-) diff --git a/src/index.html b/src/index.html index 4748a32a5d..f6e233526f 100644 --- a/src/index.html +++ b/src/index.html @@ -107,24 +107,22 @@ +
-
imac -

+

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

+

Product code: 195434

- - -
+
@@ -132,10 +130,8 @@

-

Reviews: 5

+
- -

Price:

$2,199

@@ -147,21 +143,17 @@

buy

- -
imac -

+

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

+

Product code: 195434

- - -
+
@@ -169,31 +161,25 @@

-

Reviews: 5

+
- -

Price:

$2,199

- -
imac -

+

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

+

Product code: 195434

- - -
+
@@ -201,31 +187,25 @@

-

Reviews: 5

+
- -

Price:

$2,199

- -
imac -

+

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

+

Product code: 195434

- - -
+
@@ -233,31 +213,25 @@

-

Reviews: 5

+
- -

Price:

$2,199

- -
imac -

+

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

+

Product code: 195434

- - -
+
@@ -265,31 +239,25 @@

-

Reviews: 5

+
- -

Price:

$2,199

- -
imac -

+

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

+

Product code: 195434

- - -
+
@@ -297,31 +265,25 @@

-

Reviews: 5

+
- -

Price:

$2,199

- -
imac -

+

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

+

Product code: 195434

- - -
+
@@ -329,31 +291,25 @@

-

Reviews: 5

+
- -

Price:

$2,199

- -
imac -

+

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

+

Product code: 195434

- - -
+
@@ -361,17 +317,15 @@

-

Reviews: 5

+
- -

Price:

$2,199

-
+ diff --git a/src/styles/blocks/card.scss b/src/styles/blocks/card.scss index b215e2fad3..2662169d50 100644 --- a/src/styles/blocks/card.scss +++ b/src/styles/blocks/card.scss @@ -37,7 +37,7 @@ padding: 4px 0 16px; } - &__reviews-block { + &__reviews { display: flex; justify-content: space-between; height: 16px; @@ -45,7 +45,7 @@ align-items: center; } - &__reviews { + &__feedback { font-size: 10px; line-height: 14px; color: $primary-color; @@ -63,15 +63,15 @@ line-height: 18px; color: $secondary-color; margin: 0; - } - &__price-number { - font-weight: 700; - font-size: 16px; - line-height: 18px; - color: $primary-color; - align-items: end; - margin: 0; + &-number { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: $primary-color; + align-items: end; + margin: 0; + } } &__button { diff --git a/src/styles/index.scss b/src/styles/index.scss index 303102c878..bcde584d89 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,8 +1,6 @@ body { margin: 0; font-family: Roboto, sans-serif; - font-weight: 400; - color: #060b35; } @import './utils/variables';