-
Notifications
You must be signed in to change notification settings - Fork 0
/
navbar.js
75 lines (67 loc) · 1.32 KB
/
navbar.js
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
class PhysicsNavbar extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = /* HTML */ `
<nav>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<a href="/experiment-create.html">Create</a>
</li>
<li>
<a href="/explore.html">Explore</a>
</li>
<li>
<a href="/about.html">About</a>
</li>
<li>
<a href="/feedback.html">Feedback</a>
</li>
</ul>
</nav>
<!-- styles are scoped to the navbar -->
<style>
nav {
background-color: rgb(119, 119, 240);
}
ul {
display: flex;
justify-content: center;
list-style: none;
margin: 0;
padding: 0;
}
li {
/* padding: 1rem 1rem; */
}
li a {
color: white;
font-size: 1.5rem;
text-decoration: none;
font-family: 'Comfortaa', cursive;
display: block;
padding: 1rem 1rem;
}
li a:hover {
background-color: rgb(107, 107, 227);
}
@media only screen and (max-width: 768px) {
li a {
color: white;
font-size: 0.70rem;
text-decoration: none;
}
}
@media only screen and (max-width: 370px) {
li {
padding: 0 0.3rem;
}
}
</style>
`;
}
}
customElements.define("physics-navbar", PhysicsNavbar);