forked from WebReflection/hyperHTML
-
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.
- Loading branch information
Andrea Giammarchi
committed
Apr 10, 2019
1 parent
ee3a3ea
commit 9b64d25
Showing
7 changed files
with
92 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<script src="../index.js"></script> | ||
<script> | ||
const {bind, wire} = hyperHTML; | ||
todo(document.body); | ||
function todo(node, items = []) { | ||
let texts = ['a', 'b']; | ||
bind(node)` | ||
<svg width="200" height="200"> | ||
<g class="foo"> | ||
${texts.map((t, i) => wire(null, `svg:${i}`)` | ||
<rect x=${20 * i} y="35" width=10 height=10 class=${t}></rect> | ||
</g>`)} | ||
</svg>`; | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.