diff --git a/readme.md b/readme.md index 705275c4af..8f0f009fe2 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` @@ -30,8 +30,8 @@ Make all the changes smooth on hover (during 300ms): ## 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://OleksandrHaman.github.io/layout_catalog/) +- [TEST REPORT LINK](https://OleksandrHaman.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..c9d7041ba4 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,353 @@ -

Catalog

+
+ + +
+
+
+
+ iMac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ + Reviews: 5 +
+ +
+ Price: + $2,199 +
+ + +
+
+ iMac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ + Reviews: 5 +
+ +
+ Price: + $2,199 +
+ + +
+
+ iMac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ + Reviews: 5 +
+ +
+ Price: + $2,199 +
+ + +
+
+ iMac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ + Reviews: 5 +
+ +
+ Price: + $2,199 +
+ + +
+
+ iMac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ + Reviews: 5 +
+ +
+ Price: + $2,199 +
+ + +
+
+ iMac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ + Reviews: 5 +
+ +
+ Price: + $2,199 +
+ + +
+
+ iMac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ + Reviews: 5 +
+ +
+ Price: + $2,199 +
+ + +
+
+ iMac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+ + Reviews: 5 +
+ +
+ Price: + $2,199 +
+ + +
+
+
diff --git a/src/styles/container.scss b/src/styles/container.scss new file mode 100644 index 0000000000..5507354679 --- /dev/null +++ b/src/styles/container.scss @@ -0,0 +1,26 @@ +.container { + display: grid; + grid-template-columns: repeat(1, $cardSize); + justify-items: center; + justify-content: center; + gap: 46px 48px; + padding: 50px 40px; +} + +@media (min-width: 488px) { + .container { + grid-template-columns: repeat(2, $cardSize); + } +} + +@media (min-width: 768px) { + .container { + grid-template-columns: repeat(3, $cardSize); + } +} + +@media (min-width: 1024px) { + .container { + grid-template-columns: repeat(4, $cardSize); + } +} diff --git a/src/styles/general.scss b/src/styles/general.scss new file mode 100644 index 0000000000..7e38f432d8 --- /dev/null +++ b/src/styles/general.scss @@ -0,0 +1,13 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +html { + font-family: Roboto, sans-serif; +} + +body { + margin: 0; +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..4072807f7e --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,64 @@ +.header { + width: 100%; + display: flex; + box-sizing: border-box; + align-items: center; + justify-content: space-between; + padding: 0 50px; + box-shadow: 0 2px 4px 0 #0000000d; +} + +.logo { + display: flex; +} + +.nav { + margin: 0; + padding: 0; + + &__list { + list-style: none; + display: flex; + justify-content: center; + margin: 0; + padding: 0; + gap: 20px; + } + + &__item { + display: inline-block; + } + + &__link { + display: flex; + text-decoration: none; + color: #060b35; + align-items: center; + position: relative; + font-weight: 500; + font-style: normal; + font-size: 12px; + line-height: 14px; + text-transform: uppercase; + height: 60px; + transition: all 300ms; + + &:hover { + color: $headerColor; + } + } +} + +.is-active { + color: $headerColor; +} + +.is-active::after { + content: ''; + background-color: $headerColor; + border-radius: 2px; + width: 100%; + height: 4px; + position: absolute; + bottom: 0; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..1f4dda6ccf 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,6 @@ -body { - margin: 0; -} +@import './variables'; +@import './general'; +@import './header'; +@import './container'; +@import './product-card'; +@import './stars'; diff --git a/src/styles/product-card.scss b/src/styles/product-card.scss new file mode 100644 index 0000000000..b6df96f424 --- /dev/null +++ b/src/styles/product-card.scss @@ -0,0 +1,102 @@ +.product-card { + width: $cardWidth; + box-sizing: border-box; + padding: 32px 16px 16px; + border: #f3f3f3 solid 1px; + border-radius: 5px; + font-family: $mainFont; + transition: all $transitionTime; + + &__title { + color: $mainColor; + font-weight: 500; + font-size: 12px; + line-height: 18px; + margin: 0 0 5px; + cursor: pointer; + transition: all $transitionTime; + } + + &:hover { + transform: scale(1.2); + } + + &:hover &__title { + color: #34568b; + } + + &__image { + display: block; + width: $imageWidth; + height: $imageHeight; + align-items: center; + margin: 0 auto 40px; + padding-left: auto; + padding-right: auto; + } + + &__code { + font-weight: 400; + font-size: 10px; + color: #616070; + margin: 0 0 17px; + } + + &__reviews-text { + text-align: right; + font-size: 10px; + font-weight: 400; + line-height: 14px; + color: $mainColor; + } + + &__reviews { + align-items: center; + display: flex; + justify-content: space-between; + padding-bottom: 24px; + } + + &__price { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; + } + + &__price-cost { + font-weight: 400; + color: #616070; + font-size: 12px; + line-height: 18px; + } + + &__price-value { + color: $mainColor; + line-height: 18px; + font-size: 16px; + font-weight: 700; + text-align: right; + } + + &__buy { + cursor: pointer; + font-family: $mainFont; + font-size: 14px; + border-style: none; + width: 100%; + height: 40px; + background-color: $headerColor; + border-radius: 5px; + color: $buttonColor; + text-transform: uppercase; + font-weight: 700; + transition: all $transitionTime; + + &:hover { + border: $headerColor solid 1px; + background-color: $buttonColor; + color: $headerColor; + } + } +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..ff8e1559f4 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,25 @@ +.stars { + display: flex; + + &__star { + margin-right: 4px; + width: 16px; + height: 16px; + background-image: url(../images/star.svg); + background-repeat: no-repeat; + display: inline-block; + background-position: 50%; + } + + &__star:last-child { + margin-right: 0; + } +} + +.stars--1 .stars__star:nth-child(-n + 1), +.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(/src/images/star-active.svg); +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..1bf4b918fa --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,9 @@ +$headerColor: #00acdc; +$mainColor: #060b35; +$mainFont: Roboto, sans-serif; +$imageWidth: 160px; +$imageHeight: 134px; +$cardWidth: 200px; +$cardSize: 200px; +$transitionTime: 300ms; +$buttonColor: #fff;