-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ananastasiap/05_responsive
05_Responsiveness
- Loading branch information
Showing
12 changed files
with
189 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
.u-wrapper { | ||
padding: 2.5rem 8.12rem 0 15rem; | ||
} | ||
|
||
.u-wrapper-larger { | ||
padding: 2.5rem 35rem 0 15rem; | ||
padding: 3.5rem 8.12rem 0 14rem; | ||
} | ||
|
||
.stroke { | ||
-webkit-text-stroke: 0.04rem #94b7fc; | ||
} | ||
|
||
/* MEDIA */ | ||
@media screen and (max-width: 1194px) and (min-width: 1040px) { | ||
.u-wrapper { | ||
padding: 2.5rem 3.12rem 0 5rem; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 1039px) { | ||
.u-wrapper { | ||
padding: 2rem 3rem 0 3rem; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,10 @@ | |
margin-bottom: 2.96rem; | ||
} | ||
} | ||
|
||
/* MEDIA */ | ||
@media screen and (max-width: 551px) { | ||
.title { | ||
margin-top: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* MEDIA */ | ||
@media screen and (max-width: 550px) { | ||
.logo__icon { | ||
width: 14rem; | ||
height: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import "../scss/style.scss"; | ||
import "swiper/css"; | ||
import { swiperMain } from "./modules"; | ||
import { swiperMain, rearrangeElement } from "./modules"; | ||
|
||
window.addEventListener("DOMContentLoaded", () => { | ||
// swiperThumb(".congratulation__swiper--thumb"); | ||
swiperMain(".congratulation__swiper--card"); | ||
window.addEventListener("resize", () => { | ||
rearrangeElement(".card", ".card__title", ".card__contacts"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { swiperThumb, swiperMain } from "./swiper.ts"; | ||
export { rearrangeElement } from "./sciptForCard.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const rearrangeElement = ( | ||
cardSelector: string, | ||
cardTitleSelector: string, | ||
cardContactsSelector: string | ||
) => { | ||
const screenWidth = window.innerWidth; | ||
|
||
const card = document.querySelector(cardSelector); | ||
const cardTitle = document.querySelector(cardTitleSelector); | ||
const cardContacts = document.querySelector(cardContactsSelector); | ||
|
||
if (screenWidth <= 580 && card && cardContacts) { | ||
card?.after(cardContacts); | ||
} else if (cardTitle && cardContacts) { | ||
cardTitle?.after(cardContacts); | ||
} | ||
}; |