-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (21 loc) · 944 Bytes
/
app.js
File metadata and controls
25 lines (21 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Router } from './Javascripts/router.js';
import { loadCV } from './Javascripts/cv/loadCV.js';
import { loadProjects } from './Javascripts/projects/loadProjects.js'
import { loadSkills } from './Javascripts/skills/loadSkills.js';
import { loadPortfolios } from './Javascripts/portfolios/loadPortfolios.js';
import { cvClicked, portfolioClicked, projectClicked, skillClicked } from './Javascripts/navBtnSelector.js';
const main = document.querySelector('main');
const routes = {
cv: { hash: '#cv', function: loadCV },
projects: { hash: '#projects', function: loadProjects },
skills: { hash: '#skills', function: loadSkills },
portfolios: { hash: '#portfolios', function: loadPortfolios },
error: { function: renderNotFound },
};
let router = new Router(routes);
router.urlResolve();
function renderNotFound() {
main.innerHTML = `
<h1>404 | Not found</h1>
<a class="nav-btn" href="#">Return to home</a>`;
}