Skip to content

Commit

Permalink
Add newline support to cards, updated some packs and added a config s…
Browse files Browse the repository at this point in the history
…ystem so that the server host can change settings
  • Loading branch information
AntonUden committed May 25, 2023
1 parent d952fa2 commit e2660af
Show file tree
Hide file tree
Showing 213 changed files with 29,349 additions and 29,292 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ Thumbs.db
dist/**/*

# ignore yarn.lock
yarn.lock
yarn.lock
config/config.json
6 changes: 3 additions & 3 deletions client/js/game.frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function handleVotingStart(data) {

cardHtml.removeAttr("id");
cardHtml.find(".selected-card-number").remove(); // Remove badge that we dont need here
cardHtml.find(".card-text-content").html(card.text);
cardHtml.find(".card-text-content").html(card.text.replace(/\n/g, "<br>"));
cardHtml.addClass("played-white-card");

if (activeGame.settings.showCardPack) {
Expand Down Expand Up @@ -452,7 +452,7 @@ function handleGameState(data) {
let blackCard = activeGame.black_card;

$("#black_card_pick").text("pick " + blackCard.pick);
$("#black_card_text").html(blackCard.text);
$("#black_card_text").html(blackCard.text.replace(/\n/g, "<br>"));

if (activeGame.settings.showCardPack) {
console.debug("Black card is from " + activeGame.black_card.deck_name);
Expand Down Expand Up @@ -621,7 +621,7 @@ function handleGameState(data) {
newHtml.addClass("player-hand-card");

newHtml.find(".selected-card-number").hide();
newHtml.find(".card-text-content").html(card.text);
newHtml.find(".card-text-content").html(card.text.replace(/\n/g, "<br>"));

if (activeGame.settings.showCardPack) {
newHtml.attr("title", "This card is from " + card.deck_name);
Expand Down
10 changes: 5 additions & 5 deletions decks/collections.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"display_name": "Pretend You're Xyzzy",
"description": "These packs where taken from here <a href=\"https://pretendyoure.xyz/zy/\">https://pretendyoure.xyz/zy/</a>"
},
{
"name": "json-against-humanity",
"display_name": "JSON Against humanity",
"description": "These packs where taken from here <a href=\"https://crhallberg.com/cah/\">https://crhallberg.com/cah/</a>"
},
{
"name": "nodejs-against-humanity",
"display_name": "NodeJS Against humanity",
"description": "These packs where taken from here <a href=\"https://github.com/amirrajan/nodejs-against-humanity\">https://github.com/amirrajan/nodejs-against-humanity</a>"
},
{
"name": "crhallberg",
"display_name": "crhallberg",
"description": "These packs where taken from here <a href=\"https://crhallberg.com/cah/\">https://crhallberg.com/cah/</a>"
},
{
"name": "misc",
"display_name": "Other",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
{
"order": 1,
"filename": "json_2012HolidayPack",
"name": "2012 Holiday Pack",
"filename": "2012_Holiday_Pack",
"black_cards": [
{
"text": "After blacking out during New Year's Eve, I was awoken by _.",
"pick": 1
},
{
"text": "Every Christmas, my uncle gets drunk and tells the story about _.",
"pick": 1
},
{
"text": "Jesus is _.",
"pick": 1
},
{
"text": "On the third day of Christmas, my true love gave to me: three French hens, two turtle doves, and _.",
"pick": 1
},
{
"text": "This is a little embarrassing but I was wondering if you could recommend a doctor who specializes in _.",
"pick": 1
},
{
"text": "Wake up, America. Christmas is under attack by secular liberals and their _.",
"pick": 1
},
{
"text": "What keeps me warm during the cold, cold winter?",
"pick": 1
}
],
"white_cards": [
"A Christmas stocking full of coleslaw.",
"A Hungry-Man™ Frozen Christmas Dinner for One.",
Expand All @@ -26,35 +56,5 @@
"The Star Wars Holiday Special.",
"The tiny, calloused hands of the Chinese children that made this card.",
"Whatever Kwanzaa is supposed to be about."
],
"black_cards": [
{
"pick": 1,
"text": "After blacking out during New Year's Eve, I was awoken by _____."
},
{
"pick": 1,
"text": "Every Christmas, my uncle gets drunk and tells the story about _____."
},
{
"pick": 1,
"text": "Jesus is _____."
},
{
"pick": 1,
"text": "On the third day of Christmas, my true love gave to me: three French hens, two turtle doves, and _____."
},
{
"pick": 1,
"text": "This is a little embarrassing but I was wondering if you could recommend a doctor who specializes in _____."
},
{
"pick": 1,
"text": "Wake up, America. Christmas is under attack by secular liberals and their _____."
},
{
"pick": 1,
"text": "What keeps me warm during the cold, cold winter?"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,45 @@
{
"order": 2,
"filename": "json_2013HolidayPack",
"name": "2013 Holiday Pack",
"filename": "2013_Holiday_Pack",
"black_cards": [
{
"text": "Because they are forbidden from masturbating, Mormons channel their repressed sexual energy into _.",
"pick": 1
},
{
"text": "Blessed are you, Lord our God, creator of the universe, who has granted us _.",
"pick": 1
},
{
"text": "But wait, there's more! If you order _ in the next 15 minutes, we'll throw in _ absolutely free!",
"pick": 2
},
{
"text": "GREETINGS HUMANS\nI AM _ BOT\nEXECUTING PROGRAM.",
"pick": 1
},
{
"text": "Heroin: a proud supporter of _.",
"pick": 1
},
{
"text": "I really hope my grandma doesn't ask me to explain _ again.",
"pick": 1
},
{
"text": "Kids these days with their iPods and their Internet. In my day, all we needed to pass the time was _.",
"pick": 1
},
{
"text": "Revealed: Why He Really Resigned! Pope Benedict's Secret Struggle with _.",
"pick": 1
},
{
"text": "What's the only thing sexier than confidence?",
"pick": 1
}
],
"white_cards": [
"A magical tablet containing a world of unlimited pornography.",
"A simultaneous nightmare and wet dream starring Sigourney Weaver.",
Expand All @@ -24,43 +62,5 @@
"The royal afterbirth.",
"The shittier, Jewish version of Christmas.",
"These low, low prices!"
],
"black_cards": [
{
"pick": 1,
"text": "Because they are forbidden from masturbating, Mormons channel their repressed sexual energy into _____."
},
{
"pick": 1,
"text": "Blessed are you, Lord our God, creator of the universe, who has granted us _____."
},
{
"pick": 2,
"text": "But wait, there's more! If you order _____ in the next 15 minutes, we'll throw in _____ absolutely free!"
},
{
"pick": 1,
"text": "GREETINGS HUMANS\nI AM _____ BOT\nEXECUTING PROGRAM."
},
{
"pick": 1,
"text": "Heroin: a proud supporter of _____."
},
{
"pick": 1,
"text": "I really hope my grandma doesn't ask me to explain _____ again."
},
{
"pick": 1,
"text": "Kids these days with their iPods and their Internet. In my day, all we needed to pass the time was _____."
},
{
"pick": 1,
"text": "Revealed: Why He Really Resigned! Pope Benedict's Secret Struggle with _____."
},
{
"pick": 1,
"text": "What's the only thing sexier than confidence?"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
{
"order": 3,
"filename": "json_2014HolidayPack",
"name": "2014 Holiday Pack",
"filename": "2014_Holiday_Pack",
"black_cards": [
{
"text": "A curse upon thee! Many years from now, just when you think you're safe, _ shall turn into _.",
"pick": 2
},
{
"text": "Behold the Four Horsemen of the Apocalypse! War, Famine, Death, and _.",
"pick": 1
},
{
"text": "Dear Mom and Dad, Camp is fun. I like capture the flag. Yesterday, one of the older kids taught me about _. I love you, Casey",
"pick": 1
},
{
"text": "Here lies First Last, Year-2015, devoted friend, lover of _.",
"pick": 1
},
{
"text": "Honey, Mommy and Daddy love you very much. But apparently Mommy loves _ more than she loves Daddy.",
"pick": 1
},
{
"text": "Today on Buzzfeed: 10 pictures of _ That look like _!",
"pick": 2
},
{
"text": "Why am I so tired?",
"pick": 1
}
],
"white_cards": [
"200 years of slavery.",
"A cloud of ash that darkens the Earth for a thousand years.",
Expand All @@ -27,35 +57,5 @@
"This groovy new thing called LSD.",
"Trying to feel something, anything.",
"What remains of my penis."
],
"black_cards": [
{
"pick": 2,
"text": "A curse upon thee! Many years from now, just when you think you're safe, _____ shall turn into _____."
},
{
"pick": 1,
"text": "Behold the Four Horsemen of the Apocalypse! War, Famine, Death, and _____."
},
{
"pick": 1,
"text": "Dear Mom and Dad, Camp is fun. I like capture the flag. Yesterday, one of the older kids taught me about _____. I love you, Casey"
},
{
"pick": 1,
"text": "Here lies First Last, Year-2015, devoted friend, lover of _____."
},
{
"pick": 1,
"text": "Honey, Mommy and Daddy love you very much. But apparently Mommy loves _____ more than she loves Daddy."
},
{
"pick": 2,
"text": "Today on Buzzfeed: 10 pictures of _____ That look like _____!"
},
{
"pick": 1,
"text": "Why am I so tired?"
}
]
}
Loading

0 comments on commit e2660af

Please sign in to comment.