diff --git a/readme.md b/readme.md index 3a460b48..20633ad8 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Frontend practice with catalog page using grid Replace `` with your Github username and copy the links to Pull Request description: -- [DEMO LINK](https://.github.io/layout_catalog_grid/) +- [DEMO LINK](https://Albert-Kifiuk.github.io/layout_catalog_grid/) > 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 af41a22d..5949e81b 100644 --- a/src/index.html +++ b/src/index.html @@ -17,61 +17,409 @@
-
-
- Product card -
-
- Product card -
-
- Product card -
-
- Product card -
-
- Product card -
-
- Product card -
-
- Product card +
+
+ 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 + +

+ 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 + +
+ +
+ 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/_catalog.scss b/src/styles/_catalog.scss index a63c46d7..759e9df8 100644 --- a/src/styles/_catalog.scss +++ b/src/styles/_catalog.scss @@ -1,22 +1,168 @@ .catalog { display: flex; flex-wrap: wrap; - max-width: 944px; margin: 0 auto; +} + +.card-container { + display: grid; + align-items: center; + column-gap: $card-gap; + row-gap: $card-gap; + justify-content: center; + grid: auto-flow / repeat(auto-fit, minmax(200px, 3fr)); + + @media (min-width: 488px) { + & { + grid-template-columns: repeat(2, 1fr); + } + } + + @media (min-width: 768px) { + & { + grid-template-columns: repeat(3, 1fr); + } + } + + @media (min-width: 1024px) { + & { + grid-template-columns: repeat(4, 1fr); + } + } + +} + +.card { + margin: 0; + width: $card-width; + border: 1px solid $border-color; + border-radius: 5px; + padding: 32px 16px 16px; + background: $text-white-color; + 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; + } + + &__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; + } - &__card { + &__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; - width: 200px; - height: 300px; - border: 1px solid #ccc; + width: 166px; + height: 40px; + border: 1px solid $border-color; border-radius: 5px; - margin-bottom: 48px; + 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; + } + + &__button:hover { + background: $text-white-color; + color: $active-color; + border: 1px solid $active-color; + border-radius: 5px; + } + + &:hover { + transform: scale(1.2); } - &__card:not(:nth-child(4n)) { - margin-right: 48px; + &:hover > :nth-child(2) { + color: $card-info-hover-text-color; } } diff --git a/src/styles/_stars.scss b/src/styles/_stars.scss new file mode 100644 index 00000000..bae3e40e --- /dev/null +++ b/src/styles/_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/_variables.scss b/src/styles/_variables.scss new file mode 100644 index 00000000..4fa622e7 --- /dev/null +++ b/src/styles/_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-gap: 48px; +$card-height: 408px; diff --git a/src/styles/main.scss b/src/styles/main.scss index cf7e6948..a85f8949 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -10,5 +10,7 @@ body { box-sizing: border-box; } +@import "_variables.scss"; @import "_header.scss"; @import "_catalog.scss"; +@import "_stars.scss";