Skip to content

Commit

Permalink
Refactor: Decompose .contacts into separate component
Browse files Browse the repository at this point in the history
  • Loading branch information
astik-dev committed Apr 14, 2024
1 parent ed8e59d commit c6ec6da
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 69 deletions.
15 changes: 15 additions & 0 deletions src/components/contacts/_contacts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<section class="contacts">
<div class="contacts__container title-content">

<h2 id="contacts">Contacts</h2>

<div class="contacts__items">

@@for (var i = 0; i < 2; i++) {
<a href="#" class="contacts__item contacts__item_empty"></a>
}

</div>

</div>
</section>
63 changes: 63 additions & 0 deletions src/components/contacts/_contacts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@use "../../scss/abstracts/variables" as *;
@use "../../scss/abstracts/mixins" as *;


.contacts {

&__container {
@include container(750px, $section-gap);
}

&__items {
@include flex(flex, row, 20px, flex-start, center);
flex-wrap: wrap;
}

&__item {
@include flex(flex, row, 0, center, center);
width: 60px;
height: 60px;

background: #1E293B;
border-radius: 50px;

transition: $anim;

img {
width: 25px;
height: 25px;
}
}
}

@media (hover: hover) {
.contacts {

&__item:hover {
background: #2C66C3;
}
}
}

@media (max-width: 575.5px) {
.contacts {

&__container {
padding-top: $section-gap-min;
}

&__items {
gap: 10px;
}

&__item {
width: 50px;
height: 50px;

img {
width: 22px;
height: 22px;
}
}
}
}
12 changes: 2 additions & 10 deletions src/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,8 @@

@@include('./../components/reviews/_reviews.html')

<section class="main__contacts contacts">
<div class="contacts__container title-content">
<h2 id="contacts">Contacts</h2>
<div class="contacts__items">
<a href="#" class="contacts__item contacts__item_empty"></a>
<a href="#" class="contacts__item contacts__item_empty"></a>
<a href="#" class="contacts__item contacts__item_empty"></a>
</div>
</div>
</section>
@@include('./../components/contacts/_contacts.html')

</main>

@@include('./../components/footer/_footer-privacy-link.html')
Expand Down
60 changes: 1 addition & 59 deletions src/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@use "../components/projects/projects";
@use "../components/skills/skills";
@use "../components/reviews/reviews";
@use "../components/contacts/contacts";
@use "../components/footer/footer";


Expand Down Expand Up @@ -64,65 +65,6 @@



.contacts {

&__container {
@include container(750px, $section-gap);
}
&__items {
@include flex(flex, row, 20px, flex-start, center);
flex-wrap: wrap;
}
&__item {
@include flex(flex, row, 0, center, center);
width: 60px;
height: 60px;

background: #1E293B;
border-radius: 50px;

transition: $anim;

img {
width: 25px;
height: 25px;
}
}
}

@media (hover: hover) {
.contacts {

&__item:hover {
background: #2C66C3;
}
}
}

@media (max-width: 575.5px) {
.contacts {

&__container {
padding-top: $section-gap-min;
}

&__items {
gap: 10px;
}
&__item {
width: 50px;
height: 50px;

img {
width: 22px;
height: 22px;
}
}
}
}



.privacy {

&__container {
Expand Down

0 comments on commit c6ec6da

Please sign in to comment.