diff --git a/readme.md b/readme.md index 88061bd215..167ccdfcac 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` @@ -32,8 +32,8 @@ In this task, you can directly link *.scss files to HTML. This is possible becau ## 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://VladStep186.github.io/layout_catalog/) +- [TEST REPORT LINK](https://VladStep186.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..ba51e86a29 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,354 @@ -

Catalog

+
+ + +
+ +
+
+ Imac photo +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ Imac photo +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ Imac photo +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ Imac photo +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ Imac photo +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ Imac photo +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ Imac photo +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ Imac photo +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+
diff --git a/src/styles/cards.scss b/src/styles/cards.scss new file mode 100644 index 0000000000..f580911217 --- /dev/null +++ b/src/styles/cards.scss @@ -0,0 +1,96 @@ +.card { + box-sizing: border-box; + border: 1px solid #f3f3f3; + border-radius: 5px; + display: flex; + flex-direction: column; + width: 200px; + padding-inline: 16px; + transition: 0.3s; + + &__img { + width: 160px; + height: 134px; + margin-top: 32px; + margin-inline: 3px; + } + + &__title { + font-size: 12px; + line-height: 18px; + margin-top: 40px; + color: $main-text-color; + } + + &:hover { + transform: scale(1.2); + .card__title { + color: #34568b; + } + } + + &__code { + font-size: 10px; + line-height: 14px; + color: $extra-text-color; + margin-top: 4px; + } + + &__reviews { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin-top: 16px; + font-size: 10px; + line-height: 14px; + } + + &__price { + display: flex; + flex-direction: row; + justify-content: space-between; + margin-top: 24px; + align-items: center; + + &-title { + font-size: 12px; + line-height: 18px; + color: $extra-text-color; + } + + &-value { + font-size: 16px; + font-weight: 700; + line-height: 18px; + color: $main-text-color; + } + } + + &__button { + color: #fff; + text-transform: uppercase; + cursor: pointer; + background-color: #00acdc; + border: none; + border-radius: 5px; + justify-content: center; + align-items: center; + width: 166px; + height: 40px; + margin-top: 16px; + margin-bottom: 16px; + font-size: 14px; + font-weight: 700; + line-height: 16px; + text-decoration: none; + display: flex; + padding: 0; + + &:hover { + border: 1px solid $active-color; + background-color: #fff; + color: $active-color; + } + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..387e36c3f2 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,53 @@ +.header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05); + + &__logo { + width: 40px; + height: 40px; + } + + &__nav-list { + display: flex; + list-style: none; + margin: 0; + padding: 0; + } + + &__nav-item:not(:first-child) { + margin-left: 20px; + } + + &__nav-link { + display: flex; + align-items: center; + height: 60px; + text-decoration: none; + text-transform: uppercase; + font-size: 12px; + color: $main-text-color; + position: relative; + + &:hover { + color: $active-color; + } + } +} + +.is-active { + color: $active-color; + + &::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 4px; + border-radius: 8px; + background-color: $active-color; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..51bdab69e6 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,21 @@ +@import './utils/variables'; +@import './header'; +@import './main'; +@import './cards'; +@import './stars'; + +* { + margin: 0; + box-sizing: border-box; + font-family: Roboto, Arial, sans-serif; + font-weight: 500; +} + body { margin: 0; + padding: 0; +} + +p { + font-weight: 400; } diff --git a/src/styles/main.scss b/src/styles/main.scss new file mode 100644 index 0000000000..06b4a8f8f9 --- /dev/null +++ b/src/styles/main.scss @@ -0,0 +1,27 @@ +.main { + --column-count: 1; + + display: grid; + grid-template-columns: repeat(var(--column-count), 200px); + gap: 46px 48px; + padding: 50px 40px; + justify-content: center; +} + +@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/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..31e0cfd09d --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,23 @@ +.stars { + display: flex; + + &__star { + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: 50%; + width: 16px; + height: 16px; + + &:not(:first-child) { + margin-left: 4px; + } + } +} + +.stars--1 .stars__star:first-child, +.stars--2 .stars__star:nth-child(-n + 2), +.stars--3 .stars__star:nth-child(-n + 3), +.stars--4 .stars__star:nth-child(-n + 4), +.stars--5 .stars__star:nth-child(-n + 5) { + background-image: url(../images/star-active.svg); +} diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..b0821cf516 --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,3 @@ +$main-text-color: #060b35; +$extra-text-color: #616070; +$active-color: #00acdc;