From 7418a74cb9b369d1f63a932575af9b2da1f99ffe Mon Sep 17 00:00:00 2001 From: AnoriFrell Date: Sat, 11 Jan 2025 19:25:03 +0200 Subject: [PATCH] catalog --- readme.md | 6 +- src/index.html | 318 ++++++++++++++++++++++- src/styles/components/card/card.scss | 115 ++++++++ src/styles/components/header/header.scss | 12 + src/styles/components/nav/nav.scss | 20 ++ src/styles/index.scss | 50 ++++ src/styles/utils/variables.scss | 10 + 7 files changed, 527 insertions(+), 4 deletions(-) create mode 100644 src/styles/components/card/card.scss create mode 100644 src/styles/components/header/header.scss create mode 100644 src/styles/components/nav/nav.scss create mode 100644 src/styles/utils/variables.scss diff --git a/readme.md b/readme.md index 874ca70d97..4724634b1e 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://AnoriFrell.github.io/layout_catalog/) +- [TEST REPORT LINK](https://AnoriFrell.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..87b7ae7e0a 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,322 @@ -

Catalog

+
+ + + + +
+
+
+
+ mac-photo +
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+
+ mac-photo +
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+
+ mac-photo +
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+
+ mac-photo +
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+
+ mac-photo +
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+
+ mac-photo +
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+
+ mac-photo +
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+ +
+
+ mac-photo +
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ +
+
diff --git a/src/styles/components/card/card.scss b/src/styles/components/card/card.scss new file mode 100644 index 0000000000..b876aba7da --- /dev/null +++ b/src/styles/components/card/card.scss @@ -0,0 +1,115 @@ +.card { + display: flex; + flex-direction: column; + box-sizing: border-box; + border: 1px solid $card-border-color; + border-radius: 5px; + width: 200px; + padding: 32px 16px 16px; + transition-duration: 200ms; + + &:hover { + transform: scale(120%); + } + &__image-container { + display: flex; + justify-content: center; + } + &__image { + width: 160px; + height: 134px; + } + &__title { + padding-top: 40px; + font-size: 12px; + font-weight: 500; + line-height: 18px; + color: $font-color-main; + } + &:hover &__title { + color: $card-hover-title; + } + &__code { + padding-top: 4px; + font-size: 10px; + font-weight: 400; + line-height: 14px; + color: $font-color-secondary; + } + &__stars-container { + display: flex; + } + &__stars { + display: flex; + justify-content: space-between; + padding-top: 16px; + &-star { + background-image: url(../images/star-active.svg); + background-repeat: no-repeat; + background-position: center; + width: 16px; + height: 16px; + &:last-of-type { + background-image: url(../images/star.svg); + } + &:not(:last-of-type) { + margin-right: 4px; + } + } + } + &__stars-reviews { + align-self: flex-end; + font-size: 10px; + font-weight: 400; + line-height: 14px; + color: $font-color-main; + } + &__price { + display: flex; + justify-content: space-between; + align-items: center; + padding-top: 24px; + padding-bottom: 16px; + &-text { + font-size: 12px; + font-weight: 400; + line-height: 18px; + color: $font-color-secondary; + } + &-number { + font-size: 16; + font-weight: 600; + line-height: 18px; + color: $font-color-main; + } + } + &__button-container { + display: flex; + justify-content: center; + height: 40px; + box-sizing: border-box; + } + &__button { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + border: 1px solid $button-bcg-color; + border-radius: 5; + &--styles { + text-transform: uppercase; + text-decoration: none; + font-size: 14; + font-weight: 600; + line-height: 16px; + background-color: $button-bcg-color; + color: $text-color; + cursor: pointer; + &:hover { + background-color: $button-hover-bcg-color; + color: $text-hover-color; + border: 1px solid $text-hover-color; + } + } + } +} diff --git a/src/styles/components/header/header.scss b/src/styles/components/header/header.scss new file mode 100644 index 0000000000..6a27eca922 --- /dev/null +++ b/src/styles/components/header/header.scss @@ -0,0 +1,12 @@ +.header { + display: flex; + position: relative; + justify-content: flex-end; + background-color: #fff; + + &__logo { + position: absolute; + left: 50px; + top: 10px; + } +} diff --git a/src/styles/components/nav/nav.scss b/src/styles/components/nav/nav.scss new file mode 100644 index 0000000000..bb14ecd703 --- /dev/null +++ b/src/styles/components/nav/nav.scss @@ -0,0 +1,20 @@ +.nav { + display: flex; + align-items: center; + margin-right: 50px; + line-height: 60px; + text-transform: uppercase; + font-size: 12px; + font-weight: 500; + + &__link { + display: inline-block; + color: $nav-link-color; + } + &__link:not(:first-child) { + margin-left: 20px; + } + &__link:hover { + color: $main-color; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..77ee6d47a5 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,53 @@ +@import './utils/variables'; +@import 'components/header/header'; +@import 'components/nav/nav'; +@import 'components/card/card'; + +* { + margin: 0; + padding: 0; +} + body { margin: 0; + font-family: Roboto, serif; +} + +.container { + display: grid; + justify-content: center; + gap: 46px 48px; + padding: 50px 40px; + + @media (min-width: 308px) { + 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); + } +} + +.is-active { + position: relative; + color: $main-color; + + &::after { + position: absolute; + content: ''; + left: 0; + bottom: 0; + height: 4px; + border-radius: 8px; + width: 100%; + background-color: $main-color; + } } diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..b5ca774ffa --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,10 @@ +$main-color: #00acdc; +$font-color-main: #060b35; +$font-color-secondary: #616070; +$button-bcg-color: #00acdc; +$button-hover-bcg-color: #fff; +$text-hover-color: #00acdc; +$text-color: #fff; +$card-border-color: #f3f3f3; +$nav-link-color: #060b35; +$card-hover-title: #34568b;