diff --git a/readme.md b/readme.md index 705275c4af..5c6e848e99 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://vinasxz.github.io/layout_catalog/) +- [TEST REPORT LINK](https://vinasxz.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/index.html b/src/index.html index 9cff78eeb7..83a0da4208 100644 --- a/src/index.html +++ b/src/index.html @@ -1,27 +1,451 @@ + Catalog - Catalog - -

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/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..4e35786a02 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,125 @@ +.catalog { + box-sizing: border-box; + display: grid; + grid-gap: 46px 48px; + justify-content: center; + grid-template-columns: repeat(1, 200px); + margin: 0 auto; + padding: 50px 0; + + @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); + } + + &__card { + box-sizing: border-box; + display: flex; + flex-direction: column; + width: 200px; + border-radius: 5px; + border: 1px solid $primary-bg-color; + background-color: $background-card-color; + transition: all 300ms ease; + + &-image { + width: 160px; + height: 134px; + margin-top: 32px; + margin-right: 19px; + margin-left: 19px; + } + + &-info { + margin: 40px 16px 0; + + &-text { + font-size: 12px; + font-weight: 500; + line-height: 18px; + margin: 0; + color: $main-text-color; + font-style: normal; + } + } + + &:hover { + transform: scale(1.2); + .catalog__card-info-text { + color: $hover-color; + } + } + + &-text { + font-size: 10px; + line-height: 14px; + margin: 0; + margin-top: 4px; + color: $secondary-text-color; + font-weight: 400; + } + + &-price { + justify-content: space-between; + display: flex; + align-items: flex-end; + margin-top: 24px; + font-weight: 400; + + &-word { + color: $secondary-text-color; + + &-text { + font-size: 12px; + line-height: 18px; + margin: 0; + } + } + + &-text { + font-size: 16px; + font-weight: 700; + line-height: 18px; + margin: 0; + color: $main-text-color; + } + } + + &-button { + display: flex; + align-items: center; + justify-content: center; + margin-top: 16px; + margin-bottom: 16px; + height: 40px; + width: 100%; + padding: 0; + text-transform: uppercase; + background-color: $button-main-color; + color: $background-card-color; + border-radius: 5px; + border: none; + transition: all 300ms ease; + + &-text { + font-weight: 700; + line-height: 16px; + font-size: 14px; + } + + &:hover { + border-radius: 5px; + border: 1px solid $button-main-color; + background-color: $background-card-color; + color: $button-main-color; + } + } + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..05787c30ea --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,87 @@ +.body { + width: 100%; + margin: 0; + padding: 0; + font-family: Roboto, sans-serif; + font-weight: 500; + + &__header { + display: flex; + justify-content: space-between; + align-items: center; + height: 60px; + padding: 0 50px; + background: $background-card-color; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); + + &-logo { + display: block; + height: 40px; + width: 40px; + + &-image { + height: 100%; + width: 100%; + } + } + } + + .nav { + height: inherit; + margin: 0; + + &__list { + margin: 0; + padding: 0; + list-style: none; + height: inherit; + display: flex; + align-items: center; + flex-direction: row; + } + + &__text { + margin-left: 20px; + + &:first-child { + margin-left: 0; + } + } + + &__link { + display: flex; + align-items: center; + justify-content: center; + height: 60px; + font-size: 12px; + font-weight: 500; + text-decoration: none; + list-style: none; + text-transform: uppercase; + color: $main-text-color; + transition: color 0.3s; + cursor: pointer; + + &:hover { + color: $button-main-color; + } + + &.is-active { + color: $button-main-color; + position: relative; + &::after { + display: block; + position: absolute; + bottom: 0; + left: 0; + right: 0; + content: ''; + height: 4px; + width: 100%; + background-color: $button-main-color; + border-radius: 8px; + } + } + } + } +} 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..d480dc08fa --- /dev/null +++ b/src/styles/main.scss @@ -0,0 +1,4 @@ +@import './vars'; +@import './header'; +@import './card'; +@import './stars'; diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..f1e6942abd --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,36 @@ +.catalog { + &__card-stars { + display: flex; + align-items: center; + justify-content: space-between; + max-width: 166px; + height: 16px; + margin-top: 16px; + + &-list { + display: flex; + + @for $index from 1 through 5 { + &--#{$index} { + .catalog__card-stars-list-star:nth-child(-n + #{$index}) { + background: url(../images/star-active.svg) no-repeat center; + } + } + } + &-star { + width: 16px; + height: 16px; + margin-right: 4px; + background: url(../images/star.svg) no-repeat center; + } + } + &-reviews { + &-text { + font-size: 10px; + font-weight: 400; + line-height: 14px; + margin: 0; + } + } + } +} diff --git a/src/styles/vars.scss b/src/styles/vars.scss new file mode 100644 index 0000000000..65327de529 --- /dev/null +++ b/src/styles/vars.scss @@ -0,0 +1,6 @@ +$primary-bg-color: #f3f3f3; +$main-text-color: #060b35; +$secondary-text-color: #616070; +$button-main-color: #00acdc; +$background-card-color: #fff; +$hover-color: #34568b;