diff --git a/html.go b/html.go index a0a2e1b..daf1169 100644 --- a/html.go +++ b/html.go @@ -19,6 +19,8 @@ func handlerRoot(w http.ResponseWriter, r *http.Request) { varmap := map[string]interface{}{ "matrice": Matrix, "tempoAggiorna": Clock, + "larghezza": Larghezza, + "altezza": Altezza, } templ.Execute(w, varmap) } diff --git a/template/Interfaccia.html b/template/Interfaccia.html index 8fe3176..aa42cf8 100644 --- a/template/Interfaccia.html +++ b/template/Interfaccia.html @@ -3,35 +3,45 @@ GoBug +

Go bug

-
- - {{range $riga := .matrice}} - - {{range $cella := $riga}} -
+
+ + {{range $riga := .matrice}} + + {{range $cella := $riga}} + + {{ if $cella.IsFood }} + class="cibo" + {{ else }} + class="razza1" + {{ end }} + {{ end }}>{{ $cella.Health }} + {{ end }} + {{ end }} - - {{ end }} -
{{ $cella }}
-
-
-
-

legenda

-
-

Food

-
-
-

Razza1

-
-
-

Razza2

+
- +
+

legenda

+
+
Cibo
+
+
Razza1
+
+
Razza2
+
+