From a9c0c39167464ea23bc4f877ed643711f7227db8 Mon Sep 17 00:00:00 2001 From: Lera Date: Sat, 9 Nov 2024 16:36:54 +0100 Subject: [PATCH 1/2] add task solution --- readme.md | 6 +- src/index.html | 360 ++++++++++++++++++++++++++++++- src/styles/card.scss | 128 +++++++++++ src/styles/header.scss | 68 ++++++ src/styles/index.scss | 7 +- src/styles/reset.scss | 90 ++++++++ src/styles/start.scss | 22 ++ src/styles/untils/variables.scss | 3 + 8 files changed, 677 insertions(+), 7 deletions(-) create mode 100644 src/styles/card.scss create mode 100644 src/styles/header.scss create mode 100644 src/styles/reset.scss create mode 100644 src/styles/start.scss create mode 100644 src/styles/untils/variables.scss diff --git a/readme.md b/readme.md index 874ca70d97..30cffab643 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://leraMeleshchenko.github.io/layout_catalog/) +- [TEST REPORT LINK](https://leraMeleshchenko.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..4880fbae29 100644 --- a/src/index.html +++ b/src/index.html @@ -19,9 +19,367 @@ rel="stylesheet" href="styles/index.scss" /> + -

Catalog

+
+ + + + + +
+
+
+ imac image + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ imac image + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ imac image + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ imac image + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ imac image + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ imac image + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ imac image + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+ imac image + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+
diff --git a/src/styles/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..d4dbe70877 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,128 @@ +body { + margin: 0; + font-family: Roboto, sans-serif; + font-weight: 400; + font-size: 10px; + line-height: 14px; +} + +main { + display: grid; + padding: 50px 40px; + justify-content: center; + gap: 46px 48px; + grid-template-columns: repeat(1, 200px); + + @media (min-width: 488px) { + grid-template-columns: repeat(2, 200px); + } + + @media (min-width: 768px) { + grid-template-columns: repeat(3, 200px); + } + + @media (min-width: 1024px) { + grid-template-columns: repeat(4, 200px); + } +} + +.card { + padding: 32px 16px 16px; + width: 200px; + background-color: #fff; + border: 1px solid #f3f3f3; + border-radius: 5px; + box-sizing: border-box; + + display: flex; + align-items: center; + flex-direction: column; + transition: transform 300ms ease; + &:hover { + transform: scale(1.2); + } + + &__img { + width: 160px; + height: 134px; + margin-bottom: 40px; + } + + &__title { + font-weight: 500; + font-size: 12px; + line-height: 18px; + margin-bottom: 4px; + color: $card-dark-text; + transition: color 300ms ease; + } + + &:hover .card__title { + color: #34568b; + } + + &__product-code { + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: $card-grey-text; + align-self: flex-start; + margin-bottom: 16px; + } + + &__stars { + width: 100%; + display: flex; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 24px; + } + + &__price { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; + } + + &__name-price { + font-size: 12px; + color: $card-grey-text; + } + + &__num-price { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: $card-dark-text; + } + + &__button { + box-sizing: border-box; + font-family: Roboto, sans-serif; + color: #fff; + width: 100%; + height: 40px; + font-weight: 700; + font-size: 14px; + line-height: 16px; + background-color: $header-blue-color; + border-radius: 5px; + border: 1px solid $header-blue-color; + outline: none; + display: flex; + justify-content: center; + align-items: center; + text-transform: uppercase; + text-align: center; + transition: + background-color 300ms ease, + color 300ms ease; + &:hover { + background-color: #fff; + border: 1px solid $header-blue-color; + color: $header-blue-color; + } + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..e2d28b790f --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,68 @@ +body { + margin: 0; +} + +.header { + display: flex; + padding: 0 50px; + justify-content: space-between; + align-items: center; + box-shadow: 0 2px 4px 0 #0000000d; + &__logo { + margin-top: 3px; + } +} + +.nav { + &__list { + display: flex; + margin: 0; + text-decoration: none; + } + + &__link { + margin-right: 20px; + transition: color 300ms ease; + &:last-child { + margin-right: 0; + } + &:hover { + color: $header-blue-color; + } + } + + &__item { + display: flex; + /* stylelint-disable-next-line font-family-name-quotes */ + font-family: 'Roboto', sans-serif; + color: $card-dark-text; + height: 60px; + font-weight: 500; + font-size: 12px; + text-align: center; + text-transform: uppercase; + text-decoration: none; + justify-content: center; + align-items: center; + + &:hover { + color: $header-blue-color; + } + } +} + +.is-active { + color: $header-blue-color; + position: relative; +} + +.is-active::after { + position: absolute; + content: ''; + display: block; + bottom: 0; + width: 100%; + height: 4px; + border-radius: 8px; + background-color: $header-blue-color; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..854639b9fe 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,4 @@ -body { - margin: 0; -} +@import './untils/variables'; +@import './header'; +@import './card'; +@import './start'; diff --git a/src/styles/reset.scss b/src/styles/reset.scss new file mode 100644 index 0000000000..fe0c25efee --- /dev/null +++ b/src/styles/reset.scss @@ -0,0 +1,90 @@ +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video { + margin: 0; + padding: 0; + border: 0; +} + +ol, +ul { + list-style: none; +} diff --git a/src/styles/start.scss b/src/styles/start.scss new file mode 100644 index 0000000000..cbabd6bd19 --- /dev/null +++ b/src/styles/start.scss @@ -0,0 +1,22 @@ +.stars { + display: flex; + + &__star { + background-image: url('../images/star.svg'); + background-repeat: no-repeat; + background-position: center; + width: 16px; + height: 16px; + margin-right: 4px; + } + + .stars__star:last-child { + margin-right: 0; + } + + &--4 .stars__star:nth-child(-n + 4) { + background-image: url('../images/star-active.svg'); + background-repeat: no-repeat; + background-position: center; + } +} diff --git a/src/styles/untils/variables.scss b/src/styles/untils/variables.scss new file mode 100644 index 0000000000..c23d9581fd --- /dev/null +++ b/src/styles/untils/variables.scss @@ -0,0 +1,3 @@ +$header-blue-color: #00acdc; +$card-dark-text: #060b35; +$card-grey-text: #616070; From 125ed625a3a0a785b469ed4b1697d162c492c115 Mon Sep 17 00:00:00 2001 From: Lera Date: Sat, 9 Nov 2024 23:52:00 +0100 Subject: [PATCH 2/2] update task solution --- src/index.html | 2 +- src/styles/{reset.scss => reset.css} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/styles/{reset.scss => reset.css} (100%) diff --git a/src/index.html b/src/index.html index 4880fbae29..df27706116 100644 --- a/src/index.html +++ b/src/index.html @@ -21,7 +21,7 @@ /> diff --git a/src/styles/reset.scss b/src/styles/reset.css similarity index 100% rename from src/styles/reset.scss rename to src/styles/reset.css