-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added card #5142
base: master
Are you sure you want to change the base?
added card #5142
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,61 @@ | |
content="width=device-width, initial-scale=1.0" | ||
/> | ||
<title>Product cards</title> | ||
<link | ||
rel="preconnect" | ||
href="https://fonts.googleapis.com" | ||
/> | ||
<link | ||
rel="preconnect" | ||
href="https://fonts.gstatic.com" | ||
/> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="./styles/index.scss" | ||
/> | ||
</head> | ||
<body> | ||
<h1>Product cards</h1> | ||
<div | ||
class="card" | ||
data-qa="card" | ||
> | ||
<img | ||
src="/src/images/imac.jpeg" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The image path should be relative to ensure it works correctly in different environments. Please change |
||
class="card__image" | ||
alt="Imac" | ||
/> | ||
<a | ||
href="#" | ||
class="card__title link" | ||
> | ||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
</a> | ||
<div class="card__product-code">Product code: 195434</div> | ||
<div class="card__rating"> | ||
<div class="card__stars"> | ||
<div class="card__star"></div> | ||
<div class="card__star"></div> | ||
<div class="card__star"></div> | ||
<div class="card__star"></div> | ||
<div class="card__star"></div> | ||
</div> | ||
<div class="card__reviews">Reviews: 5</div> | ||
</div> | ||
<div class="card__price"> | ||
<div class="card__price-title">Price:</div> | ||
<div class="card__price-value">$2,199</div> | ||
</div> | ||
<a | ||
href="#" | ||
class="card__button link" | ||
data-qa="hover" | ||
> | ||
BUY | ||
</a> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,104 @@ | ||
@import '/src/styles/variables'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The import path for the SCSS variables should be relative. Change |
||
@import '/src/styles/stars'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The import path for the SCSS stars should be relative. Change |
||
|
||
body { | ||
margin: 0; | ||
font-family: Roboto, serif; | ||
font-weight: 400; | ||
color: $primary-color; | ||
} | ||
|
||
.link { | ||
text-decoration: none; | ||
color: $primary-color; | ||
} | ||
|
||
.card { | ||
box-sizing: border-box; | ||
max-width: 200px; | ||
border: 1px solid #f3f3f3; | ||
border-radius: 5px; | ||
background: #fff; | ||
|
||
padding: 32px 16px 16px; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
|
||
&__image { | ||
display: block; | ||
margin: 0 auto 40px; | ||
width: 160px; | ||
height: 134px; | ||
} | ||
|
||
&__title { | ||
margin: 0 0 4px; | ||
font-size: 12px; | ||
line-height: 18px; | ||
font-weight: 500; | ||
} | ||
|
||
&__product-code { | ||
color: $secondary-color; | ||
font-size: 10px; | ||
line-height: 14px; | ||
|
||
margin-bottom: 16px; | ||
} | ||
|
||
&__rating { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: flex-end; | ||
|
||
margin-bottom: 24px; | ||
} | ||
|
||
&__reviews { | ||
font-size: 10px; | ||
line-height: 14px; | ||
} | ||
|
||
&__price { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
margin-bottom: 16px; | ||
} | ||
|
||
&__price-title { | ||
color: $secondary-color; | ||
font-size: 12px; | ||
line-height: 18px; | ||
} | ||
|
||
&__price-value { | ||
font-size: 16px; | ||
font-weight: 700; | ||
line-height: 18px; | ||
} | ||
|
||
&__button { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
box-sizing: border-box; | ||
height: 40px; | ||
border-radius: 5px; | ||
background-color: #00acdc; | ||
font-size: 14px; | ||
line-height: 16px; | ||
color: #fff; | ||
font-weight: 700; | ||
text-decoration: none; | ||
text-transform: uppercase; | ||
} | ||
|
||
&__button:hover { | ||
background-color: #fff; | ||
border: 1px solid #00acdc; | ||
color: #00acdc; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.card { | ||
&__stars { | ||
display: flex; | ||
gap: 4px; | ||
} | ||
|
||
&__star { | ||
width: 16px; | ||
height: 16px; | ||
background-image: url(/src/images/star.svg); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The image path should be relative to ensure it works correctly in different environments. Please change |
||
background-position: center; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
&__star:nth-child(-n + 4) { | ||
background-image: url(/src/images/star-active.svg); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The image path should be relative to ensure it works correctly in different environments. Please change |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$primary-color: #060b35; | ||
$secondary-color: #616070; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
crossorigin
attribute is missing for the Google Fonts link. Addcrossorigin="anonymous"
to ensure proper font loading.