diff --git a/readme.md b/readme.md index 874ca70d97..a54d422433 100644 --- a/readme.md +++ b/readme.md @@ -2,14 +2,14 @@ Create an HTML page with a catalog. Develop semantic page structure as shown on [the mockup](https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=32249%3A354). -- use `Header`, `Stars` and `Card` blocks from previous tasks but rewrite them using BEM and SCSS +- use `Header`, `Stars` and `Card`blocks from previous tasks but rewrite them using BEM and SCSS - remove old `data-qa` attributes - add `data-qa="nav-hover"` (not just `hover`) to the 4th nav link for testing (`Laptops & computers`) - add `data-qa="card"` to the first card - 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..b9fd02ad81 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;