From e3cbd615dfe0e10e06aa9dc63f49b0297fbf9593 Mon Sep 17 00:00:00 2001 From: Aweiro Date: Sat, 21 Dec 2024 23:47:19 +0200 Subject: [PATCH] qwe --- readme.md | 6 +- src/index.html | 298 +++++++++++++++++++++++++++++++- src/styles/blocks/card.scss | 113 ++++++++++++ src/styles/blocks/catalog.scss | 29 ++++ src/styles/blocks/header.scss | 15 ++ src/styles/blocks/nav.scss | 53 ++++++ src/styles/blocks/page.scss | 21 +++ src/styles/blocks/stars.scss | 39 +++++ src/styles/index.scss | 10 +- src/styles/utils/variables.scss | 6 + 10 files changed, 583 insertions(+), 7 deletions(-) create mode 100644 src/styles/blocks/card.scss create mode 100644 src/styles/blocks/catalog.scss create mode 100644 src/styles/blocks/header.scss create mode 100644 src/styles/blocks/nav.scss create mode 100644 src/styles/blocks/page.scss create mode 100644 src/styles/blocks/stars.scss create mode 100644 src/styles/utils/variables.scss diff --git a/readme.md b/readme.md index 874ca70d97..331352da8e 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://Aweiro.github.io/layout_catalog/) +- [TEST REPORT LINK](https://Aweiro.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..2e55bd6bae 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,302 @@ -

Catalog

+
+ +
+ +
+
+
+

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

+

Product code: 195434

+ + + +
+

Price:

+

$2,199

+
+ + + BUY + +
+ +
+
+

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

+

Product code: 195434

+ + + +
+

Price:

+

$2,199

+
+ + BUY +
+ +
+
+

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

+

Product code: 195434

+ + + +
+

Price:

+

$2,199

+
+ + BUY +
+ +
+
+

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

+

Product code: 195434

+ + + +
+

Price:

+

$2,199

+
+ + BUY +
+ +
+
+

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

+

Product code: 195434

+ + + +
+

Price:

+

$2,199

+
+ + BUY +
+ +
+
+

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

+

Product code: 195434

+ + + +
+

Price:

+

$2,199

+
+ + BUY +
+ +
+
+

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

+

Product code: 195434

+ + + +
+

Price:

+

$2,199

+
+ + BUY +
+ +
+
+

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

+

Product code: 195434

+ + + +
+

Price:

+

$2,199

+
+ + BUY +
+
diff --git a/src/styles/blocks/card.scss b/src/styles/blocks/card.scss new file mode 100644 index 0000000000..101ce715b3 --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,113 @@ +.card { + width: $card-width; + box-sizing: border-box; + border: 1px solid #f3f3f3; + border-radius: 5px; + padding: 32px 16px 16px; + + font-family: Roboto, serif; + font-weight: 400; + + transition: all linear $main-during; + + &:hover { + transform: scale(1.2); + } + + &__image { + display: flex; + background-image: url(../images/imac.jpeg); + background-size: contain; + background-repeat: no-repeat; + height: 134px; + margin-inline: 3px; + margin-bottom: 40px; + padding: 0; + background-origin: border-box; + } + + &__text { + font-size: 10px; + line-height: 14px; + margin: 0; + padding: 0; + } + + &__title { + font-size: 12px; + font-weight: 500; + line-height: 18px; + + margin-bottom: 4px; + color: $main_accent-color; + + transition: all linear $main-during; + } + + &__text--product-code { + color: $secondary-color; + margin-bottom: 16px; + } + + &__text--reviews { + color: $main_accent-color; + align-self: center; + } + + &__row { + display: flex; + justify-content: space-between; + align-items: center; + } + + &__row--feedback { + margin-bottom: 24px; + } + + &__row--price { + margin-bottom: 16px; + } + + &__text--price { + font-size: 12px; + line-height: 18px; + color: $secondary-color; + } + + &__text--costs { + font-size: 16px; + font-weight: 700; + line-height: 18px; + color: $main_accent-color; + } + + &__link { + background-color: $blue_accent-color; + border: 1px solid $blue_accent-color; + + height: 40px; + box-sizing: border-box; + + display: flex; + justify-content: center; + align-items: center; + + border-radius: 5px; + + color: white; + text-decoration: none; + font-size: 14px; + font-weight: 700; + line-height: 16px; + + transition: all linear $main-during; + &:hover { + background-color: #fff; + color: $blue_accent-color; + } + } + + &:hover &__title { + color: #34568b; + } +} diff --git a/src/styles/blocks/catalog.scss b/src/styles/blocks/catalog.scss new file mode 100644 index 0000000000..e342706d91 --- /dev/null +++ b/src/styles/blocks/catalog.scss @@ -0,0 +1,29 @@ +.catalog { + --column-count: 1; + + box-sizing: border-box; + padding: 50px 40px; + display: grid; + justify-content: center; + grid-template-columns: repeat(var(--column-count), $card-width); + + gap: 46px 48px; +} + +@media (min-width: 488px) { + .catalog { + --column-count: 2; + } +} + +@media (min-width: 768px) { + .catalog { + --column-count: 3; + } +} + +@media (min-width: 1024px) { + .catalog { + --column-count: 4; + } +} diff --git a/src/styles/blocks/header.scss b/src/styles/blocks/header.scss new file mode 100644 index 0000000000..e9ded3a779 --- /dev/null +++ b/src/styles/blocks/header.scss @@ -0,0 +1,15 @@ +.header { + margin: 0; + display: flex; + justify-content: center; + font-family: Roboto, sans-serif; +} + +.header__row { + display: flex; + justify-content: space-between; + padding: 0 50px; + width: 100%; + margin: 0; + box-sizing: border-box; +} diff --git a/src/styles/blocks/nav.scss b/src/styles/blocks/nav.scss new file mode 100644 index 0000000000..59e40b1e52 --- /dev/null +++ b/src/styles/blocks/nav.scss @@ -0,0 +1,53 @@ +.nav { + margin: 0; + padding: 0; +} + +.nav__list { + padding: 0; + margin: 0; + display: flex; +} + +.nav__item { + margin-left: 20px; + text-transform: uppercase; + list-style: none; +} + +.nav__item:nth-child(1) { + margin-left: 0; +} + +.nav__link { + align-items: center; + line-height: 60px; + display: block; + + font-weight: 500; + text-decoration: none; + color: #060b35; + font-size: 12px; + position: relative; + + transition: all linear $main-during; + + &:hover { + color: $main-color; + } +} + +.is-active { + color: $main-color; +} + +.is-active::after { + content: ''; + height: 4px; + border-radius: 8px; + display: block; + bottom: 0; + position: absolute; + width: 100%; + background-color: $main-color; +} diff --git a/src/styles/blocks/page.scss b/src/styles/blocks/page.scss new file mode 100644 index 0000000000..c37cae58cb --- /dev/null +++ b/src/styles/blocks/page.scss @@ -0,0 +1,21 @@ +body { + margin: 0; +} + +html { + font-family: Roboto, serif; + font-weight: 400; +} + +.logo { + align-items: center; + display: flex; +} + +.logo-img { + width: 40px; + height: 40px; + background-image: url(../images/logo.png); + background-repeat: no-repeat; + background-position: center; +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..6d19926354 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,39 @@ +.stars { + display: flex; + gap: 4px; +} + +.stars__star { + background-image: url(../images/star.svg); + width: 16px; + height: 16px; + background-repeat: no-repeat; + background-position: center; + display: flex; + + /* margin-left: 4px; */ +} + +/* .stars__star:first-child { + margin-left: 0; +} */ + +.stars--1 .stars__star:nth-child(-n + 1) { + background-image: url(../images/star-active.svg); +} + +.stars--2 .stars__star:nth-child(-n + 2) { + background-image: url(../images/star-active.svg); +} + +.stars--3 .stars__star:nth-child(-n + 3) { + background-image: url(../images/star-active.svg); +} + +.stars--4 .stars__star:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); +} + +.stars--5 .stars__star:nth-child(-n + 5) { + background-image: url(../images/star-active.svg); +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..921c7cadd8 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,7 @@ -body { - margin: 0; -} +@import './utils/variables'; +@import './blocks/page'; +@import './blocks/header'; +@import './blocks/nav'; +@import './blocks/catalog'; +@import './blocks/card'; +@import './blocks/stars'; diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..87bae5d17e --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,6 @@ +$main-color: #00acdc; +$secondary-color: #616070; +$main_accent-color: #060b35; +$blue_accent-color: #00acdc; +$card-width: 200px; +$main-during: 300ms;