tic-tac-toe/views/index.html

57 lines
1.4 KiB
HTML
Raw Normal View History

2023-12-29 11:42:21 +00:00
{{define "head"}}
<style>
.main-content {
margin: 20px;
width: 450px;
display: grid;
grid-template-columns: 150px 150px 150px;
grid-template-rows: 150px 150px 150px;
column-gap: 0;
row-gap: 0;
background-color: #eeb;
}
.tt-item {
display: inline-block;
width: 150px;
height: 150px;
}
.bb { border-bottom: 5px solid #333; }
.bt { border-top: 5px solid #333; }
.bl { border-left: 5px solid #333; }
.br { border-right: 5px solid #333; }
2023-12-29 16:22:54 +00:00
.cross { background-image: url('/cross.png'); }
.nought { background-image: url('/nought.png'); }
.line.cross {
background-color: #f88;
border: 2px solid #f33;
}
.line.nought {
background-color: #aaf;
border: 2px solid #33f;
}
2023-12-29 11:42:21 +00:00
</style>
{{end}}
{{define "content"}}
<div class="main-content">
2023-12-29 16:22:54 +00:00
{{ $Game := .game }}
{{ $GameFlow := .gameFlow }}
{{ range .fields }}
{{ if call $.disabled $Game . }}
<span class="{{ call $.fieldClass $Game . }}"></span>
{{ else }}
<a class="{{ call $.fieldClass $Game . }}" href="{{ $GameFlow -}}{{- . }}"></a>
{{ end }}
{{ end }}
2023-12-29 11:42:21 +00:00
</div>
<b>Game:</b> {{.gameFlow}}
{{end}}