-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender.mjs
More file actions
39 lines (33 loc) · 709 Bytes
/
render.mjs
File metadata and controls
39 lines (33 loc) · 709 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import "./utils.mjs";
const navs = ["HOME", "POSTS", "GALLERY", "MUSIC", "FRIENDS", "ABOUT"];
const style = css`
& {
display: flex;
justify-content: center;
gap: 10px;
}
& > div:hover {
cursor: pointer;
background-color: lightblue;
}
`;
const handle = (that) => {
that.addEventListener("click", ({ target }) =>
alert(target.closest("[link]")?.textContent || "Not Found")
);
};
const item = (e) => html`<div link>${e}</div>`;
const Header = () =>
html`<header>
<${style} />
<${navs.map(item)} />
<${handle} />
</header>`;
export default () => html`<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<${Header()} />
</body>
</html>`;