diff --git a/readme.md b/readme.md index d2eb319ba..eac533350 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Frontend practice with catalog page and hovers Replace `` with your Github username and copy the links to Pull Request description: -- [DEMO LINK](https://.github.io/layout_catalog_hovers/) +- [DEMO LINK](https://Albert-Kifiuk.github.io/layout_catalog_hovers/) > Follow [this instructions](https://github.com/mate-academy/layout_task-guideline#how-to-solve-the-layout-tasks-on-github) diff --git a/src/index.html b/src/index.html index 044119cfc..e5c10a31f 100644 --- a/src/index.html +++ b/src/index.html @@ -58,34 +58,378 @@ -
-
- Product card -
+
+
+
+ APPLE A1419 iMac image -
- Product card -
+

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

-
- Product card -
+
+ Product code: 195434 +
-
- Product card -
+
+
+
+
+
+
+
+
+
+ Reviews: 5 +
+
-
- Product card -
+
+
+ Price: +
+
+ $2,199 +
+
-
- Product card -
+ + BUY + +
+ +
+ APPLE A1419 iMac image + +

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

+ +
+ Product code: 195434 +
+ +
+
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ +
+
+ Price: +
+
+ $2,199 +
+
+ + + BUY + +
+ +
+ APPLE A1419 iMac image + +

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

+ +
+ Product code: 195434 +
+ +
+
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ +
+
+ Price: +
+
+ $2,199 +
+
+ + + BUY + +
+ +
+ APPLE A1419 iMac image + +

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

+ +
+ Product code: 195434 +
+ +
+
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ +
+
+ Price: +
+
+ $2,199 +
+
+ + + BUY + +
+ +
+ APPLE A1419 iMac image -
- Product card +

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

+ +
+ Product code: 195434 +
+ +
+
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ +
+
+ Price: +
+
+ $2,199 +
+
+ + + BUY + +
+ +
+ APPLE A1419 iMac image + +

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

+ +
+ Product code: 195434 +
+ +
+
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ +
+
+ Price: +
+
+ $2,199 +
+
+ + + BUY + +
+ +
+ APPLE A1419 iMac image + +

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

+ +
+ Product code: 195434 +
+ +
+
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ +
+
+ Price: +
+
+ $2,199 +
+
+ + + BUY + +
+ +
+ APPLE A1419 iMac image + +

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

+ +
+ Product code: 195434 +
+ +
+
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ +
+
+ Price: +
+
+ $2,199 +
+
+ + + BUY + +
+ +
diff --git a/src/styles/blocks/catalog.scss b/src/styles/blocks/catalog.scss index ffb6b2ccc..17d959d2f 100644 --- a/src/styles/blocks/catalog.scss +++ b/src/styles/blocks/catalog.scss @@ -1,25 +1,143 @@ -.catalog { +.card-container { display: flex; + margin: 0 auto; + padding: 50px $main-pading-left-right; flex-wrap: wrap; + width: 1024px; +} - max-width: 944px; - margin: 0 auto; - padding: 50px 0; +.card { + margin: 0; + width: $card-width; + border: 1px solid $border-color; + border-radius: 5px; + padding: 32px 16px 16px; + background: $text-white-color; + margin-right: $card-margin-right; + margin-bottom: 46px; + height: $card-height; + transition: transform 300ms; + + &:nth-child(4n) { + margin-right: 0; + } + + &:nth-last-child(-n + 4) { + margin-bottom: 0; + } + + &__image { + display: flex; + width: 160px; + height: 134px; + margin: 0 auto 40px; + } + + &__info { + font-weight: 500; + font-size: 12px; + line-height: 18px; + color: $text-main-color; + transition: 300ms; + margin-bottom: 4px; + } + + &__code { + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: $text-secondary-color; + margin-bottom: 16px; + } - &__card { + &__review { + display: flex; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 24px; + } + + &__reviews { + justify-content: flex-end; + width: 53px; + height: 16px; + font-weight: 400; + font-size: 10px; + line-height: 14px; + display: flex; + align-items: flex-end; + text-align: right; + color: $text-main-color; + } + + &__price-conteiner { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; + } + + &__price-name { + display: flex; + justify-content: flex-start; + width: 31px; + height: 18px; + font-weight: 400; + font-size: 12px; + line-height: 18px; + align-items: flex-end; + color: $text-secondary-color; + flex: none; + order: 0; + flex-grow: 0; + } + + &__price-price { + display: flex; + align-items: flex-end; + text-align: left; + width: 50px; + height: 18px; + color: $text-main-color; + font-weight: 700; + font-size: 16px; + line-height: 18px; + flex: none; + order: 1; + flex-grow: 0; + } + + &__button { display: flex; justify-content: center; + bottom: 17px; align-items: center; - box-sizing: border-box; + width: 166px; + height: 40px; + border: 1px solid $border-color; + border-radius: 5px; + font-size: 14px; + line-height: 16px; + color: $text-white-color; + font-weight: 700; + text-decoration: none; + text-transform: uppercase; + background-color: $active-color; + transition: 300ms; + } - width: 200px; - height: 300px; - border: 1px solid #ccc; + &__button:hover { + background: $text-white-color; + color: $active-color; + border: 1px solid $active-color; border-radius: 5px; - margin-bottom: 48px; + } + + &:hover { + transform: scale(1.2); + } - &:not(:nth-child(4n)) { - margin-right: 48px; - } + &:hover > :nth-child(2) { + color: $card-info-hover-text-color; } } diff --git a/src/styles/blocks/header.scss b/src/styles/blocks/header.scss index 638a10fef..8269a3e89 100644 --- a/src/styles/blocks/header.scss +++ b/src/styles/blocks/header.scss @@ -2,7 +2,6 @@ display: flex; align-items: center; justify-content: space-between; - box-sizing: border-box; height: 60px; padding: 0 50px; @@ -17,6 +16,7 @@ .nav { &__list { display: flex; + white-space: nowrap; margin: 0; padding: 0; } @@ -32,11 +32,32 @@ } } + &__item--is-active::after { + content: ""; + position: absolute; + bottom: 0; + left: 0; + top: 56px; + right: 0; + height: 4px; + border-radius: 8px; + background: $active-color; + } + + &__item--is-active { + color: $active-color; + } + &__link { color: inherit; text-decoration: none; text-transform: uppercase; font-size: 12px; font-weight: 500; + transition: 300ms; + } + + &__link:hover { + color: $active-color; } } diff --git a/src/styles/blocks/page.scss b/src/styles/blocks/page.scss index 0f72996db..7aba842bb 100644 --- a/src/styles/blocks/page.scss +++ b/src/styles/blocks/page.scss @@ -1,7 +1,17 @@ -.page { - font-family: Roboto, sans-serif; +* { + box-sizing: border-box; +} + +html { + font-family: "Roboto", sans-serif; + font-size: 10px; + line-height: 14px; +} + +body { + margin: 0; +} - &__body { - margin: 0; - } +.main { + display: block; } diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 000000000..bae3e40e2 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,18 @@ +.stars { + display: flex; + + &__star { + width: 16px; + height: 16px; + margin-right: 4px; + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + } + + @for $starCount from 1 through 5 { + &--#{$starCount} .stars__star:nth-child(-n + #{$starCount}) { + background-image: url(../images/star-active.svg); + } + } +} diff --git a/src/styles/blocks/variables.scss b/src/styles/blocks/variables.scss new file mode 100644 index 000000000..a9c7e501f --- /dev/null +++ b/src/styles/blocks/variables.scss @@ -0,0 +1,10 @@ +$active-color: #00acdc; +$text-main-color: #060b35; +$text-secondary-color: #616070; +$text-white-color: #fff; +$border-color: #f3f3f3; +$card-info-hover-text-color: #34568b; +$card-width: 200px; +$main-pading-left-right: 40px; +$card-margin-right: 48px; +$card-height: 408px; diff --git a/src/styles/main.scss b/src/styles/main.scss index 465a8cb4a..9a9508d2b 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -1,3 +1,5 @@ +@import "blocks/variables.scss"; @import "blocks/page"; @import "blocks/header"; @import "blocks/catalog"; +@import "blocks/stars.scss";