Add small versions of role art to description modal

This commit is contained in:
Alec Maier
2019-09-13 18:57:59 -04:00
parent 1e69bfe5b7
commit 0060f6372a
12 changed files with 19 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 967 B

View File

@@ -2,6 +2,7 @@ import {cards} from './cards.js'
import {utility} from './util.js'
const socket = io();
const finishedArtArray = ["Villager", "Werewolf", "Seer", "Shadow", "Hunter", "Mason", "Minion"];
// important declarations
class Card {
@@ -45,9 +46,16 @@ window.onload = function() {
// put card info in the informational role description modal
const modalRole = document.createElement("div");
modalRole.setAttribute("class", "modal-role");
modalRole.innerHTML = cards[i].team === "good" ?
"<h2 class='role-village'>" + cards[i].role + "</h2><p>" + cards[i].team + "</p><p>" + cards[i].description + "</p>"
: "<h2 class='role-wolf'>" + cards[i].role + "</h2><p>" + cards[i].team + "</p><p>" + cards[i].description + "</p>";
const roleClass = cards[i].team === "good" ? "role-village" : "role-wolf";
const roleImage = finishedArtArray.includes(cards[i].role) ?
"<img alt='No art' src='/assets/images/roles-small/" + cards[i].role + ".png' />"
: "<span>Art soon.</span>";
modalRole.innerHTML =
"<h2 class='" + roleClass + "'>" + cards[i].role + "</h2>" +
roleImage +
"<p>" + cards[i].team + "</p>" +
"<p>" + cards[i].description + "</p>";
document.getElementById("roles").appendChild(modalRole);
fullDeck.push(newCard);

View File

@@ -784,6 +784,7 @@ label {
.modal-role {
width: 22em;
position: relative;
}
.modal-role p:first-of-type {
@@ -795,6 +796,13 @@ label {
margin-bottom: 0;
}
.modal-role img {
position: absolute;
top: 8px;
left: 110px;
width: 65px;
}
.modal {
position: fixed;
z-index: 1;