From 230cf732070b49844e06976a2c88534c36e5fae8 Mon Sep 17 00:00:00 2001 From: Alec Maier Date: Sun, 19 Apr 2020 15:59:37 -0400 Subject: [PATCH] Added faq page, indicator for wolf roles --- server.js | 4 ++++ static/cards.js | 2 +- static/setup.js | 3 ++- static/styles.css | 49 +++++++++++++++++++++++++++++++++++++----- views/create_game.html | 16 +++++++++----- views/faq.html | 26 ++++++++++++++++++++++ views/index.html | 3 +++ 7 files changed, 91 insertions(+), 12 deletions(-) create mode 100644 views/faq.html diff --git a/server.js b/server.js index bd01f36..786d8f1 100644 --- a/server.js +++ b/server.js @@ -41,6 +41,10 @@ app.get('/learn', function(request, response) { response.sendFile(__dirname + '/views/learn.html'); }); +app.get('/faq', function(request, response) { + response.sendFile(__dirname + '/views/faq.html'); +}); + app.get('/create', function(request, response) { response.sendFile(__dirname + '/views/create_game.html'); }); diff --git a/static/cards.js b/static/cards.js index 7c07a31..0f64861 100644 --- a/static/cards.js +++ b/static/cards.js @@ -14,7 +14,7 @@ export let cards = [ { role: "Dream Wolf", team: "evil", - description: "If a Werewolf dies, you become a Werewolf. You do not wake up with the Werewolves until this happens.", + description: "If a Werewolf dies, you become a Werewolf. You do not wake up with the Werewolves until this happens. You count for parity only after converting to a wolf.", isTypeOfWerewolf: false }, { diff --git a/static/setup.js b/static/setup.js index b64b64d..c28238a 100644 --- a/static/setup.js +++ b/static/setup.js @@ -90,7 +90,8 @@ function renderAvailableCards() { const quantityClass = cards[i].team === "good" ? "card-quantity quantity-village" : "card-quantity quantity-wolf"; - cardContainer.setAttribute("class", "card"); + let cardClass = newCard.isTypeOfWerewolf ? "card card-werewolf" : "card"; + cardContainer.setAttribute("class", cardClass); cardContainer.setAttribute("id", "card-" + i); cardContainer.innerHTML = "
" + diff --git a/static/styles.css b/static/styles.css index 3ba451d..b4b224c 100644 --- a/static/styles.css +++ b/static/styles.css @@ -67,7 +67,7 @@ margin-right: 2em; } - #learn-container { + #learn-container, #faq-container { margin: 3em 1em; } @@ -170,7 +170,7 @@ width: 80%; } - #learn-container { + #learn-container, #faq-container { margin: 3em; } @@ -255,6 +255,16 @@ } +@media(max-width: 850px) { + #card-select-header span:nth-child(2) { + flex-direction: column; + } + + #card-select-header span:nth-child(2) > div { + margin: 0.5em 0; + } +} + @media(max-width: 1225px) and (min-width: 750.01px) { #custom-card-modal .modal-content, #edit-custom-roles-modal .modal-content { width: 75%; @@ -478,6 +488,10 @@ button { user-select: none; } +.card-werewolf { + border: 1px solid red; +} + .custom-card { border: 1px dashed whitesmoke; background-color: transparent; @@ -645,6 +659,12 @@ button { animation-delay: 0.2s; } +#main-buttons a:nth-child(4) { + animation: fadein 0.3s ease-in; + animation-fill-mode: backwards; + animation-delay: 0.3s; +} + #main-buttons button { width: 100%; padding: 1.2em; @@ -662,10 +682,21 @@ button { display: flex; width: 100%; justify-content: center; - margin-bottom: 1em; + align-items: flex-start; + margin-bottom: 0.5em; flex-direction: column; } +#card-select-header a { + text-decoration: underline; + color: #b8c4ff; +} + +#card-select-header span > div { + display: flex; + align-items: center; +} + #card-select-header h3 { margin: 0; font-size: 1.2em; @@ -750,6 +781,14 @@ button { animation: slide-fade 0.5s; } +#create-game-container #werewolf-key { + width: 25px; + height: 25px; + border: 1px solid red; + border-radius: 3px; + margin-right: 10px; +} + #join-game-container { display: flex; @@ -1262,13 +1301,13 @@ label { color: #bd2a2a; } -#learn-container h2 { +#learn-container h2, #faq-container h2 { font-family: 'diavlo', sans-serif; color: #bd2a2a; font-size: 40px; } -#learn-container button { +#learn-container button, #faq-container button { margin-top: 1em; } diff --git a/views/create_game.html b/views/create_game.html index e3b5bb7..7b434aa 100644 --- a/views/create_game.html +++ b/views/create_game.html @@ -48,7 +48,7 @@
- +
@@ -80,10 +80,16 @@ -

0 Players

- +
+

0 Players

+ +
+
+
+
= Werewolf role (counts for parity)
+

diff --git a/views/faq.html b/views/faq.html new file mode 100644 index 0000000..9e861dd --- /dev/null +++ b/views/faq.html @@ -0,0 +1,26 @@ + + + + + Title + + + + + + +
+ +

FAQ

+
+

What is Parity?

+

Parity means equal, and in the context of the game, this refers to an equal number of wolves and villagers. + This is a victory condition for the wolves, because if at any time during the day parity is reached, it is certain that the wolves + will be able to kill all the remaining villagers. Thus, if a standard or custom role is marked as a Werewolf, it will be considered + when the game determines if parity has been reached. +

+
+
+ + + diff --git a/views/index.html b/views/index.html index 348d391..e2ddd0a 100644 --- a/views/index.html +++ b/views/index.html @@ -24,6 +24,9 @@ + + +