-
Notifications
You must be signed in to change notification settings - Fork 29
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 #732 from chillkang/landing-page-redesign
Landing page redesign
- Loading branch information
Showing
14 changed files
with
846 additions
and
764 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
function toggleDropdown(toggle, open) { | ||
const parentElement = toggle.parentNode; | ||
const dropdown = document.getElementById( | ||
toggle.getAttribute("aria-controls") | ||
); | ||
dropdown.setAttribute("aria-hidden", !open); | ||
|
||
if (open) { | ||
parentElement.classList.add("is-active", "is-selected"); | ||
} else { | ||
parentElement.classList.remove("is-active", "is-selected"); | ||
} | ||
} | ||
|
||
function closeAllDropdowns(toggles) { | ||
toggles.forEach((toggle) => { | ||
toggleDropdown(toggle, false); | ||
}); | ||
} | ||
|
||
function handleClickOutside(toggles, containerClass) { | ||
document.addEventListener("click", (event) => { | ||
const {target} = event; | ||
|
||
if (target.closest) { | ||
if (!target.closest(containerClass)) { | ||
closeAllDropdowns(toggles); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
function initNavDropdowns(containerClass) { | ||
const toggles = [].slice.call( | ||
document.querySelectorAll(`${containerClass } [aria-controls]`) | ||
); | ||
|
||
handleClickOutside(toggles, containerClass); | ||
|
||
toggles.forEach((toggle) => { | ||
toggle.addEventListener("click", (e) => { | ||
e.preventDefault(); | ||
|
||
const isOpen = e.target.parentNode.classList.contains("is-active"); | ||
|
||
closeAllDropdowns(toggles); | ||
toggleDropdown(toggle, !isOpen); | ||
}); | ||
}); | ||
} |
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,12 @@ | ||
@mixin p-suru { | ||
.p-suru--bottom-right { | ||
background-image: url("#{$assets-path}a6474c5b-Suru%20top%20%20right%20angle.png"); | ||
background-position: bottom right; | ||
background-repeat: no-repeat; | ||
background-size: 200px 149px; | ||
|
||
@media only screen and (min-width: $breakpoint-large) { | ||
background-size: contain; | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.