diff --git a/readme.md b/readme.md index 874ca70d97..b5c8ed2bcd 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` @@ -33,8 +33,8 @@ 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/) +- [DEMO LINK](https://.github.io/layout_catalog/) +- [TEST REPORT LINK](https://.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..13d2bf9e2d 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,8 @@ - + - -

Catalog

+ +
+ + logo + + + +
+ +
+
+ imac +

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

+ Product code: 195434 + +
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ imac +

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

+ Product code: 195434 + +
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ imac +

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

+ Product code: 195434 + +
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ imac +

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

+ Product code: 195434 + +
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ imac +

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

+ Product code: 195434 + +
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ imac +

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

+ Product code: 195434 + +
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ imac +

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

+ Product code: 195434 + +
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ imac +

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

+ Product code: 195434 + +
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+
diff --git a/src/styles/buy.scss b/src/styles/buy.scss new file mode 100644 index 0000000000..7f7d2dbdb3 --- /dev/null +++ b/src/styles/buy.scss @@ -0,0 +1,19 @@ +.buy { + text-align: center; + text-decoration: none; + text-transform: uppercase; + padding: 12px 70px; + color: rgba(255, 255, 255, 1); + background-color: $blue-accent; + font-weight: 700; + font-size: 14px; + line-height: 16px; + border-radius: $rounding; + transition: $transition-duration; + + &:hover { + background-color: $white; + color: $blue-accent; + border: $blue-border; + } +} diff --git a/src/styles/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..0e08a1e9f7 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,75 @@ +.grid-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 200px)); + justify-content: center; + gap: 46px 48px; + padding: 50px 40px; +} + +.card { + display: flex; + justify-content: center; + flex-direction: column; + width: 200px; + border: $gray-border; + padding: 32px 16px 16px; + border-radius: $rounding; + transition: $transition-duration; + + &:hover { + transform: scale(1.2); + } + + &__image { + margin-bottom: 40px; + padding-inline: 3px; + min-height: 134px; + } + + &__title { + font-weight: 500; + font-size: 12px; + line-height: 18px; + margin-bottom: 4px; + } + + &:hover .card__title { + color: $title-hover; + } + + &__code { + font-size: 10px; + color: $secondary; + margin-bottom: 16px; + } + + &__rating { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + } + + &__review { + font-size: 10px; + color: $main-accent; + } + + &__price { + display: flex; + justify-content: space-between; + margin-bottom: 16px; + } + + &__price-text { + line-height: 18px; + color: $secondary; + } + + &__price-number { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: $main-accent; + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..d63a9c21f3 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,11 @@ +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding-inline: 50px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05); + + &__logo-link { + display: flex; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..5ba987c907 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,7 @@ -body { - margin: 0; -} +@import './utils/variables.scss'; +@import './page'; +@import './nav'; +@import './header'; +@import './stars'; +@import './buy'; +@import './card'; diff --git a/src/styles/nav.scss b/src/styles/nav.scss new file mode 100644 index 0000000000..b8fb8ce2fc --- /dev/null +++ b/src/styles/nav.scss @@ -0,0 +1,42 @@ +.nav { + text-transform: uppercase; + font-weight: 500; + + &__list { + display: flex; + list-style: none; + + & :not(:last-child) { + margin-right: 20px; + } + } + + &__link { + position: relative; + display: block; + text-decoration: none; + color: $main-accent; + padding-block: 23px; + transition: $transition-duration; + + &--hover:hover { + color: $blue-accent; + } + + &--active { + color: $blue-accent; + + &::before { + content: ''; + display: block; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + height: 4px; + border-radius: 8px; + background-color: $blue-accent; + } + } + } +} diff --git a/src/styles/page.scss b/src/styles/page.scss new file mode 100644 index 0000000000..4b58e9b36a --- /dev/null +++ b/src/styles/page.scss @@ -0,0 +1,17 @@ +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +.page { + font-family: Roboto, sans-serif; + font-weight: 400; + font-size: 12px; + line-height: 14px; + color: $main-accent; +} + +.page__body { + margin: 0; +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..207403fd28 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,19 @@ +.stars { + display: flex; + + & :not(:last-child) { + margin-right: 4px; + } + + &--active :not(:last-child) { + background-image: url(/src/images/star-active.svg); + } + + &__item { + width: 16px; + height: 16px; + background-image: url(/src/images/star.svg); + background-repeat: no-repeat; + background-position: center; + } +} diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..85082ad540 --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,10 @@ +$main-accent: rgba(6, 11, 53, 1); +$secondary: rgba(97, 96, 112, 1); +$white: rgba(255, 255, 255, 1); +$blue-accent: rgba(0, 172, 220, 1); +$gray-elements: rgba(243, 243, 243, 1); +$transition-duration: 300ms; +$gray-border: 1px solid $gray-elements; +$title-hover: #34568b; +$blue-border: 1px solid $blue-accent; +$rounding: 5px;