-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheaderAndFooter.js
More file actions
57 lines (50 loc) · 1.25 KB
/
headerAndFooter.js
File metadata and controls
57 lines (50 loc) · 1.25 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class HeaderAndFooter {
constructor(caption) {
this.caption = caption;
};
createHeader() {
let header = `
<header class="header">
<div class="container top-radius">
<h2>${this.caption}</h2>
</div>
</header>
`;
return header;
};
renderLink({href, icon}) {
return `
<a href="${href}" class="tab ${href}">
<span class="glyphicon glyphicon-${icon}" aria-hidden="true"></span>
<span class = "tab-text">${href}</span>
</a>
`;
};
createFooter() {
return `
<footer class="footer">
<div class="container bottom-radius">
<nav class="main-nav">
${ this.renderLink({ href:'Contacts', icon: 'search' }) }
${ this.renderLink({ href:'Keypad', icon: 'th' }) }
${ this.renderLink({ href:'Edit contact', icon: 'pencil' }) }
${ this.renderLink({ href:'User', icon: 'user' }) }
${ this.renderLink({ href:'Add user', icon: 'plus' }) }
</nav>
<div>
</footer>
`;
};
createMain() {
return `
<main class="main">
<div class="container">
</div>
</main>
`;
};
renderTemplate() {
document.body.innerHTML = this.createHeader() + this.createMain() + this.createFooter();
};
};
export default HeaderAndFooter;