diff --git a/readme.md b/readme.md index acd5174814..bbbbbd123a 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://kwz7.github.io/layout_catalog/) +- [TEST REPORT LINK](https://kwz7.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..58330ed194 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,131 @@ -

Catalog

+
+ + Moyo logo + + + +
+ +
+
+ iMac A1419 + +

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

+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+
diff --git a/src/styles/_card.scss b/src/styles/_card.scss new file mode 100644 index 0000000000..d43856caa2 --- /dev/null +++ b/src/styles/_card.scss @@ -0,0 +1,93 @@ +@use 'variables' as *; + +.card { + box-sizing: border-box; + width: $card-width; + border: 1px solid $color-border; + border-radius: 5px; + padding: 32px 16px 16px; + background: $color-white; + transition: transform $transition-duration; + + &:hover { + transform: scale(1.2); + } + + &__image { + display: block; + margin: 0 auto 40px; + width: 160px; + height: 134px; + } + + &__title { + margin: 0 0 4px; + font-size: 12px; + line-height: 18px; + font-weight: 500; + color: $color-text-accent; + transition: color $transition-duration; + + .card:hover & { + color: $color-title-hover; + } + } + + &__code { + margin-bottom: 16px; + } + + &__review-container { + display: flex; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 24px; + } + + &__review-count { + color: $color-text-accent; + } + + &__price-container { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; + } + + &__price-label { + font-size: 12px; + line-height: 18px; + } + + &__price { + font-size: 16px; + line-height: 18px; + font-weight: bold; + color: $color-text-accent; + } + + &__buy { + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + height: 40px; + border: 1px solid $color-main; + border-radius: 5px; + font-size: 14px; + line-height: 16px; + font-weight: 700; + color: $color-white; + text-decoration: none; + text-transform: uppercase; + background-color: $color-main; + transition: + color $transition-duration, background-color $transition-duration; + + &:hover { + color: $color-main; + background-color: $color-white; + } + } +} diff --git a/src/styles/_cards-container.scss b/src/styles/_cards-container.scss new file mode 100644 index 0000000000..7ad50410dc --- /dev/null +++ b/src/styles/_cards-container.scss @@ -0,0 +1,29 @@ +@use 'variables' as *; + +.cards-container { + display: grid; + grid-template-columns: $card-width; + justify-content: center; + gap: $gap-vertical $gap-horizontal; + padding: $container-padding-vertical $container-padding-horizontal; + max-width: calc(#{$card-width} * 4 + #{$gap-horizontal} * 3 + #{$container-padding-horizontal} * 2); + margin: 0 auto; +} + +@media (min-width: 488px) { + .cards-container { + grid-template-columns: repeat(2, $card-width); + } +} + +@media (min-width: 768px) { + .cards-container { + grid-template-columns: repeat(3, $card-width); + } +} + +@media (min-width: 1024px) { + .cards-container { + grid-template-columns: repeat(4, $card-width); + } +} diff --git a/src/styles/_header.scss b/src/styles/_header.scss new file mode 100644 index 0000000000..3cf8a74f05 --- /dev/null +++ b/src/styles/_header.scss @@ -0,0 +1,95 @@ +:root { + --primary-blue: #00acdc; +} + +body { + margin: 0; +} + +ul { + margin: 0; + padding: 0; + list-style: none; +} + +.header { + display: flex; + align-items: center; + + padding: 0 50px; + + height: 60px; + box-sizing: border-box; + + background-color: #fff; + justify-content: space-between; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); +} + +.header__logo-link { + display: block; + height: 40px; + width: 40px; +} + +.header__logo-img { + display: block; + height: 40px; + width: 40px; +} + +.nav__list { + display: flex; + padding: 0; + margin: 0; + align-items: center; + list-style: none; +} + +.nav__link { + display: flex; + align-items: center; + height: 60px; + + color: #060b35; + + position: relative; + font-size: 12px; + font-weight: 500; + line-height: 100%; + transition: color 0.3s; + white-space: nowrap; + text-decoration: none; + text-transform: uppercase; + font-family: Roboto, sans-serif; +} + +.nav { + display: flex; +} + +.nav__item { + margin-left: 20px; +} + +.nav__item:first-child { + margin-left: 0; +} + +.nav__link.is-active { + color: var(--primary-blue); +} + +.nav__link.is-active::after { + content: ''; + position: absolute; + bottom: 0; + width: 100%; + height: 4px; + border-radius: 2px; + background-color: var(--primary-blue); +} + +.nav__link:hover { + color: var(--primary-blue); +} diff --git a/src/styles/_stars.scss b/src/styles/_stars.scss new file mode 100644 index 0000000000..16d90cf12b --- /dev/null +++ b/src/styles/_stars.scss @@ -0,0 +1,22 @@ +.stars { + display: flex; + + &__star { + width: 16px; + height: 16px; + margin-right: 4px; + background-image: url('../images/star.svg'); + background-repeat: no-repeat; + background-position: center; + + &:last-child { + margin-right: 0; + } + } + + @for $i from 1 through 5 { + &--#{$i} &__star:nth-child(-n + #{$i}) { + 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..5933b88848 --- /dev/null +++ b/src/styles/_variables.scss @@ -0,0 +1,12 @@ +$color-main: #00acdc; +$color-text-accent: #060b35; +$color-text-secondary: #616070; +$color-border: #f3f3f3; +$color-title-hover: #34568b; +$color-white: #fff; +$transition-duration: 0.3s; +$card-width: 200px; +$gap-horizontal: 48px; +$gap-vertical: 46px; +$container-padding-vertical: 50px; +$container-padding-horizontal: 40px; diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..099148eb1c 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,4 @@ -body { - margin: 0; -} +@use './cards-container'; +@use './header'; +@use './card'; +@use './stars';