Skip to content

Commit

Permalink
add solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Knysh19 committed Dec 14, 2024
1 parent fac84f8 commit efe60f6
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 190 deletions.
69 changes: 58 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,73 @@
/>
<nav class="nav">
<ul class="nav__list">
<li class="nav__item">
<li>
<a
class="nav__link is-active"
href="#"
href="#Apple"
>
Apple
</a>
</li>
<li class="nav__link">Samsung</li>
<li class="nav__link">Smartphones</li>
<li class="nav__item">
<a
class="nav__link"
href="#Samsung"
>
Samsung
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#Smartphones"
>
Smartphones
</a>
</li>
<li
class="nav__link"
class="nav__item"
data-qa="nav-hover"
>
Laptops & Computers
<a
class="nav__link"
href="#Laptops and Computers"
>
Laptops & Computers
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#Gadgets"
>
Gadgets
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#Tablets"
>
Tablets
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#Photo"
>
Photo
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#Video"
>
Video
</a>
</li>
<li class="nav__link">Gadgets</li>
<li class="nav__link">Tablets</li>
<li class="nav__link">Photo</li>
<li class="nav__link">Video</li>
</ul>
</nav>
</header>
Expand Down Expand Up @@ -83,7 +130,7 @@ <h2 class="card__title">
<p class="card__price_count">$2,199</p>
</div>
<a
href="#"
href="#Buy"
class="card__button"
data-qa="card-hover"
>
Expand Down
100 changes: 100 additions & 0 deletions src/styles/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.card {
border-radius: 5px;
width: 200px;
margin: 0;
padding: 32px 16px 16px;
font-family: $font-family;
border: 1px solid #f3f3f3;
transition:
transform 0.3s ease,
color 0.3s ease;

&__image {
width: 160px;
height: 134px;
margin: 0 auto 40px;
display: block;
}

&__title {
font-size: 12px;
font-weight: 500;
line-height: 18px;
color: $font-color;
margin-bottom: 4px;
transition: color 0.3s ease;
}

&__code {
font-size: 10px;
line-height: 14px;
color: $light-grey;
margin-bottom: 16px;
}

&__review {
align-items: center;
justify-content: space-between;
display: flex;
margin-bottom: 24px;

&_count {
font-size: 10px;
font-weight: 400;
line-height: 14px;
color: $font-color;
}
}

&__price {
margin-bottom: 16px;
display: flex;
justify-content: space-between;
align-items: center;

&_text {
font-size: 12px;
font-weight: 400;
line-height: 18px;
color: $light-grey;
}

&_count {
font-size: 16px;
font-weight: 700;
line-height: 18px;
color: $font-color;
}
}

&__button {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 40px;
background-color: $primary-color;
color: white;
font-size: 14px;
line-height: 16px;
font-weight: 700;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
cursor: pointer;
border: 1px solid $primary-color;

&:hover {
background-color: #fff;
color: $primary-color;
}
}
}

.card:hover {
transform: scale(1.2);

.card__title {
color: #34568b;
}
}
4 changes: 4 additions & 0 deletions src/styles/colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$primary-color: #00acdc;
$font-color: #060b35;
$light-grey: #616070;
$font-family: 'Roboto', sans-serif;
19 changes: 19 additions & 0 deletions src/styles/container.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.container {
display: grid;
grid-template-columns: repeat(1, 200px);
gap: 46px 48px;
justify-content: center;
padding: 50px 40px;

@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);
}
}
Loading

0 comments on commit efe60f6

Please sign in to comment.