diff --git a/readme.md b/readme.md index 3354ca6020..b8d0297766 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Product cards -Create a pages with product card using `flexbox`, `BEM` and `SCSS` based on [this mockup](https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=11325%3A2287&mode=dev). +Create a pages with product card using `flexbox`, `BEM` and `SCSS` based on [this mockup](). > Here are the [Layout Tasks Instructions](https://mate-academy.github.io/layout_task-guideline) @@ -20,8 +20,8 @@ Create a pages with product card using `flexbox`, `BEM` and `SCSS` based on [thi ❗️ Replace `` with your Github username and copy the links to `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_product-cards/) -- [TEST REPORT LINK](https://.github.io/layout_product-cards/report/html_report/) +- [DEMO LINK](https://Daniil-102.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://Daniil-102.github.io/layout_product-cards/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 43745cc17f..2cb7ad190d 100644 --- a/src/index.html +++ b/src/index.html @@ -7,12 +7,60 @@ content="width=device-width, initial-scale=1.0" /> Product cards + + + + -

Product cards

+
+   APPLE A1419 iMac +

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

+ +

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + +
diff --git a/src/styles/blocks/card.scss b/src/styles/blocks/card.scss new file mode 100644 index 0000000000..15bbe76550 --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,71 @@ +.card { + border: 1px solid $color-gray; + width: 200px; + padding: 32px 16px 16px; + + &__description { + color: $text-main-color; + font-size: 12px; + font-weight: 500; + line-height: 18px; + margin-bottom: 4px; + } + &__code { + color: $text-secondary-color; + font-size: 10px; + line-height: 14px; + } + + &__reviews { + color: $text-main-color; + font-size: 10px; + line-height: 14px; + } + + &__stars { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 24px; + margin-top: 16px; + } + + &__img { + display: block; + width: 160px; + height: 134px; + margin: 0 auto 40px; + } + + &__cost { + display: flex; + justify-content: space-between; + margin-bottom: 16px; + } + &__price { + color: $text-secondary-color; + font-size: 12px; + line-height: 18px; + } + &__total { + color: $text-main-color; + line-height: 18px; + font-weight: 700; + } + + &__button { + height: 40px; + width: 100%; + border-radius: 5px; + font-size: 14px; + background-color: #00acdc; + color: #fff; + box-sizing: border-box; + border: 1px solid #00acdc; + + &:hover { + color: $color-blue-accent; + background-color: $color-white; + } + } +} diff --git a/src/styles/blocks/stars.css b/src/styles/blocks/stars.css new file mode 100644 index 0000000000..9f97676cdb --- /dev/null +++ b/src/styles/blocks/stars.css @@ -0,0 +1,41 @@ +.stars { + display: flex; +} + +.stars__star { + width: 16px; + height: 16px; + margin-left: 4px; + background-position: center; + background-repeat: no-repeat; + background-image: url('../images/star.svg'); +} + +.stars__star:first-child { + margin-left: 0; +} + +.stars--0 .stars__star:nth-child(-n + 0) { + background-image: url('../images/star-active.svg'); +} + +.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'); +} +/*# sourceMappingURL=stars.css.map */ diff --git a/src/styles/blocks/stars.css.map b/src/styles/blocks/stars.css.map new file mode 100644 index 0000000000..f5e82eb8f7 --- /dev/null +++ b/src/styles/blocks/stars.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["stars.scss","stars.css"],"names":[],"mappings":"AAAA;EACE,aAAA;ACCF;ADCE;EACE,WAAA;EACA,YAAA;EACA,gBAAA;EACA,2BAAA;EACA,4BAAA;EACA,2CAAA;ACCJ;ADEE;EACE,cAAA;ACAJ;ADKM;EACE,kDAAA;ACHR;ADEM;EACE,kDAAA;ACAR;ADDM;EACE,kDAAA;ACGR;ADJM;EACE,kDAAA;ACMR;ADPM;EACE,kDAAA;ACSR;ADVM;EACE,kDAAA;ACYR","file":"stars.css"} \ No newline at end of file diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..74bb7b3cb2 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,24 @@ +.stars { + display: flex; + + &__star { + width: 16px; + height: 16px; + margin-left: 4px; + background-position: center; + background-repeat: no-repeat; + background-image: url('../images/star.svg'); + } + + &__star:first-child { + margin-left: 0; + } + + @for $i from 0 through 5 { + &--#{$i} { + .stars__star:nth-child(-n + #{$i}) { + background-image: url('../images/star-active.svg'); + } + } + } +} diff --git a/src/styles/index.css b/src/styles/index.css new file mode 100644 index 0000000000..abda371bb3 --- /dev/null +++ b/src/styles/index.css @@ -0,0 +1,131 @@ +@import './reset.css'; + +.card { + border: 1px solid #f3f3f3; + width: 200px; + padding: 32px 16px 16px; +} + +.card__description { + color: #060b35; + font-size: 12px; + font-weight: 500; + line-height: 18px; + margin-bottom: 4px; +} + +.card__code { + color: #616070; + font-size: 10px; + line-height: 14px; +} + +.card__reviews { + color: #060b35; + font-size: 10px; + line-height: 14px; +} + +.card__stars { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 24px; + margin-top: 16px; +} + +.card__img { + display: block; + width: 160px; + height: 134px; + margin: 0 auto 40px; +} + +.card__cost { + display: flex; + justify-content: space-between; + margin-bottom: 16px; +} + +.card__price { + color: #616070; + font-size: 12px; + line-height: 18px; +} + +.card__total { + color: #060b35; + line-height: 18px; + font-weight: 700; +} + +.card__button { + height: 40px; + width: 100%; + border-radius: 5px; + font-size: 14px; + background-color: #00acdc; + color: #fff; + box-sizing: border-box; + border: 1px solid #00acdc; +} + +.card__button:hover { + color: #00acdc; + background-color: #fff; +} + +.stars { + display: flex; +} + +.stars__star { + width: 16px; + height: 16px; + margin-left: 4px; + background-position: center; + background-repeat: no-repeat; + background-image: url('../images/star.svg'); +} + +.stars__star:first-child { + margin-left: 0; +} + +.stars--0 .stars__star:nth-child(-n + 0) { + background-image: url('../images/star-active.svg'); +} + +.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'); +} + +html { + font-family: Roboto, sans-serif; + font-weight: 400; +} + +p { + margin: 0; +} + +* { + box-sizing: border-box; +} +/*# sourceMappingURL=index.css.map */ diff --git a/src/styles/index.css.map b/src/styles/index.css.map new file mode 100644 index 0000000000..71a0335396 --- /dev/null +++ b/src/styles/index.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.scss","blocks/card.scss","index.css","../utils/variables.scss","blocks/stars.scss"],"names":[],"mappings":"AACQ,qBAAA;ACDR;EACE,yBAAA;EACA,YAAA;EACA,uBAAA;ACEF;ADAE;EACE,cENc;EFOd,eAAA;EACA,gBAAA;EACA,iBAAA;EACA,kBAAA;ACEJ;ADAE;EACE,cEZmB;EFanB,eAAA;EACA,iBAAA;ACEJ;ADCE;EACE,cEnBc;EFoBd,eAAA;EACA,iBAAA;ACCJ;ADEE;EACE,aAAA;EACA,mBAAA;EACA,8BAAA;EACA,mBAAA;EACA,gBAAA;ACAJ;ADGE;EACE,cAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;ACDJ;ADIE;EACE,aAAA;EACA,8BAAA;EACA,mBAAA;ACFJ;ADIE;EACE,cE5CmB;EF6CnB,eAAA;EACA,iBAAA;ACFJ;ADIE;EACE,cElDc;EFmDd,iBAAA;EACA,gBAAA;ACFJ;ADKE;EACE,YAAA;EACA,WAAA;EACA,kBAAA;EACA,eAAA;EACA,yBAAA;EACA,WAAA;EACA,sBAAA;EACA,yBAAA;ACHJ;ADKI;EACE,cE9Dc;EF+Dd,sBEjEQ;AD8Dd;;AEhEA;EACE,aAAA;AFmEF;AEjEE;EACE,WAAA;EACA,YAAA;EACA,gBAAA;EACA,2BAAA;EACA,4BAAA;EACA,2CAAA;AFmEJ;AEhEE;EACE,cAAA;AFkEJ;AE7DM;EACE,kDAAA;AF+DR;AEhEM;EACE,kDAAA;AFkER;AEnEM;EACE,kDAAA;AFqER;AEtEM;EACE,kDAAA;AFwER;AEzEM;EACE,kDAAA;AF2ER;AE5EM;EACE,kDAAA;AF8ER;;AF5FA;EACE,+BAAA;EACA,gBAAA;AE+FF;;AF5FA;EACE,SAAA;AE+FF;;AF5FA;EACE,sBAAA;AE+FF","file":"index.css"} \ No newline at end of file diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..68daf21b26 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,17 @@ -body { +@import '../utils/variables'; +@import './reset.css'; +@import './blocks/card'; +@import './blocks/stars'; + +html { + font-family: Roboto, sans-serif; + font-weight: 400; +} + +p { margin: 0; } + +* { + box-sizing: border-box; +} diff --git a/src/styles/reset.css b/src/styles/reset.css new file mode 100644 index 0000000000..bbac3aab65 --- /dev/null +++ b/src/styles/reset.css @@ -0,0 +1,130 @@ +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; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +/* HTML5 display-role reset for older browsers */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { + display: block; +} + +body { + line-height: 1; +} + +ol, +ul { + list-style: none; +} + +blockquote, +q { + quotes: none; +} + +blockquote::before, +blockquote::after, +q::before, +q::after { + content: ''; + content: none; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/src/utils/variables.css b/src/utils/variables.css new file mode 100644 index 0000000000..51e714bf8a --- /dev/null +++ b/src/utils/variables.css @@ -0,0 +1 @@ +/*# sourceMappingURL=variables.css.map */ diff --git a/src/utils/variables.css.map b/src/utils/variables.css.map new file mode 100644 index 0000000000..639caba5ba --- /dev/null +++ b/src/utils/variables.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"variables.css"} \ No newline at end of file diff --git a/src/utils/variables.scss b/src/utils/variables.scss new file mode 100644 index 0000000000..289fa017b0 --- /dev/null +++ b/src/utils/variables.scss @@ -0,0 +1,5 @@ +$text-main-color: #060b35; +$text-secondary-color: #616070; +$color-white: #fff; +$color-gray: #f3f3f3; +$color-blue-accent: #00acdc;