Fix chat joke speaker attribution and add more jokes
This commit is contained in:
parent
ba9a3924d2
commit
fbdfaf8cc0
1 changed files with 51 additions and 28 deletions
79
script.js
79
script.js
|
|
@ -31,33 +31,55 @@
|
||||||
|
|
||||||
var chat = document.querySelector('.mock-chat');
|
var chat = document.querySelector('.mock-chat');
|
||||||
if (chat) {
|
if (chat) {
|
||||||
var names = ['Sam', 'Ruth', 'Kai', 'Milo', 'Jules', 'Bea', 'Ollie', 'Finn', 'Pip', 'Nora'];
|
var names = ['Sam', 'Ruth', 'Kai', 'Milo', 'Jules', 'Bea', 'Ollie', 'Finn', 'Pip', 'Nora', 'Leo', 'Ada'];
|
||||||
|
// Each convo: [speakerIndex, message] x3. speakerIndex 0-2 maps to chosen names.
|
||||||
var convos = [
|
var convos = [
|
||||||
["Knock, knock!", "Who's there?", "Lettuce. Lettuce who? Lettuce in, it's cold out here!"],
|
// knock-knock (joker=0, responder=1, joker=0)
|
||||||
["Knock, knock!", "Who's there?", "Cow says. Cow says who? No silly, cow says moo!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Lettuce. Lettuce who? Lettuce in, it's cold out here!"]],
|
||||||
["Knock, knock!", "Who's there?", "Tank. Tank who? You're welcome!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Cow says. Cow says who? No silly, cow says moo!"]],
|
||||||
["Knock, knock!", "Who's there?", "Alpaca. Alpaca who? Alpaca the snacks, you grab the map!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Tank. Tank who? You're welcome!"]],
|
||||||
["Knock, knock!", "Who's there?", "Dishes. Dishes who? Dishes the police, open up!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Alpaca. Alpaca who? Alpaca the snacks, you grab the map!"]],
|
||||||
["Knock, knock!", "Who's there?", "Cargo. Cargo who? Cargo beep beep, vroom vroom!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Dishes. Dishes who? Dishes the police, open up!"]],
|
||||||
["Why did the scarecrow get promoted?", "No idea, why?", "He was outstanding in his field!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Cargo. Cargo who? Cargo beep beep, vroom vroom!"]],
|
||||||
["I'm reading a book on anti-gravity.", "Oh yeah? How is it?", "Impossible to put down!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Nobel. Nobel who? Nobel, that's why I knocked!"]],
|
||||||
["What do you call a fake noodle?", "Hmm... I give up.", "An impasta!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Butter. Butter who? Butter open the door, it's chilly!"]],
|
||||||
["Why don't eggs tell jokes?", "Why not?", "They'd crack each other up!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Etch. Etch who? Bless you!"]],
|
||||||
["Did you hear about the claustrophobic astronaut?", "Oh no, what happened?", "He just needed a little space."],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Ketchup. Ketchup who? Ketchup with me and I'll tell you!"]],
|
||||||
["What do you call cheese that isn't yours?", "What?", "Nacho cheese!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Owls say. Owls say who? Yep, they sure do!"]],
|
||||||
["Why did the bicycle fall over?", "Why?", "It was two-tired!"],
|
[[0,"Knock, knock!"], [1,"Who's there?"], [0,"Annie. Annie who? Annie thing you can do, I can do better!"]],
|
||||||
["I used to play piano by ear.", "Really? That's impressive!", "Now I use my hands, it's much easier."],
|
// dad jokes / banter (2 people)
|
||||||
["What did the ocean say to the beach?", "What did it say?", "Nothing, it just waved!"],
|
[[0,"Why did the scarecrow get promoted?"], [1,"No idea, why?"], [0,"He was outstanding in his field!"]],
|
||||||
["Why can't you trust stairs?", "Tell me.", "They're always up to something."],
|
[[0,"I'm reading a book on anti-gravity."], [1,"Oh yeah? How is it?"], [0,"Impossible to put down!"]],
|
||||||
["What do you call a bear with no teeth?", "A what?", "A gummy bear!"],
|
[[0,"What do you call a fake noodle?"], [1,"Hmm... I give up."], [0,"An impasta!"]],
|
||||||
["I'm afraid for the calendar.", "Why's that?", "Its days are numbered."],
|
[[0,"Why don't eggs tell jokes?"], [1,"Why not?"], [0,"They'd crack each other up!"]],
|
||||||
["What do you call a fish with no eyes?", "I don't know...", "A fsh!"],
|
[[0,"Did you hear about the claustrophobic astronaut?"], [1,"Oh no, what happened?"], [0,"He just needed a little space."]],
|
||||||
["Why did the math book look so sad?", "Poor thing, why?", "It had too many problems."],
|
[[0,"What do you call cheese that isn't yours?"], [1,"What?"], [0,"Nacho cheese!"]],
|
||||||
["I told my computer I needed a break.", "What did it say?", "Nothing, it just went to sleep."],
|
[[0,"Why did the bicycle fall over?"], [1,"Why?"], [0,"It was two-tired!"]],
|
||||||
["Anyone want to hear a construction joke?", "Sure!", "Never mind, I'm still working on it."],
|
[[0,"What did the ocean say to the beach?"], [1,"What did it say?"], [0,"Nothing, it just waved!"]],
|
||||||
["I made a belt out of watches.", "And?", "It was a waist of time."],
|
[[0,"Why can't you trust stairs?"], [1,"Tell me."], [0,"They're always up to something."]],
|
||||||
["Why do cows have hooves instead of feet?", "Why?", "Because they lactose!"],
|
[[0,"What do you call a bear with no teeth?"], [1,"A what?"], [0,"A gummy bear!"]],
|
||||||
["What do you call a dog that can do magic?", "What?", "A Labracadabrador!"]
|
[[0,"I'm afraid for the calendar."], [1,"Why's that?"], [0,"Its days are numbered."]],
|
||||||
|
[[0,"What do you call a fish with no eyes?"], [1,"I don't know..."], [0,"A fsh!"]],
|
||||||
|
[[0,"Why did the math book look so sad?"], [1,"Poor thing, why?"], [0,"It had too many problems."]],
|
||||||
|
[[0,"I made a belt out of watches."], [1,"And...?"], [0,"It was a waist of time."]],
|
||||||
|
[[0,"Why do cows have hooves instead of feet?"], [1,"Why?"], [0,"Because they lactose!"]],
|
||||||
|
[[0,"What do you call a dog that can do magic?"], [1,"What?"], [0,"A Labracadabrador!"]],
|
||||||
|
[[0,"Why don't scientists trust atoms?"], [1,"Why?"], [0,"Because they make up everything!"]],
|
||||||
|
[[0,"What do you call a sleeping dinosaur?"], [1,"I dunno."], [0,"A dino-snore!"]],
|
||||||
|
[[0,"Why did the golfer bring two pairs of pants?"], [1,"Just in case...?"], [0,"In case he got a hole in one!"]],
|
||||||
|
[[0,"What do you call a pile of cats?"], [1,"What?"], [0,"A meowtain!"]],
|
||||||
|
[[0,"I used to be a baker."], [1,"Oh really?"], [0,"Yeah, but I couldn't make enough dough."]],
|
||||||
|
// 3-person chats
|
||||||
|
[[0,"What do you call a factory that makes okay products?"], [1,"I don't know, what?"], [2,"A satisfactory!"]],
|
||||||
|
[[0,"I just got a job at the orange juice factory."], [1,"Nice! How is it?"], [2,"I heard he got fired because he couldn't concentrate."]],
|
||||||
|
[[0,"Why did the cookie go to the doctor?"], [1,"Why?"], [2,"Because it was feeling crummy!"]],
|
||||||
|
[[0,"I'm on a seafood diet."], [1,"Oh, how's that going?"], [2,"He sees food and eats it. Every time."]],
|
||||||
|
[[0,"Did you hear about the restaurant on the moon?"], [1,"No, what about it?"], [2,"Great food, no atmosphere!"]],
|
||||||
|
[[0,"What do you call a can opener that doesn't work?"], [1,"Uhh..."], [2,"A can't opener!"]],
|
||||||
|
[[0,"I told my dog a joke about fetch."], [1,"Did he laugh?"], [2,"Nah, tough crowd. He just gave you a ruff look."]],
|
||||||
|
[[0,"Why do seagulls fly over the sea?"], [1,"Why?"], [2,"Because if they flew over the bay, they'd be bagels!"]],
|
||||||
|
[[0,"What do sprinters eat before a race?"], [1,"Bananas?"], [2,"Nothing, they fast!"]],
|
||||||
|
[[0,"I asked the librarian if the library had books on paranoia."], [1,"And?"], [2,"She whispered, 'They're right behind you...'"]]
|
||||||
];
|
];
|
||||||
function pick(arr) {
|
function pick(arr) {
|
||||||
return arr[Math.floor(Math.random() * arr.length)];
|
return arr[Math.floor(Math.random() * arr.length)];
|
||||||
|
|
@ -75,9 +97,10 @@
|
||||||
var avs = ['av-a', 'av-b', 'av-c'];
|
var avs = ['av-a', 'av-b', 'av-c'];
|
||||||
var html = '';
|
var html = '';
|
||||||
for (var k = 0; k < 3; k++) {
|
for (var k = 0; k < 3; k++) {
|
||||||
|
var speaker = convo[k][0];
|
||||||
html += '<div class="msg msg-' + (k + 1) + '">' +
|
html += '<div class="msg msg-' + (k + 1) + '">' +
|
||||||
'<span class="av ' + avs[k] + '"></span>' +
|
'<span class="av ' + avs[speaker] + '"></span>' +
|
||||||
'<div><b>' + chosenNames[k] + '</b><p>' + convo[k] + '</p></div>' +
|
'<div><b>' + chosenNames[speaker] + '</b><p>' + convo[k][1] + '</p></div>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
}
|
}
|
||||||
html += '<div class="typing"><span></span><span></span><span></span></div>';
|
html += '<div class="typing"><span></span><span></span><span></span></div>';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue