-
Notifications
You must be signed in to change notification settings - Fork 0
Create Mobile Toggle Menu with JavaScript #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4d0a426
7d06200
ba28f04
968c7b7
2b28f9a
4b26734
fade1a9
c96fa3e
fee93e0
1095937
eaa09d7
b306832
0f061f5
2b655d3
b6af7d6
0040eb5
37723e4
25c91a6
21d4b0e
33bedd5
d8a99bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "env": { | ||
| "browser": true, | ||
| "es6": true, | ||
| "jest": true | ||
| }, | ||
| "parser": "babel-eslint", | ||
| "parserOptions": { | ||
| "ecmaVersion": 2018, | ||
| "sourceType": "module" | ||
| }, | ||
| "extends": ["airbnb-base"], | ||
| "rules": { | ||
| "no-shadow": "off", | ||
| "no-param-reassign": "off", | ||
| "eol-last": "off", | ||
| "import/extensions": [ 1, { | ||
| "js": "always", "json": "always" | ||
| }] | ||
| }, | ||
| "ignorePatterns": [ | ||
| "dist/", | ||
| "build/" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| { | ||
| "connector": { | ||
| "name": "local", | ||
| "options": { | ||
| "pattern": ["**", "!.git/**", "!node_modules/**"] | ||
| } | ||
| }, | ||
| "extends": ["development"], | ||
| "formatters": ["stylish"], | ||
| "hints": [ | ||
| "button-type", | ||
| "disown-opener", | ||
| "html-checker", | ||
| "meta-charset-utf-8", | ||
| "meta-viewport", | ||
| "no-inline-styles:error" | ||
| ] | ||
| } | ||
| "connector": { | ||
| "name": "local", | ||
| "options": { | ||
| "pattern": ["**", "!.git/**", "!node_modules/**"] | ||
| } | ||
| }, | ||
| "extends": ["development"], | ||
| "formatters": ["stylish"], | ||
| "hints": [ | ||
| "button-type", | ||
| "disown-opener", | ||
| "html-checker", | ||
| "meta-charset-utf-8", | ||
| "meta-viewport", | ||
| "no-inline-styles:error" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,10 @@ | ||
| { | ||
| "extends": ["stylelint-config-standard"], | ||
| "plugins": ["stylelint-scss", "stylelint-csstree-validator"], | ||
| "rules": { | ||
| "at-rule-no-unknown": null, | ||
| "scss/at-rule-no-unknown": true, | ||
| "csstree/validator": true | ||
| }, | ||
| "ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css"] | ||
| } | ||
|
|
||
| "extends": ["stylelint-config-standard"], | ||
| "plugins": ["stylelint-scss", "stylelint-csstree-validator"], | ||
| "rules": { | ||
| "at-rule-no-unknown": null, | ||
| "scss/at-rule-no-unknown": true, | ||
| "csstree/validator": true | ||
| }, | ||
| "ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css", "**/*.js", "**/*.jsx"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| const toggleMenu = document.getElementById('toggle-menu'); | ||
|
|
||
| function hide() { | ||
| toggleMenu.style.display = 'none'; | ||
| } | ||
|
|
||
| document.querySelectorAll('.mylinks').forEach((n) => n.addEventListener('click', () => { | ||
| hide(); | ||
| })); | ||
|
|
||
| function openNav() { | ||
| toggleMenu.style.display = 'block'; | ||
| } | ||
|
|
||
| function closeNav() { | ||
| toggleMenu.style.display = 'none'; | ||
| } | ||
|
|
||
| document.getElementById('openMenu').addEventListener('click', () => { | ||
| openNav(); | ||
| }); | ||
|
|
||
| document.getElementById('close').addEventListener('click', () => { | ||
| closeNav(); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,10 @@ | |
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Oluyemi Paul Portfolio</title> | ||
| <!-- Global site tag (gtag.js) - Google Analytics --> | ||
| <script async src="https://www.googletagmanager.com/gtag/js?id=G-DQYJK8ZFFX"></script> | ||
| <script> | ||
|
|
@@ -11,17 +15,14 @@ | |
|
|
||
| gtag('config', 'G-DQYJK8ZFFX'); | ||
| </script> | ||
| <meta charset="UTF-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Oluyemi Portfolio</title> | ||
| <link rel="preconnect" href="https://fonts.googleapis.com"> | ||
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
| <link | ||
| href="https://fonts.googleapis.com/css2?family=Crete+Round&family=Poppins:wght@100;200&family=Roboto:wght@100;200&display=swap" | ||
| rel="stylesheet"> | ||
| <script src="https://kit.fontawesome.com/746ba03926.js" crossorigin="anonymous"></script> | ||
| <link rel="stylesheet" href="style.css"> | ||
|
|
||
| </head> | ||
|
|
||
| <body> | ||
|
|
@@ -30,19 +31,31 @@ | |
| <nav id="navbar"> | ||
| <p id="profileName"><a href="#"> Paul, Oluyemi</a></p> | ||
| <ul id="desktop-nav"> | ||
|
Comment on lines
31
to
33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Comment on lines
31
to
33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Your design Figma design
Comment on lines
31
to
33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
See the image for reference |
||
| <li><a id="portfolio" href="#">Portfolio</a></li> | ||
| <li><a id="about" href="#">About </a></li> | ||
| <li><a id="contact" href="#"> Contact</a></li> | ||
| <li><a href="#"> <i class="far fa-envelope"></i></a></li> | ||
|
|
||
| <li><a href="#portfolio">Portfolio</a></li> | ||
| <li><a href="#about">About </a></li> | ||
| <li><a href="#contact"> Contact</a></li> | ||
| <li><a id="email" href="#"> <i class="far fa-envelope"></i></a></li> | ||
| </ul> | ||
| <div id="bars"> | ||
| <div class="bar1"></div> | ||
| <div id="openMenu" > | ||
| <a href="#"><div class="bar1"></div> | ||
| <div class="bar2"></div> | ||
| <div class="bar3"></div> | ||
| </a> | ||
| </div> | ||
| </nav> | ||
| </header> | ||
|
|
||
| <div id="hideMe"> | ||
| <div id="toggle-menu"> | ||
| <img src="./image/close-btn2.JPG" alt="" id="close"> | ||
| <ul> | ||
| <li class="mylinks"><a href="#portfolio" >Portfolio</a></li> | ||
| <li class="mylinks"><a href="#about">About</a></li> | ||
| <li class="mylinks"><a href="#contact" >Contact</a></li> | ||
| </ul> | ||
| <div></div> | ||
| </div> | ||
| </div> | ||
| <main id="container" class="flex-b"> | ||
| <section class="first-page"> | ||
| <h1 class="greetText">Hey There.<br> | ||
|
|
@@ -68,7 +81,7 @@ <h2 class="jobTitle">I am a Software Developer</h2> | |
| </main> | ||
|
|
||
| <!-- Project/works Section --> | ||
| <div class="content-flex flex-c"> | ||
| <div class="content-flex flex-c" id="portfolio"> | ||
| <div id="topic"> | ||
| <h2>My Recent Works</h2> | ||
| <hr> | ||
|
|
@@ -93,8 +106,6 @@ <h2 id="story">Multi-Post Stories</h2> | |
| </div> | ||
| </div> | ||
|
|
||
|
|
||
|
|
||
| <div class="flex-d"> | ||
|
|
||
| <div class="content_1 content-flex "> | ||
|
|
@@ -144,7 +155,6 @@ <h3 class="title-post">Profesional Art Printing Data More</h3> | |
|
|
||
| </div> | ||
|
|
||
|
|
||
| <div class="flex-e"> | ||
| <div class="content_1 content-flex"> | ||
| <div class="img04"> | ||
|
|
@@ -193,9 +203,7 @@ <h3 class="title-post">Profesional Art Printing Data More</h3> | |
| </div> | ||
|
|
||
| <!-- About-me Section --> | ||
|
|
||
| <section class="about_me_grid flex-f"> | ||
|
|
||
| <section class="about_me_grid flex-f" id="about" > | ||
| <div class="flex-f1"> | ||
| <img id="about_img" width="586" height="354" src="./image/about-img-bg.png" alt=""> | ||
| <h2 id="about-title">About me</h2> | ||
|
|
@@ -251,18 +259,18 @@ <h2 id="about-title">About me</h2> | |
| </div> | ||
|
|
||
| </section> | ||
|
|
||
| <section class="flex-g"> | ||
| <section class="flex-g" id="contact"> | ||
| <div class="flex-g1"> | ||
| <h4 id="intrest-text">I'm always interested in hearing about new projects, | ||
| so if you'd like to chat please get in touch.</h4> | ||
| <form action="https://formspree.io/f/mknyregg" method="post"> | ||
| <form action="https://formspree.io/f/mknyregg" method="post" id="form"> | ||
| <div class="flex"> | ||
| <input type="text" class="input-text" id="name" name="client_name" maxlength="30" | ||
| placeholder="Full name" required> | ||
| <input type="email" class="input-text" id="email" name="client_email" maxlength="30" | ||
| <input type="email" class="input-text" id="eml" name="email" maxlength="30" | ||
| placeholder="Email address" required> | ||
| <textarea id="msg" name="client_comment" maxlength="500" placeholder="Enter text here" | ||
| <p id="invalidText"></p> | ||
| <textarea id="msg" name="msg" maxlength="500" placeholder="Enter text here" | ||
| required></textarea> | ||
| <button class="button" type="submit">Get in touch</button> | ||
| </div> | ||
|
|
@@ -282,7 +290,8 @@ <h4 id="intrest-text">I'm always interested in hearing about new projects, | |
| </div> | ||
| <div id="footer-bar"></div> | ||
| </section> | ||
| </div> | ||
| </div> | ||
| <script src="dom.js"></script> | ||
| </body> | ||
|
|
||
| </html> | ||





Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your design
Figma design