-
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.
created a responsive and interactive side bar that opens on command w…
…hich will store css attributes
- Loading branch information
1 parent
5618fdc
commit 09bfcd9
Showing
4 changed files
with
81 additions
and
16 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,19 @@ | ||
import "./index.scss"; | ||
|
||
const closeNav = document.getElementById("close-btn"); | ||
const openNav = document.getElementById("open-nav"); | ||
const sideNav = document.getElementById("side-nav"); | ||
|
||
closeNav.addEventListener("click", closeSideNav); | ||
openNav.addEventListener("click", openSideNav); | ||
|
||
function closeSideNav() { | ||
sideNav.style.width = "0"; | ||
sideNav.style.paddingLeft = "0"; | ||
|
||
} | ||
|
||
function openSideNav() { | ||
sideNav.style.width = "240px"; | ||
sideNav.style.paddingLeft = "10px"; | ||
} |
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