Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Frontend practice with catalog page and hovers
Replace `<your_account>` with your Github username and copy the links to Pull Request description:
- [DEMO LINK](https://<your_account>.github.io/layout_catalog_hovers/)
- [DEMO LINK](https://LabPetro.github.io/layout_catalog_hovers/)

> Follow [this instructions](https://github.com/mate-academy/layout_task-guideline#how-to-solve-the-layout-tasks-on-github)

Expand Down
30 changes: 18 additions & 12 deletions src/styles/blocks/catalog.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
@mixin card-box {
width: 200px;
height: 300px;
border: 1px solid #ccc;
border-radius: 5px;
}

.catalog {
display: flex;
flex-wrap: wrap;

@extend %position-center;
max-width: 944px;
margin: 0 auto;
padding: 50px 0;

&__card {
display: flex;
@extend %flex-box;
justify-content: center;
align-items: center;
box-sizing: border-box;

width: 200px;
height: 300px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 48px;
transition: transform 0.3s ease, color 0.3s ease;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a variable for the transition duration as well

@include card-box;
margin-bottom: $margin-space;

&:not(:nth-child(4n)) {
margin-right: 48px;
margin-right: $margin-space;
}

&:hover {
transform: scale(1.2);
color: #34568b;
}
}
}
18 changes: 12 additions & 6 deletions src/styles/blocks/header.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
.header {
%flex-box {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}

height: 60px;
.header {
@extend %flex-box;
justify-content: space-between;
height: $header-heights;
padding: 0 50px;

box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);

&__logo {
Expand All @@ -25,7 +26,7 @@
position: relative;
color: #060b35;
list-style: none;
line-height: 60px;
line-height: $header-heights;

&:not(:last-child) {
margin-right: 20px;
Expand All @@ -38,5 +39,10 @@
text-transform: uppercase;
font-size: 12px;
font-weight: 500;
transition: color 0.3s ease;

&:hover {
color: #00acdc;
}
}
}
10 changes: 9 additions & 1 deletion src/styles/blocks/page.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
* {
box-sizing: border-box;
}

%position-center {
margin: 0 auto;
}

.page {
font-family: Roboto, sans-serif;

&__body {
margin: 0;
@extend %position-center;
}
}
7 changes: 4 additions & 3 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "blocks/page";
@import "blocks/header";
@import "blocks/catalog";
@import "./utils/variables";
@import "blocks/page.scss";
@import "blocks/header.scss";
@import "blocks/catalog.scss";
2 changes: 2 additions & 0 deletions src/styles/utils/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$margin-space: 48px;
$header-heights: 60px;