Skip to content

Commit

Permalink
add new task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
solyaqw committed Oct 11, 2024
1 parent 837ef16 commit 7269667
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 125 deletions.
8 changes: 8 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
/>

<title>Product cards</title>
<link
rel="stylesheet"
href="./styles/card.scss"
/>
<link
rel="stylesheet"
href="./styles/stars.scss"
/>
<link
rel="stylesheet"
href="./styles/index.scss"
Expand Down
98 changes: 98 additions & 0 deletions src/styles/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
.card {
font-family: Roboto, sans-serif;
box-sizing: border-box;
width: 200px;
padding: 16px;

&__product-image {
padding: 16px 3px 0;
display: flex;
top: 33px;
left: 20px;
width: 160px;
height: 134px;
}

&__product-name {
margin: 0;
padding-top: 40px;
font-weight: 500;
font-size: 12px;
line-height: 18px;
color: #060b35;
}

&__product-code {
margin: 0;
padding-top: 4px;
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: #616070;
}

&__product-rating {
padding-top: 16px;
display: flex;
flex-direction: row;
justify-content: space-between;
width: 166px;
height: 16px;

&-review {
margin: 0;
display: flex;
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: #060b35;
align-self: flex-end;
}
}

&__product-price {
padding-top: 24px;
padding-bottom: 16px;
display: flex;
flex-direction: row;
justify-content: space-between;
line-height: 18px;

&-text {
margin: 0;
font-weight: 400;
font-size: 12px;
color: #616070;
}

&-numbers {
margin: 0;
font-weight: 700;
font-size: 16px;
}
}

&__product-buy-link {
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
width: 166px;
height: 40px;
background-color: #00acdc;

text-decoration: none;
font-weight: 700;
font-size: 14px;
line-height: 16px;
color: #fff;

&:hover {
background-color: #fff;
color: #00acdc;
border-style: solid;
border-width: 1px;
border-color: #00acdc;
}
}
}
125 changes: 0 additions & 125 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,128 +1,3 @@
body {
margin: 0;
}

// #region card

.card {
font-family: Roboto, sans-serif;
box-sizing: border-box;
width: 200px;
padding: 16px;

&__product-image {
padding: 16px 3px 0;
display: flex;
top: 33px;
left: 20px;
width: 160px;
height: 134px;
}

&__product-name {
margin: 0;
padding-top: 40px;
font-weight: 500;
font-size: 12px;
line-height: 18px;
color: #060b35;
}

&__product-code {
margin: 0;
padding-top: 4px;
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: #616070;
}

&__product-rating {
padding-top: 16px;
display: flex;
flex-direction: row;
justify-content: space-between;
width: 166px;
height: 16px;

&-review {
margin: 0;
display: flex;
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: #060b35;
align-self: flex-end;
}
}

&__product-price {
padding-top: 24px;
padding-bottom: 16px;
display: flex;
flex-direction: row;
justify-content: space-between;
line-height: 18px;

&-text {
margin: 0;
font-weight: 400;
font-size: 12px;
color: #616070;
}

&-numbers {
margin: 0;
font-weight: 700;
font-size: 16px;
}
}

&__product-buy-link {
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
width: 166px;
height: 40px;
background-color: #00acdc;

text-decoration: none;
font-weight: 700;
font-size: 14px;
line-height: 16px;
color: #fff;

&:hover {
background-color: #fff;
color: #00acdc;
border-style: solid;
border-width: 1px;
border-color: #00acdc;
}
}
}

// #endregion

// #region stars

.stars {
display: flex;

&__star {
width: 16px;
height: 16px;
border-radius: 0.5px;
background-position: center;
margin-right: 4px;
background-repeat: no-repeat;
background-image: url(../images/star.svg);

&:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
}
}
}

// #endregion
17 changes: 17 additions & 0 deletions src/styles/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.stars {
display: flex;

&__star {
width: 16px;
height: 16px;
border-radius: 0.5px;
background-position: center;
margin-right: 4px;
background-repeat: no-repeat;
background-image: url(../images/star.svg);

&:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
}
}
}

0 comments on commit 7269667

Please sign in to comment.