diff --git a/web/pages/games/games.go b/web/pages/games/games.go new file mode 100644 index 0000000..2edfac8 --- /dev/null +++ b/web/pages/games/games.go @@ -0,0 +1,89 @@ +package games + +import ( + "net/http" + + "dofdev/tem" + + "github.com/gorilla/mux" +) + +type Game struct { + Name string + Desc string + + Notes string +} + +var Games = map[string]Game{ + "silo": { + Name: "stretch silo", + Desc: "a stretch cursor 360 missile defense game", + Notes: `start with air raid sirens +and shouted commands +shilouttes in the night +(fight or flight - adrenaline) + +walk into futuristic vector battlestation +(step up buckle down) + +overview of your silos and what you are protecting +missiles fly in +(take responsibility) + + +*ref typhon missile system`, + }, + "snake": { + Name: "snake in a box", + Desc: "vr snake zencore", + Notes: `cute happy go lucky eating stuff + +older and bigger +and have to deal with your past choices`, + }, + "vien": { + Name: "vien", + Desc: "hordiculture", + }, +} + +func Handler(w http.ResponseWriter, r *http.Request) { + data := struct { + Games map[string]Game + }{ + Games: Games, + } + tem.Render( + w, r, + "games.html", + "games", + "dof driven games", + data, + ) +} + +func GameHandler(w http.ResponseWriter, r *http.Request) { + hash := mux.Vars(r)["hash"] + + game, ok := Games[hash] + if !ok { + w.WriteHeader(http.StatusNotFound) + return + } + + data := struct { + Hash string + Game Game + }{ + Hash: hash, + Game: game, + } + tem.Render( + w, r, + "game.html", + game.Name, + game.Desc, + data, + ) +}