parent
18314b65c5
commit
3c5b876ebd
2 changed files with 34 additions and 12 deletions
@ -1,12 +1,28 @@ |
|||||||
<!DOCTYPE html> |
<!DOCTYPE html> |
||||||
<html><head><title>Spring83</title> |
<html><head><title>Spring83</title> |
||||||
|
<style> |
||||||
|
.board { |
||||||
|
border: 1px solid black; |
||||||
|
margin: 10px; |
||||||
|
} |
||||||
|
</style> |
||||||
|
<script> |
||||||
|
window.addEventListener("DOMContentLoaded", (_evt) => { |
||||||
|
const boards = {{.Boards}} |
||||||
|
const divs = boards.map(board => { |
||||||
|
return `<div id="b${board.Key}" class="board"></div>\n` |
||||||
|
}); |
||||||
|
document.querySelector("#containers").innerHTML = divs.join("\n"); |
||||||
|
boards.forEach(board => { |
||||||
|
const container = document.querySelector(`#b${board.Key}`); |
||||||
|
const shadow = container.attachShadow({mode: 'closed'}); |
||||||
|
shadow.innerHTML = board.Board; |
||||||
|
}); |
||||||
|
}); |
||||||
|
</script> |
||||||
</head> |
</head> |
||||||
<body> |
<body> |
||||||
{{range $i, $board := .Boards}} |
<div id="containers"> |
||||||
{{if $i}} |
</div> |
||||||
<hr> |
|
||||||
{{end}} |
|
||||||
{{.Board}} |
|
||||||
{{end}} |
|
||||||
</body> |
</body> |
||||||
</html> |
</html> |
||||||
|
Loading…
Reference in new issue