diff options
| -rw-r--r-- | net/net.go | 7 | ||||
| -rw-r--r-- | static/styles.css | 25 | ||||
| -rw-r--r-- | templates/base.html | 1 | ||||
| -rw-r--r-- | templates/bingo.html | 6 |
4 files changed, 34 insertions, 5 deletions
@@ -17,12 +17,12 @@ func errLog(w http.ResponseWriter, err error, logInfo string, httpInfo string) { func game(w http.ResponseWriter, req *http.Request) { game := bingo.Game{ - Length: 3, + Length: 5, FreeSquare: false, } - tiles := make([]bingo.Tile, 9) - for i := range 9 { + tiles := make([]bingo.Tile, 25) + for i := range 25 { tiles[i].Text = fmt.Sprintf("Tile %d", i) } @@ -76,6 +76,7 @@ func NewMux() *http.ServeMux { mux.Handle("GET /", http.HandlerFunc(home)) mux.Handle("GET /bingo", http.HandlerFunc(game)) + mux.Handle("GET /static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) return mux } diff --git a/static/styles.css b/static/styles.css new file mode 100644 index 0000000..9102d3b --- /dev/null +++ b/static/styles.css @@ -0,0 +1,25 @@ +main { + display: flex; + flex-direction: column; + align-items: center; +} + +.bingoCard { + height: 90vh; + width: 80vw; + border: 0.5em solid black; +} + +.bingoTile { + font-size: 24pt; + border: 2pt double green; + text-align: center; +} + +.bingoTile:hover:not(.locked) { + border-color: red; +} + +.bingoTile:active:not(.locked) { + border-color: blue; +}
\ No newline at end of file diff --git a/templates/base.html b/templates/base.html index d263063..94878a2 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,6 +4,7 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>{{ block "title" . }}Bingo Factory{{ end }}</title> + <link rel="stylesheet" href="/static/styles.css"> </head> <body> {{ template "content" . }} diff --git a/templates/bingo.html b/templates/bingo.html index e00543c..1305b9a 100644 --- a/templates/bingo.html +++ b/templates/bingo.html @@ -1,11 +1,12 @@ {{ define "title" }}Bingo{{ end }} {{ define "content" }} -<table> +<main> +<table class="bingoCard"> <tbody> {{ range .Rows }} <tr> {{ range . }} - <td class="{{ if .Checked }}checked{{ end }} {{ if not .Checkable }}locked{{ end }}">{{ .Text }}</td> + <td class="bingoTile {{ if .Checked }}checked{{ end }} {{ if not .Checkable }}locked{{ end }}">{{ .Text }}</td> {{ end }} </tr> {{ else }} @@ -13,4 +14,5 @@ {{ end }} </tbody> </table> +</main> {{ end }} |
