generated from JohnFTitor/webpackTemplate
-
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 #31 from carloshs1994/home-page-styling
Home page styling
- Loading branch information
Showing
11 changed files
with
219 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
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,11 +1,35 @@ | ||
// Include your code here | ||
import './styles/main.scss'; | ||
import { displayPokemons, displayLikes, displayCounters } from './modules/generators.js'; | ||
import { | ||
displayPokemons, | ||
displayLikes, | ||
displayCounters, | ||
addMenu, | ||
} from './modules/generators.js'; | ||
import displayPopup from './modules/popup.js'; | ||
|
||
window.onload = async () => { | ||
await displayPokemons(); | ||
await displayLikes(); | ||
displayPopup(); | ||
displayCounters(); | ||
addMenu(); | ||
}; | ||
|
||
const nav = document.querySelector('.nav'); | ||
const main = document.querySelector('main'); | ||
const linkTags = nav.querySelectorAll('a'); | ||
linkTags.forEach((tag) => { | ||
const reGex = /#[\w-]+/g; | ||
tag.addEventListener('click', async (event) => { | ||
const pageId = event.target.href.match(reGex)[0]; | ||
main.innerHTML = ''; | ||
if (pageId === '#pokemons') { | ||
await displayPokemons(); | ||
await displayLikes(); | ||
displayCounters(); | ||
} | ||
const navChild = document.querySelector('.nav-child'); | ||
navChild.setAttribute('data-active', 'false'); | ||
}); | ||
}); |
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 +1,3 @@ | ||
// mixins | ||
@mixin for-small-devices { | ||
@media screen and (max-width: 750px) { @content; } | ||
} |
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.