├── assets ├── topics │ ├── jobs.txt │ ├── school.txt │ ├── life after Sojo.txt │ ├── 3 things.txt │ ├── movies.txt │ ├── school 2.txt │ ├── 2 things.txt │ ├── Halloween.txt │ ├── random.txt │ ├── culture.txt │ ├── music.txt │ ├── art.txt │ ├── animals.txt │ ├── travel 2.txt │ ├── food.txt │ └── travel.txt ├── adminInfo │ └── adminInfo.txt ├── img │ ├── dice │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ └── 6.png │ ├── mic │ │ ├── mic_nor.png │ │ └── mic_rec.png │ ├── birds │ │ ├── birds-01.png │ │ ├── birds-02.png │ │ ├── birds-03.png │ │ └── birds-04.png │ ├── ani-gif │ │ ├── ani-cong.gif │ │ └── ani-star.gif │ ├── bg-img │ │ ├── background-01.png │ │ ├── background-02.png │ │ ├── background-03.png │ │ ├── background-04.png │ │ ├── background-05.png │ │ ├── background-06.png │ │ ├── background-07.png │ │ ├── background-08.png │ │ └── background-09.png │ └── card-img │ │ ├── card-img-01.png │ │ ├── card-img-02.png │ │ ├── card-img-03.png │ │ ├── card-img-04.png │ │ ├── card-img-05.png │ │ └── card-img-06.png ├── sound │ ├── Success_128.m4a │ ├── Success_128.mp3 │ ├── dice-sound.m4a │ ├── dice-sound.mp3 │ └── 1.html ├── css │ ├── admin.css │ ├── flip_style.css │ ├── dice_style.css │ ├── index_offline.css │ └── index.css └── js │ ├── dice.js │ ├── dice_offline.js │ ├── communication.js │ ├── WebAudioAPISound.js │ ├── admin.js │ ├── index_offline.js │ ├── index.js │ └── socket.io-1.2.0.js ├── buff.php ├── index.php ├── admin.php ├── topicManager.php ├── offline.php ├── student.php ├── online.php └── leader.php /assets/topics/jobs.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/adminInfo/adminInfo.txt: -------------------------------------------------------------------------------- 1 | admin admin -------------------------------------------------------------------------------- /assets/img/dice/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/dice/1.png -------------------------------------------------------------------------------- /assets/img/dice/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/dice/2.png -------------------------------------------------------------------------------- /assets/img/dice/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/dice/3.png -------------------------------------------------------------------------------- /assets/img/dice/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/dice/4.png -------------------------------------------------------------------------------- /assets/img/dice/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/dice/5.png -------------------------------------------------------------------------------- /assets/img/dice/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/dice/6.png -------------------------------------------------------------------------------- /assets/img/mic/mic_nor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/mic/mic_nor.png -------------------------------------------------------------------------------- /assets/img/mic/mic_rec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/mic/mic_rec.png -------------------------------------------------------------------------------- /assets/sound/Success_128.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/sound/Success_128.m4a -------------------------------------------------------------------------------- /assets/sound/Success_128.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/sound/Success_128.mp3 -------------------------------------------------------------------------------- /assets/sound/dice-sound.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/sound/dice-sound.m4a -------------------------------------------------------------------------------- /assets/sound/dice-sound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/sound/dice-sound.mp3 -------------------------------------------------------------------------------- /assets/img/birds/birds-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/birds/birds-01.png -------------------------------------------------------------------------------- /assets/img/birds/birds-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/birds/birds-02.png -------------------------------------------------------------------------------- /assets/img/birds/birds-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/birds/birds-03.png -------------------------------------------------------------------------------- /assets/img/birds/birds-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/birds/birds-04.png -------------------------------------------------------------------------------- /assets/img/ani-gif/ani-cong.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/ani-gif/ani-cong.gif -------------------------------------------------------------------------------- /assets/img/ani-gif/ani-star.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/ani-gif/ani-star.gif -------------------------------------------------------------------------------- /buff.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Online 4 | Offline 5 | -------------------------------------------------------------------------------- /assets/img/bg-img/background-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/bg-img/background-01.png -------------------------------------------------------------------------------- /assets/img/bg-img/background-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/bg-img/background-02.png -------------------------------------------------------------------------------- /assets/img/bg-img/background-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/bg-img/background-03.png -------------------------------------------------------------------------------- /assets/img/bg-img/background-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/bg-img/background-04.png -------------------------------------------------------------------------------- /assets/img/bg-img/background-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/bg-img/background-05.png -------------------------------------------------------------------------------- /assets/img/bg-img/background-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/bg-img/background-06.png -------------------------------------------------------------------------------- /assets/img/bg-img/background-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/bg-img/background-07.png -------------------------------------------------------------------------------- /assets/img/bg-img/background-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/bg-img/background-08.png -------------------------------------------------------------------------------- /assets/img/bg-img/background-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/bg-img/background-09.png -------------------------------------------------------------------------------- /assets/img/card-img/card-img-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/card-img/card-img-01.png -------------------------------------------------------------------------------- /assets/img/card-img/card-img-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/card-img/card-img-02.png -------------------------------------------------------------------------------- /assets/img/card-img/card-img-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/card-img/card-img-03.png -------------------------------------------------------------------------------- /assets/img/card-img/card-img-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/card-img/card-img-04.png -------------------------------------------------------------------------------- /assets/img/card-img/card-img-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/card-img/card-img-05.png -------------------------------------------------------------------------------- /assets/img/card-img/card-img-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangStar1031/Long-version-Board-game/HEAD/assets/img/card-img/card-img-06.png -------------------------------------------------------------------------------- /assets/topics/school.txt: -------------------------------------------------------------------------------- 1 | Have you ever been absent? 2 | Have you ever been late for class? 3 | Have you ever slept in class? 4 | How do you usually come here? 5 | How do you get to school? 6 | How long does it take you to get to school? 7 | How many times have you been absent from school this year? 8 | How much homework do you do every day? 9 | Was your high school strict? 10 | Were you on any sports teams in high school? 11 | What classes do you not like? 12 | What did you like best about high school? 13 | What do you like best about your school? 14 | -------------------------------------------------------------------------------- /assets/sound/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Looping Audio 4 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /assets/topics/life after Sojo.txt: -------------------------------------------------------------------------------- 1 | Do you want to get a credit card? 2 | Do you want to lose weight? 3 | Do you want to join a gym? 4 | Do you want to learn an instrument? 5 | Do you want to save money? 6 | Do you want to get a full-time job? 7 | Do you want to get a part-time job? 8 | Do you want to make more friends? 9 | Do you want to study harder? 10 | Do you want to start a new hobby? 11 | Do you want to get married? 12 | Do you want to travel? 13 | Do you want to get a license? 14 | Do you want to have children? 15 | Do you want to move to a different city? 16 | Do you want to buy a house? 17 | Do you want to buy a car? -------------------------------------------------------------------------------- /assets/topics/3 things.txt: -------------------------------------------------------------------------------- 1 | What are 3 things you can use water for? 2 | What can you eat for dinner? 3 | What are 3 Things that are naturally red! 4 | Words that begin with sun-? 5 | Words that begin with sp-? 6 | What are 3Types of transportation? 7 | Words that end in –ment? 8 | What are 3Things with a screen? 9 | Words that start with re-? 10 | What are 3 Kinds of trees? 11 | What are 3 kinds of Pets? 12 | What are 3 Things in the bathroom? 13 | What are 3 Circular things? 14 | What are 3 White things? 15 | What are 3 fruits? 16 | What are 3 hard things? 17 | What are 3 vegetables? 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /assets/topics/movies.txt: -------------------------------------------------------------------------------- 1 | What is your all-time favorite movie? 2 | What is your favorite movie? 3 | Are there any kinds of movies you dislike? 4 | Do you like to watch horror movies? 5 | How often do you go to movies? 6 | What is the best movie you have ever seen? 7 | What is the scariest movies you have ever seen? 8 | What was the last movie you saw? 9 | Which do you like better, action movies or comedy movies? 10 | What movie star would you most like to meet? 11 | What kind of movie do you like? 12 | Do you like documentaries? 13 | Who is your favorite movie hero? 14 | What do you think about comic books movies? 15 | Which do you prefer, comedy movies or horror movies? -------------------------------------------------------------------------------- /assets/topics/school 2.txt: -------------------------------------------------------------------------------- 1 | Do you have any classes on Monday? 2 | How many classes do you have? 3 | How often do you work? 4 | What time do you arrive at school? 5 | Are you looking for a part-time job? 6 | Do you go to the Speaking Center? 7 | How often do you study in the library? 8 | When do you exercise? 9 | Do you belong to any clubs? 10 | How many classes do you have on your busiest day? 11 | How long does it take to go home? 12 | Do you have a good GPA? 13 | When will you graduate? 14 | Do you want to move to a different city after you graduate? 15 | Want job do you want in the future? 16 | What is your favorite class? 17 | How can your college improve? 18 | 19 | -------------------------------------------------------------------------------- /assets/topics/2 things.txt: -------------------------------------------------------------------------------- 1 | What are 2 things you make? Why? 2 | What are 2 songs you can sing? Why? 3 | What are 2 games you can play? Why? 4 | What are 2 movies you like? Why? 5 | What are 2 things artists you like? Why? 6 | What are 2 sports you like? Why? 7 | What are 2 things you need? Why? 8 | What are 2 things you want to buy? Why? 9 | What are 2 places you want to go? Why? 10 | Who are 2 people you want to meet? Why? 11 | What are 2 stores you like? Why? 12 | What are 2 snacks you love? Why? 13 | What are 2 drinks you like? Why? 14 | What are 2 TV shows you like? Why? 15 | Who are 2 Youtubers you like? Why? 16 | What are 2 class you like? Why? 17 | What are 2 animals you like? Why? 18 | What are 2 seasons you like? Why? -------------------------------------------------------------------------------- /assets/css/admin.css: -------------------------------------------------------------------------------- 1 | table{ 2 | text-align: center; 3 | margin: auto; 4 | } 5 | .adminPanel{ 6 | width: 1100px; 7 | text-align: center; 8 | margin: auto; 9 | } 10 | .Show{ 11 | display: block; 12 | } 13 | .Hidden{ 14 | display: none; 15 | } 16 | .customList{ 17 | float: left; 18 | } 19 | .topicList, .questionList{ 20 | font-size: 1.5em; 21 | padding: 0.2em; 22 | width: 200px; 23 | height: 400px 24 | } 25 | .questionList{ 26 | width: 800px; 27 | height: 400px; 28 | line-height: 1.5em; 29 | } 30 | .topicContainer, .questionContainer{ 31 | float: left; 32 | margin-left: 20px; 33 | 34 | } 35 | span{ 36 | top: 20px; 37 | position: relative; 38 | margin: 10px; 39 | cursor: pointer; 40 | background-color: chartreuse; 41 | border-radius: 10px; 42 | padding: 5px; 43 | 44 | } -------------------------------------------------------------------------------- /assets/topics/Halloween.txt: -------------------------------------------------------------------------------- 1 | Do you believe in ghosts? 2 | What is scary to you? 3 | Do you like to wear a costume on Halloween? 4 | What is something unlucky? 5 | What does a zombie look like? 6 | What does a werewolf look like? 7 | What does a witch look like? 8 | What does a mummy look like? 9 | What is a scary movie? 10 | Do you like horror movies? 11 | Have you ever seen a ghost? 12 | Do you believe in aliens? 13 | Have you ever seen UFO? 14 | Does your country celebrate Halloween? 15 | When was the last time you screamed? 16 | What are popular costumes? 17 | Have you ever made a jack-o-lantern? 18 | Do you like Halloween? 19 | What day is Halloween? 20 | What country did Halloween originate in? 21 | Who is your favorite fantasy character? 22 | Do you believe in witches? 23 | 24 | 25 | -------------------------------------------------------------------------------- /assets/topics/random.txt: -------------------------------------------------------------------------------- 1 | Do you like pets? Do you have any? 2 | What was the last book you read? 3 | Do you like to cook? 4 | Have you ever lived in another country? 5 | Have you ever met a famous person? 6 | What do you do in your free time? 7 | What kind of food do you prefer eating when you eat out? 8 | What kind of people do you like? 9 | What languages do you know how to speak? 10 | What was the last movie you have seen? 11 | If you could you try any kind of activity, what activity would you try? 12 | What super-power would you most like to have, and why? 13 | What would your dream house be like? 14 | If you could change something about the world, what would it be & why? 15 | When was the last time you laughed so hard you cried? 16 | Do you love kids? 17 | What are your hobbies or special interests? -------------------------------------------------------------------------------- /assets/topics/culture.txt: -------------------------------------------------------------------------------- 1 | What do you think is interesting about your culture? 2 | How do young people in your culture behave differently from older people? 3 | Have you ever felt confused by the actions of someone from another culture? 4 | Who in your culture do you admire most? 5 | Why do you think culture is important? 6 | If you could change one thing about your culture, what would it be? 7 | Would you ever consider marrying or dating someone from another culture? 8 | Would you ever live in a country other than your home country? 9 | What is something polite in your culture? 10 | What is something rude in your culture? 11 | What other cultures have you met people from? 12 | What do you think is important when visiting another culture? 13 | Have you ever experienced culture shock? 14 | What do you like least about your culture? -------------------------------------------------------------------------------- /assets/topics/music.txt: -------------------------------------------------------------------------------- 1 | What kind of music do you like? 2 | Are you a good singer? 3 | Can you play a musical instrument? 4 | If so, what do you play? 5 | How long have you been playing? 6 | Are you good at it? 7 | Can you play the drums? 8 | Can you play the guitar? 9 | Can you read music? 10 | Do you enjoy music videos? 11 | Do you like all kinds of music? 12 | Do you like American rock bands? 13 | Do you like country music? 14 | Do you like jazz? 15 | Do you like to listen classical music? 16 | Do you like to listen country music? 17 | Who is your favorite country singer? 18 | Do you like singing karaoke? 19 | How often do you sing karaoke? 20 | Do you sing while taking a bath? 21 | Have you ever been to a concert? 22 | Have you ever been to a rock concert? 23 | How does music make you feel? 24 | What is your favorite karaoke song to sing? 25 | What kinds of music do people listen to in your country? 26 | What kinds of music do you dislike? -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 28 |
29 |

ESL Ninja

30 |

Student

31 |

Leader

32 |
33 |
34 | -------------------------------------------------------------------------------- /assets/topics/art.txt: -------------------------------------------------------------------------------- 1 | Are you a good painter? 2 | Can you draw pictures well? 3 | Do you consider yourself a good artist? 4 | Do you enjoy your art class at school? 5 | Do you like modern art? 6 | Do you like paintings? 7 | Do you like sketching? 8 | Do you like to visit art museums? 9 | Do you like wood carving? 10 | Do you prefer using water colors or oil paint? 11 | Do you think it is proper to call nude paintings art? 12 | Do you think music and dancing are forms of art? 13 | Do you think of cartoons and comics as art? 14 | Do you visit museums when you go to another city? 15 | Have you ever been to any famous art museums? 16 | Have you ever visited an art museum? 17 | What art style do you like best? 18 | What art museums have you visited? 19 | What famous painters do you know? 20 | What is the longest time that you have spend on a painting? 21 | What is your favorite art web site? 22 | What would life be like without art? 23 | When was the last time you went to an art museum? 24 | Who are some famous artists in your country? 25 | Who is a famous potter in your country? -------------------------------------------------------------------------------- /assets/topics/animals.txt: -------------------------------------------------------------------------------- 1 | Do you have a pet? 2 | What is it\'s name? How did you choose this name? 3 | Does it know any tricks or understand any words? 4 | If you don\'t have a pet, why not? 5 | Would you ever consider getting a pet? 6 | Did you grow up with pets in your home? 7 | What is the best pet to own? 8 | What are some animals that live in your country? 9 | Are you afraid of snakes? 10 | Do bats make good pets? 11 | Are you frightened of spiders? 12 | Can you name some endangered species? 13 | Have you ever ridden a horse? 14 | Are there birds or squirrels in your neighborhood? 15 | Do you know someone who owns an unusual pet? 16 | Do you think it is okay to eat meat? 17 | Is there any kind of meat you would not eat? 18 | What kind of meats have you eaten? 19 | Have you ever been to a zoo? 20 | Are there laws about hunting in your country? 21 | Do you think people should buy and wear fur coats? 22 | Do you think that animals dream? 23 | Have you ever been bitten by a dog? 24 | Have you eaten octopus? 25 | What is your favorite animal? 26 | What animals do you think are cute? -------------------------------------------------------------------------------- /assets/topics/travel 2.txt: -------------------------------------------------------------------------------- 1 | Where will you go on your next vacation? 2 | Would you prefer to stay at a hotel or a hostel? 3 | Do you have a passport? 4 | Would you rather visit another country or travel within your own country? 5 | Would you rather go to a place where there are a lot of people or to a place where there are few people? 6 | What are popular tourist destinations in your country? 7 | Have you been to any of them? 8 | Which would you recommend if you could only recommend one? Why? 9 | Do you prefer active or relaxing holidays? Why? 10 | Would you like to go back to the same place? 11 | What are some benefits of travel? 12 | Why do people travel? 13 | What country do you not want to visit? 14 | Can you name a country that begins with \"P\" 15 | Do you travel with a lot of baggage or do you like to travel light? 16 | Do you think it is a good idea to travel with friends, or alone? 17 | If you had $100,000, where would you go on holiday? 18 | Which countries have you travelled to? 19 | Do you prefer hot countries or cool countries when you go on holiday 20 | If you could choose one place to go this weekend, where would it be? 21 | Do you think tourism will harm the earth? -------------------------------------------------------------------------------- /assets/topics/food.txt: -------------------------------------------------------------------------------- 1 | Do you always eat dinner with your family? 2 | Do you always eat vegetables? 3 | Do you cook? If yes, what food do you cook the most often? 4 | Do you drink milk every day? 5 | Do you drink tea every day? 6 | Do you eat beef? 7 | Do you eat bread every day? 8 | Do you eat breakfast every day? 9 | Do you eat fruit every day? 10 | Do you eat lunch at school every day? 11 | Do you eat rice every day? 12 | Do you ever skip breakfast? If so, how often and why? 13 | Do you have a favorite cafe? If so, where is it? Why do you like it? 14 | Do you have coffee for breakfast? 15 | Do you know someone who struggles with an eating disorder? 16 | Do you like Thai food? 17 | What kind of Japanese food do you like? 18 | Do you like deep fried food? 19 | Do you like food from other countries? If yes, which do you like the most? 20 | Do you like peas and carrots? How about spinach? 21 | Do you like to cook? Why or why not? 22 | Do you like to eat a lot of food every day? 23 | Do you like to eat at fast food restaurants? 24 | Do you like to eat cakes? 25 | Do you like to eat junk food? 26 | Do you like to eat some desserts after dinner? 27 | Do you like to eat? Why or why not? 28 | Do you like to have breakfast each morning? Why or why not? -------------------------------------------------------------------------------- /assets/topics/travel.txt: -------------------------------------------------------------------------------- 1 | Have you ever been abroad? 2 | Where have you been? 3 | Are you afraid of going abroad alone? 4 | Could you live in another country for the rest of your life? 5 | Describe the most interesting person you met on one of your travels. 6 | What was your best trip? 7 | What was your worst trip? 8 | Did your class in high school go on a trip together? 9 | Do you like to travel with children? Why or why not? 10 | Do you like to travel with your mother? Why or why not? 11 | Do you prefer summer vacations or winter vacations? 12 | Do you prefer to travel alone or in a group? Why? 13 | Do you prefer to travel by train, bus, plane or ship? 14 | Do you prefer traveling by car or by plane? 15 | Have you ever been in a difficult situation while traveling? 16 | Have you ever been on an airplane? 17 | How many times? 18 | What airlines have you flown with? 19 | Have you ever been to a foreign country? 20 | Have you ever gotten lost while traveling? If so, tell about it. 21 | Have you ever hitchhiked? If so, how many times? 22 | Have you ever taken a package tour? 23 | How many countries have you been to? How many states? 24 | How many times have you traveled abroad? 25 | How much luggage do you usually carry? 26 | If you traveled to South America, what countries would like to visit? 27 | What are some things that you always take with you on a trip? 28 | What countries would you like to visit? Why? 29 | What countries would you most like to visit? 30 | What countries would you not like to visit? Why? 31 | What country do you most want to visit? -------------------------------------------------------------------------------- /admin.php: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 19 |
20 |
21 |

topics

22 | 24 |

adddelmodify

25 |
26 |
27 |

questions

28 | 29 | 31 |

confirm

32 |
33 |
34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /assets/css/flip_style.css: -------------------------------------------------------------------------------- 1 | 2 | .flip-container { 3 | -webkit-perspective: 1000px; 4 | -moz-perspective: 1000px; 5 | -o-perspective: 1000px; 6 | perspective: 1000px; 7 | } 8 | .flip-container.hover .flipper { 9 | transform: rotateY(180deg); 10 | -webkit-transform: rotateY(180deg); 11 | -moz-transform: rotateY(180deg); 12 | -o-transform: rotateY(180deg); 13 | } 14 | .flip-container, 15 | .front, 16 | .back { 17 | width: 140px; 18 | height: 70px; 19 | border-radius: 8px; 20 | } 21 | .flipper { 22 | -webkit-transition: 0.3s; 23 | -webkit-transform-style: preserve-3d; 24 | -moz-transition: 0.3s; 25 | -moz-transform-style: preserve-3d; 26 | -o-transition: 0.3s; 27 | -o-transform-style: preserve-3d; 28 | transition: 0.3s; 29 | transform-style: preserve-3d; 30 | 31 | position: relative; 32 | } 33 | .front, 34 | .back { 35 | border: 1px solid black; 36 | -webkit-backface-visibility: hidden; 37 | -moz-backface-visibility: hidden; 38 | -o-backface-visibility: hidden; 39 | backface-visibility: hidden; 40 | 41 | position: absolute; 42 | top: 0; 43 | left: 0; 44 | } 45 | .front { 46 | z-index: 2; 47 | -webkit-transform: rotateY(0deg); 48 | -moz-transform: rotateY(0deg); 49 | -o-transform: rotateY(0deg); 50 | transform: rotateY(0deg); 51 | } 52 | .front img{ 53 | border-radius: 6px; 54 | } 55 | .back { 56 | background-color: white; 57 | -webkit-transform: rotateY(180deg); 58 | -moz-transform: rotateY(180deg); 59 | -o-transform: rotateY(180deg); 60 | transform: rotateY(180deg); 61 | background-color: white; 62 | } -------------------------------------------------------------------------------- /assets/js/dice.js: -------------------------------------------------------------------------------- 1 | var previous; 2 | function randomizeNumber() { 3 | //Randimizes a number between 1 and 6 4 | var random = Math.floor((Math.random() * 14) + 1); 5 | console.log(random); 6 | if(random <= 12){ 7 | random /= 3; 8 | random ++; 9 | } 10 | else if( random == 13) 11 | random = 5; 12 | else 13 | random = 6; 14 | console.log(parseInt(random)); 15 | return parseInt(random); 16 | } 17 | 18 | function rollDice(side) { 19 | //Removes old class and adds the new 20 | var dice = $('#dice'); 21 | var currentClass = dice.attr('class'); 22 | var newClass = 'show-' + side; 23 | 24 | dice.removeClass(); 25 | dice.addClass(newClass); 26 | 27 | if (currentClass == newClass) { 28 | dice.addClass('show-same'); 29 | } 30 | } 31 | 32 | function soundEffect() { 33 | var audio = $("audio")[0]; 34 | try{ 35 | audio.pause(); 36 | audio.currentTime = 0; 37 | audio.play(); 38 | } catch(e){ 39 | console.log(e); 40 | } 41 | } 42 | function rollDiceFromNumber(number){ 43 | if (number == 1) { rollDice('front'); } 44 | else if (number == 2) { rollDice('back'); } 45 | else if (number == 3) { rollDice('right'); } 46 | else if (number == 4) { rollDice('left'); } 47 | else if (number == 5) { rollDice('top'); } 48 | else if (number == 6) { rollDice('bottom'); } 49 | $(".dicNum").html(number); 50 | rolledDice(number); 51 | } 52 | function rollDiceNameNumber(name, number){ 53 | if (number == 1) { rollDice('front'); } 54 | else if (number == 2) { rollDice('back'); } 55 | else if (number == 3) { rollDice('right'); } 56 | else if (number == 4) { rollDice('left'); } 57 | else if (number == 5) { rollDice('top'); } 58 | else if (number == 6) { rollDice('bottom'); } 59 | $(".dicNum").html(number); 60 | rolledDiceNameNumber(name, number); 61 | } 62 | $('.dice-container').on('click ', function() { 63 | if(isCanPlay == false){ 64 | alert("It's not your turn."); 65 | return; 66 | } 67 | var number = randomizeNumber(); 68 | rollDiceFromNumber(number); 69 | soundEffect(); 70 | }); 71 | -------------------------------------------------------------------------------- /assets/js/dice_offline.js: -------------------------------------------------------------------------------- 1 | var previous; 2 | function randomizeNumber() { 3 | //Randimizes a number between 1 and 6 4 | var random = Math.floor((Math.random() * 14) + 1); 5 | console.log(random); 6 | if(random <= 12){ 7 | random /= 3; 8 | random ++; 9 | } 10 | else if( random == 13) 11 | random = 5; 12 | else 13 | random = 6; 14 | console.log(parseInt(random)); 15 | return parseInt(random); 16 | } 17 | 18 | function rollDice(side) { 19 | //Removes old class and adds the new 20 | var dice = $('#dice'); 21 | var currentClass = dice.attr('class'); 22 | var newClass = 'show-' + side; 23 | 24 | dice.removeClass(); 25 | dice.addClass(newClass); 26 | 27 | if (currentClass == newClass) { 28 | dice.addClass('show-same'); 29 | } 30 | } 31 | 32 | function soundEffect() { 33 | var audio = $("audio")[0]; 34 | try{ 35 | audio.pause(); 36 | audio.currentTime = 0; 37 | audio.play(); 38 | } catch(e){ 39 | console.log(e); 40 | } 41 | } 42 | function rollDiceFromNumber(number){ 43 | if (number == 1) { rollDice('front'); } 44 | else if (number == 2) { rollDice('back'); } 45 | else if (number == 3) { rollDice('right'); } 46 | else if (number == 4) { rollDice('left'); } 47 | else if (number == 5) { rollDice('top'); } 48 | else if (number == 6) { rollDice('bottom'); } 49 | $(".dicNum").html(number); 50 | rolledDice(number); 51 | } 52 | function rollDiceNameNumber(name, number){ 53 | if (number == 1) { rollDice('front'); } 54 | else if (number == 2) { rollDice('back'); } 55 | else if (number == 3) { rollDice('right'); } 56 | else if (number == 4) { rollDice('left'); } 57 | else if (number == 5) { rollDice('top'); } 58 | else if (number == 6) { rollDice('bottom'); } 59 | $(".dicNum").html(number); 60 | rolledDiceNameNumber(name, number); 61 | } 62 | $('.dice-container').on('click ', function() { 63 | if(isCanPlay == false){ 64 | alert("It's not your turn."); 65 | return; 66 | } 67 | var number = randomizeNumber(); 68 | rollDiceFromNumber(number); 69 | soundEffect(); 70 | }); 71 | -------------------------------------------------------------------------------- /topicManager.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/js/communication.js: -------------------------------------------------------------------------------- 1 | var arrUsers_total; 2 | var arrUsers; 3 | $(function(){ 4 | arrUsers_total = []; 5 | function __insert_user(__user, state){ 6 | var __d = new Date(); 7 | var __n = __d.getTime(); 8 | __user_index = -1; 9 | for(i=0; i'; 64 | $(".answerList").append(strHtml); 65 | } 66 | var userIndex = arrPlayerNames.indexOf(nextUserName); 67 | $("#playingUsers p").css("color","black"); 68 | $("#playing_"+nextUserName).css("color","red"); 69 | var strHtml = '

' + nextUserName +'

'; 70 | $(".answerList").append(strHtml); 71 | } 72 | setInterval( function(){ 73 | if(userName == ""){ 74 | return; 75 | } 76 | __user_obj = {"type":"g_init", 'gameCode': gameCode, "name": userName, "state": gameState}; 77 | socket.emit('sentence message', JSON.stringify(__user_obj)); 78 | }, 2000); 79 | }) 80 | -------------------------------------------------------------------------------- /assets/css/dice_style.css: -------------------------------------------------------------------------------- 1 | 2 | .dice-container { 3 | width: 50px; 4 | height: 50px; 5 | position: relative; 6 | -webkit-perspective: 2000px; 7 | perspective: 2000px; 8 | cursor: -webkit-pointer; 9 | cursor: pointer; 10 | z-index: 999; 11 | -webkit-transition: -webkit-transform 0.2s ease 0; 12 | transition: -webkit-transform 0.2s ease 0; 13 | transition: transform 0.2s ease 0; 14 | transition: transform 0.2s ease 0, -webkit-transform 0.2s ease 0; 15 | } 16 | .dice-container:hover { 17 | -webkit-transform: scale(0.98); 18 | transform: scale(0.98); 19 | } 20 | #dice { 21 | width: 100%; 22 | height: 100%; 23 | position: absolute; 24 | -webkit-transform-style: preserve-3d; 25 | transform-style: preserve-3d; 26 | -webkit-transition: -webkit-transform 0.4s; 27 | transition: -webkit-transform 0.4s; 28 | transition: transform 0.4s; 29 | transition: transform 0.4s, -webkit-transform 0.4s; 30 | } 31 | #dice figure { 32 | width: 50px; 33 | height: 50px; 34 | display: block; 35 | position: absolute; 36 | border: 1px solid #000; 37 | box-shadow: 0px 0px 15px rgba(1, 1, 1, 0.8); 38 | text-align: center; 39 | line-height: 0px; 40 | font-size: 0px; 41 | background-color: #FFF; 42 | -webkit-user-select: none; 43 | -moz-user-select: none; 44 | -ms-user-select: none; 45 | } 46 | #dice .front { 47 | -webkit-transform: rotateY(0deg) translateZ(25px); 48 | transform: rotateY(0deg) translateZ(25px); 49 | background-image: url("../img/dice/1.png"); 50 | background-size: contain; 51 | } 52 | #dice .back { 53 | -webkit-transform: rotateX(180deg) translateZ(25px); 54 | transform: rotateX(180deg) translateZ(25px); 55 | background-image: url("../img/dice/2.png"); 56 | background-size: contain; 57 | } 58 | #dice .right { 59 | -webkit-transform: rotateY(90deg) translateZ(25px); 60 | transform: rotateY(90deg) translateZ(25px); 61 | background-image: url("../img/dice/3.png"); 62 | background-size: contain; 63 | } 64 | #dice .left { 65 | -webkit-transform: rotateY(-90deg) translateZ(25px); 66 | transform: rotateY(-90deg) translateZ(25px); 67 | background-image: url("../img/dice/4.png"); 68 | background-size: contain; 69 | } 70 | #dice .top { 71 | -webkit-transform: rotateX(90deg) translateZ(25px); 72 | transform: rotateX(90deg) translateZ(25px); 73 | background-image: url("../img/dice/5.png"); 74 | background-size: contain; 75 | } 76 | #dice .bottom { 77 | -webkit-transform: rotateX(-90deg) translateZ(25px); 78 | transform: rotateX(-90deg) translateZ(25px); 79 | background-image: url("../img/dice/6.png"); 80 | background-size: contain; 81 | } 82 | #dice.show-front { 83 | -webkit-transform: translateZ(-50px) rotateY(0deg); 84 | transform: translateZ(-50px) rotateY(0deg); 85 | } 86 | #dice.show-back { 87 | -webkit-transform: translateZ(-50px) rotateX(-180deg); 88 | transform: translateZ(-50px) rotateX(-180deg); 89 | } 90 | #dice.show-right { 91 | -webkit-transform: translateZ(-50px) rotateY(-90deg); 92 | transform: translateZ(-50px) rotateY(-90deg); 93 | } 94 | #dice.show-left { 95 | -webkit-transform: translateZ(-50px) rotateY(90deg); 96 | transform: translateZ(-50px) rotateY(90deg); 97 | } 98 | #dice.show-top { 99 | -webkit-transform: translateZ(-50px) rotateX(-90deg); 100 | transform: translateZ(-50px) rotateX(-90deg); 101 | } 102 | #dice.show-bottom { 103 | -webkit-transform: translateZ(-50px) rotateX(90deg); 104 | transform: translateZ(-50px) rotateX(90deg); 105 | } 106 | #dice.show-same { 107 | /* -webkit-transform: translateZ(-100px) rotateX(360deg); 108 | transform: translateZ(-100px) rotateX(360deg);*/ 109 | } 110 | -------------------------------------------------------------------------------- /assets/js/WebAudioAPISound.js: -------------------------------------------------------------------------------- 1 | try { 2 | window.AudioContext = window.AudioContext || window.webkitAudioContext; 3 | window.audioContext = new window.AudioContext(); 4 | } catch (e) { 5 | console.log("No Web Audio API support"); 6 | } 7 | 8 | /* 9 | * WebAudioAPISoundManager Constructor 10 | */ 11 | var WebAudioAPISoundManager = function (context) { 12 | this.context = context; 13 | this.bufferList = {}; 14 | this.playingSounds = {}; 15 | }; 16 | 17 | /* 18 | * WebAudioAPISoundManager Prototype 19 | */ 20 | WebAudioAPISoundManager.prototype = { 21 | addSound: function (url) { 22 | // Load buffer asynchronously 23 | var request = new XMLHttpRequest(); 24 | request.open("GET", url, true); 25 | request.responseType = "arraybuffer"; 26 | 27 | var self = this; 28 | 29 | request.onload = function () { 30 | // Asynchronously decode the audio file data in request.response 31 | self.context.decodeAudioData( 32 | request.response, 33 | 34 | function (buffer) { 35 | if (!buffer) { 36 | alert('error decoding file data: ' + url); 37 | return; 38 | } 39 | self.bufferList[url] = buffer; 40 | }); 41 | }; 42 | 43 | request.onerror = function () { 44 | alert('BufferLoader: XHR error'); 45 | }; 46 | 47 | request.send(); 48 | }, 49 | stopSoundWithUrl: function(url) { 50 | if(this.playingSounds.hasOwnProperty(url)){ 51 | for(var i in this.playingSounds[url]){ 52 | if(this.playingSounds[url].hasOwnProperty(i)) 53 | this.playingSounds[url][i].noteOff(0); 54 | } 55 | } 56 | } 57 | }; 58 | 59 | /* 60 | * WebAudioAPISound Constructor 61 | */ 62 | var WebAudioAPISound = function (url, options) { 63 | this.settings = { 64 | loop: false 65 | }; 66 | 67 | for(var i in options){ 68 | if(options.hasOwnProperty(i)) 69 | this.settings[i] = options[i]; 70 | } 71 | 72 | this.url = url + '.mp3'; 73 | window.webAudioAPISoundManager = window.webAudioAPISoundManager || new WebAudioAPISoundManager(window.audioContext); 74 | this.manager = window.webAudioAPISoundManager; 75 | this.manager.addSound(this.url); 76 | }; 77 | 78 | /* 79 | * WebAudioAPISound Prototype 80 | */ 81 | WebAudioAPISound.prototype = { 82 | play: function () { 83 | var buffer = this.manager.bufferList[this.url]; 84 | //Only play if it's loaded yet 85 | if (typeof buffer !== "undefined") { 86 | var source = this.makeSource(buffer); 87 | source.loop = this.settings.loop; 88 | source.noteOn(0); 89 | 90 | if(!this.manager.playingSounds.hasOwnProperty(this.url)) 91 | this.manager.playingSounds[this.url] = []; 92 | this.manager.playingSounds[this.url].push(source); 93 | } 94 | }, 95 | stop: function () { 96 | this.manager.stopSoundWithUrl(this.url); 97 | }, 98 | getVolume: function () { 99 | return this.translateVolume(this.volume, true); 100 | }, 101 | //Expect to receive in range 0-100 102 | setVolume: function (volume) { 103 | this.volume = this.translateVolume(volume); 104 | }, 105 | translateVolume: function(volume, inverse){ 106 | return inverse ? volume * 100 : volume / 100; 107 | }, 108 | makeSource: function (buffer) { 109 | var source = this.manager.context.createBufferSource(); 110 | var gainNode = this.manager.context.createGainNode(); 111 | gainNode.gain.value = this.volume; 112 | source.buffer = buffer; 113 | source.connect(gainNode); 114 | gainNode.connect(this.manager.context.destination); 115 | return source; 116 | } 117 | }; -------------------------------------------------------------------------------- /offline.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Offline Board Game 5 | 6 | 7 | 8 | 9 |
10 |
11 |
12 |
13 |

Step 1

14 | 1 player
15 | 2 player
16 |
17 |
18 |

Step 2

19 |

Choose a topic

20 | 21 |
22 |
Play
23 |
24 |
25 | 26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |

Press to roll

40 |
41 |
42 |
43 |
44 |

45 |
46 |
47 |
48 |

49 |
50 |
51 |
52 |

53 |
54 |
55 |
56 |

57 |
58 |
59 |
60 |
61 |
62 | 63 | = 7; $i--) 69 | array_push($arrCardNumbers, $i); 70 | for( $i = 12; $i < 19; $i ++) 71 | array_push($arrCardNumbers, $i); 72 | 73 | for ($row=0; $row < 7; $row++) { 74 | echo ""; 75 | for ($col=0; $col < 5; $col++) { 76 | if($row == 1 || $row == 2) { 77 | if($col < 4){ 78 | echo ""; 79 | continue; 80 | } 81 | } 82 | if($row == 4 || $row == 5){ 83 | if($col >= 1){ 84 | echo ""; 85 | continue; 86 | } 87 | } 88 | echo ""); 104 | } 105 | ?> 106 |
"; 89 | $number++; 90 | ?> 91 |
92 |
93 |
94 |
95 |
96 |

97 |
98 |
99 |
100 | "; 102 | } 103 | echo("
107 |
108 |
109 |
110 | 111 |
112 |
Wang's Turn
113 |
114 |
115 |
NEXT
116 |
117 |
118 |
119 | 120 |
121 |
122 | 123 |
124 | 128 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
140 | -------------------------------------------------------------------------------- /student.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 50 |
51 |

Student

52 |
53 | 54 | 55 |

OK

56 |
57 | 58 | 59 | 60 |
61 |
62 |
63 | 64 | 65 | 68 | -------------------------------------------------------------------------------- /assets/js/admin.js: -------------------------------------------------------------------------------- 1 | function userNameKeyPress(event){ 2 | if(event.keyCode == 13){ 3 | $("#passTxt").focus(); 4 | } 5 | } 6 | function userPassKeyPress(event){ 7 | if(event.keyCode == 13){ 8 | if(verifyUserInfo()){ 9 | $(".Login").removeClass("Show"); 10 | $(".Login").addClass("Hidden"); 11 | $(".adminPanel").removeClass("Hidden"); 12 | $(".adminPanel").addClass("Show"); 13 | } else{ 14 | alert("Invalid User Name and Password."); 15 | } 16 | } 17 | } 18 | function verifyUserInfo(){ 19 | var fileContents = $("#userInfo").html(); 20 | var res = fileContents.split(" "); 21 | var userName = res[0]; 22 | var userPass = res[1]; 23 | if( userName == $("#userTxt").val() && userPass == $("#passTxt").val()){ 24 | return true; 25 | } 26 | return false; 27 | } 28 | function refreshTopicList(){ 29 | jQuery.ajax({ 30 | type: 'POST', 31 | url: 'topicManager.php', 32 | dataType: 'json', 33 | data: { getTopics: "getTopics"}, 34 | success: function(obj, textstatus){ 35 | var strHtml = ""; 36 | for( i = 0; i < obj.length; i++){ 37 | strHtml += ""; 38 | } 39 | $("#topics").html(strHtml); 40 | } 41 | }); 42 | } 43 | refreshTopicList(); 44 | $("#topicDel").on("click", function(){ 45 | var el = document.getElementById("topics"); 46 | var options = el && el.options; 47 | for( var i = 0, iLen = options.length; i 4 ? 4: count($arrUsers); 11 | 12 | $arrContents1 = array(-1,21,14,7,0,1,2,3,4,5,6,13,20,27,34,41,48); 13 | $arrContents2 = array(-1,42,35,28,21,14,7,0,1,2,3,4,5,6,13,20,27,34,41,48); 14 | $arrContents3 = array(-1,42,43,44,45,46,47,48,41,34,27,20,13,6); 15 | $arrContents4 = array(-1,0,1,2,3,4,5,6,13,20,27,34,41); 16 | $arrContents = array( $arrContents1, $arrContents2, $arrContents3, $arrContents4); 17 | // print_r($arrContents); 18 | $nCardCount = 0; 19 | ?> 20 | 21 | 22 | 23 | 24 | Long-Version Board Game 25 | 26 | 27 | 28 | 29 |
30 | 35 |
36 |
37 |
38 | 39 | "; 43 | for ($col=0; $col < 7; $col++) { 44 | $cardNum = $row * 7 + $col; 45 | $ret = array_search($cardNum, $arrBuff); 46 | if( $ret != true){echo "";continue;} 47 | echo ""); 64 | } 65 | ?> 66 |
"; 48 | $curVal = $nCardCount + $ret-1; 49 | // echo $curVal; 50 | ?> 51 |
52 |
53 |
54 |
55 |
56 |

57 |
58 |
59 |
60 | "; 62 | } 63 | echo("
67 |
68 |
69 |
70 | 74 |
75 |

Question and Answers

76 |
77 |
78 |
79 |
80 | 4 ? 4 : count($arrUsers); 82 | for( $i = 1; $i <= $carNumbers; $i++){ 83 | ?> 84 |
85 |

86 |
87 |
88 |
89 |

90 |
91 |
92 | 95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |

Press to roll

109 |
110 | 114 |
115 |
116 |
117 |
Wang's Turn
118 |

Answer

119 | 120 |
121 |
122 |
NEXT
123 |

After you answer the question press NEXT

124 |
125 |
126 |
127 | 128 | 129 | 132 | 133 | 136 | 137 |
138 |
139 | 140 |
141 | 142 |
143 |
144 | 145 |
146 | 147 | 150 | 153 | 154 | 155 | 156 | 192 | 193 | 194 | 195 | 196 |
197 | -------------------------------------------------------------------------------- /assets/css/index.css: -------------------------------------------------------------------------------- 1 | .game_container{ 2 | width: 1300px; 3 | margin: auto; 4 | position: relative; 5 | padding: 5px; 6 | background-image: url("../img/bg-img/background-01.png"); 7 | border: 1px solid black; 8 | } 9 | .customPanel{ 10 | float: left; 11 | } 12 | .stepPanel{ 13 | margin-top: 10px; 14 | padding: 10px; 15 | width: 370px; 16 | } 17 | .curUsersPanel{ 18 | width: 150px; 19 | } 20 | .stepPanel p{ 21 | padding: 0px; 22 | margin: 0px; 23 | } 24 | .stepPanel h3{ 25 | margin: 8px; 26 | } 27 | .myName{ 28 | color: red; 29 | font-size: 2em; 30 | width: 63%; 31 | text-align: center; 32 | float: left; 33 | } 34 | .customList{ 35 | width: 100%; 36 | border: 1px solid black; 37 | overflow: auto; 38 | min-height: 130px; 39 | font-size: 1.5em; 40 | } 41 | .boardPanel{ 42 | width: 800px; 43 | margin-left: 120px; 44 | margin-right: 100px; 45 | } 46 | .dice_board{ 47 | position: absolute; 48 | left: 330px; 49 | top: 225px; 50 | background-color: white; 51 | opacity: 0.8; 52 | border-radius: 10px; 53 | padding: 5px; 54 | } 55 | .dice_container{ 56 | width: 100px; 57 | float: left; 58 | } 59 | .dice_container p{ 60 | text-align: center; 61 | margin-top: 20px; 62 | width: 100%; 63 | } 64 | .dice_number_container, .dice_Next_Container{ 65 | margin-left: 30px; 66 | float: left; 67 | } 68 | .dice_number{ 69 | font-size: 89px; 70 | border: 2px solid gray; 71 | font-weight: bold; 72 | font-style: italic; 73 | width: 96px; 74 | height: 96px; 75 | line-height: 96px; 76 | text-align: center; 77 | background-color: white; 78 | } 79 | .dice_Btn{ 80 | margin: auto; 81 | width: 80px; 82 | height: 80px; 83 | line-height: 80px; 84 | } 85 | .action_Btn{ 86 | background-color: #DF633B; 87 | color: white; 88 | font-weight: bold; 89 | text-align: center; 90 | border-radius: 50%; 91 | font-style: italic; 92 | font-size: x-large; 93 | cursor: pointer; 94 | } 95 | .game_board{ 96 | width: 600px; 97 | height: 600px; 98 | } 99 | .cardTable{ 100 | margin-top: 100px; 101 | } 102 | .cardTable td { 103 | padding: 5px; 104 | min-width: 140px; 105 | min-height: 70px; 106 | width: 140px; 107 | height: 70px; 108 | } 109 | .carContainer{ 110 | position: absolute; 111 | font-size: 3em; 112 | } 113 | .flip-container .flipper .front, #cardContainer0 .flipper .front, #cardContainer18 .flipper .front{ 114 | color: white; 115 | font-size: 3em; 116 | text-align: center; 117 | line-height: 70px; 118 | } 119 | .DisplayNone{ 120 | display: none; 121 | } 122 | .DisplayBlock{ 123 | display: block; 124 | } 125 | .HideItem{ 126 | visibility: hidden; 127 | } 128 | .ShowItem{ 129 | visibility: visible; 130 | } 131 | #player1 .playerImage, #player_prog1 .playerImage{ 132 | background-image: url("../img/birds/birds-01.png"); 133 | } 134 | #player2 .playerImage, #player_prog2 .playerImage{ 135 | background-image: url("../img/birds/birds-02.png"); 136 | } 137 | #player3 .playerImage, #player_prog3 .playerImage{ 138 | background-image: url("../img/birds/birds-03.png"); 139 | } 140 | #player4 .playerImage, #player_prog4 .playerImage{ 141 | background-image: url("../img/birds/birds-04.png"); 142 | } 143 | .playerImage{ 144 | width: 50px; 145 | height: 50px; 146 | background-size: contain; 147 | } 148 | .playerName{ 149 | position: absolute; 150 | padding: 0px; 151 | margin: auto; 152 | text-align: center; 153 | font-size: 15px; 154 | background-color: white; 155 | opacity: 0.8; 156 | width: 48px; 157 | border-radius: 10px; 158 | } 159 | .carBody{ 160 | position: absolute; 161 | display: none; 162 | } 163 | .car_path{ 164 | } 165 | .action_YourTurn p, .action_Congrates p{ 166 | font-size: 5em; 167 | text-shadow: 3px 3px 0px #34616b; 168 | display: none; 169 | } 170 | .action_YourTurn, .action_Congrates{ 171 | margin: auto; 172 | width: 1300px; 173 | position: absolute; 174 | top: 0; 175 | line-height: 630px; 176 | text-align: center; 177 | } 178 | .curUsersPanel p{ 179 | padding: 5px; 180 | margin: auto; 181 | } 182 | .start_Btn{ 183 | width: 75px; 184 | height: 40px; 185 | line-height: 40px; 186 | margin-left: 5px; 187 | font-size: 1.5em; 188 | margin-top: 10px; 189 | border-radius: 10px 190 | } 191 | .exit_Btn{ 192 | width: 55px; 193 | height: 40px; 194 | line-height: 40px; 195 | margin-top: 10px; 196 | margin-left: 15px; 197 | font-size: 1.5em; 198 | border-radius: 10px; 199 | } 200 | 201 | .answerPanel{ 202 | position: absolute; 203 | top: 315px; 204 | left: 450px; 205 | width: 360px; 206 | height: 200px; 207 | border-radius: 20px; 208 | background-color: white; 209 | opacity: 0.8; 210 | font-size: 1em; 211 | text-align: center; 212 | padding-top: 5px; 213 | margin-top: 10px; 214 | } 215 | .answerPanel h3{ 216 | margin: auto; 217 | } 218 | .onesAnswer{ 219 | position: absolute; 220 | margin-left: 475px; 221 | margin-top: 220px; 222 | border-radius: 10px; 223 | background-color: white; 224 | opacity: 0.8; 225 | width: 305px; 226 | height: 95px; 227 | } 228 | .onesTurn{ 229 | font-size: 2em; 230 | text-align: center; 231 | } 232 | .onesAnswer p{ 233 | margin-top: 0px; 234 | } 235 | #myAnswer{ 236 | font-size: 1.1em; 237 | width: 95%; 238 | height: 30px; 239 | margin-left: 5px; 240 | border-style: solid; 241 | } 242 | .answerList{ 243 | margin: 10px; 244 | border: 1px solid black; 245 | overflow: auto; 246 | height: 150px; 247 | text-align: left; 248 | padding-left: 10px; 249 | } 250 | .answerList p{ 251 | margin: 0px; 252 | } 253 | 254 | .dice_Next_Container{ 255 | position: absolute; 256 | margin-left: 820px; 257 | margin-top: 220px; 258 | background-color: white; 259 | opacity: 0.8; 260 | padding: 10px; 261 | border-radius: 20px; 262 | } 263 | 264 | .btnGo{ 265 | width: 120px; 266 | height: 40px; 267 | line-height: 40px; 268 | margin-left: 15px; 269 | font-size: 1.5em; 270 | border-radius: 10px; 271 | margin-top: 5px; 272 | } 273 | p{ 274 | margin-bottom: 0px; 275 | } 276 | .stepLeftPanel, .stepRightPanel{ 277 | float: left; 278 | width: 155px; 279 | margin-right: 10px; 280 | background-color: white; 281 | border-radius: 10px; 282 | opacity: 0.8; 283 | padding: 10px; 284 | } 285 | #topicList{ 286 | height: 300px; 287 | } 288 | .ok_Btn{ 289 | border-radius: 10px; 290 | float: left; 291 | width: 30%; 292 | text-align: center; 293 | font-size: 2em; 294 | margin-left: 5px; 295 | margin-top: 3px; 296 | } 297 | #yourName{ 298 | margin-left: 10px; 299 | color: red; 300 | } 301 | .ani-gif-star{ 302 | position: absolute; 303 | top: 700px; 304 | left: 1140px; 305 | width: 100px; 306 | height: 100px; 307 | } 308 | .ani-gif-star img, .ani-gif-conb img{ 309 | width: 100%; 310 | height: 100%; 311 | } 312 | .ani-gif-cong{ 313 | position: absolute; 314 | top: 570px; 315 | left: 995px; 316 | } 317 | .progressBar{ 318 | width: 70%; 319 | margin: auto; 320 | height: 10px; 321 | border-bottom: 8px solid red; 322 | margin-top: 100px; 323 | margin-bottom: 25px; 324 | } 325 | .pBarCell{ 326 | border-left: 4px solid red; 327 | width: calc(100% / 59); 328 | height: 9px; 329 | } 330 | .progressBar table{ 331 | width: 100%; 332 | } -------------------------------------------------------------------------------- /assets/js/index_offline.js: -------------------------------------------------------------------------------- 1 | var arrCars = []; 2 | var arrCurStep = []; 3 | var arrCarPosInCard = []; 4 | var nCurrentUserNumber = -1; 5 | var nMaxNumber = 4; 6 | var nAllUserCount = 0; 7 | var nCurPlayingCount = 0; 8 | var userName = ""; 9 | var arrPlayerNames = []; 10 | var arrUsers = []; 11 | var gameState = false; 12 | var arrInviteSendUsers = []; 13 | var nBoardImgNo = 0; 14 | var topicName = ""; 15 | var arrQuestionNumbers = []; 16 | var isCanPlay = false; 17 | function getSelectedTopicName(){ 18 | var el = document.getElementById("topicList"); 19 | var options = el && el.options; 20 | for( var i = 0, iLen = options.length; i option").filter(function(){ 31 | return $(this).html() === strTopic; 32 | }).prop('selected', true); 33 | jQuery.ajax({ 34 | type: 'POST', 35 | url: 'topicManager.php', 36 | data: { getContents: strTopic}, 37 | success: function(obj, textstatus){ 38 | var arrRet = obj.split("\n"); 39 | var strHtml = ""; 40 | var arrContents = []; 41 | for( i = 0; i < arrRet.length; i++){ 42 | if(arrRet[i] == "") 43 | continue; 44 | arrContents.push(arrRet[i]); 45 | } 46 | if(arrQuestions.length != 0){ 47 | arrQuestionNumbers = arrQuestions; 48 | } else{ 49 | if ( arrContents.length < 17) { 50 | for( ii = 1; ii < 18; ii++){ 51 | var ran = Math.floor(Math.random()*arrContents.length); 52 | arrQuestionNumbers.push(ran); 53 | } 54 | } else{ 55 | while( arrQuestionNumbers.length < 17){ 56 | var ran = Math.floor(Math.random()*arrContents.length); 57 | if( arrQuestionNumbers.indexOf(ran) == -1){ 58 | arrQuestionNumbers.push(ran); 59 | } 60 | } 61 | } 62 | } 63 | for( i = 1; i < 18; i++){ 64 | $("#cardContainer"+i).find(".questionTxt").html(arrContents[arrQuestionNumbers[i-1]]); 65 | } 66 | } 67 | }); 68 | } 69 | function setBackgroundImg(nImgNo){ 70 | $(".game_container").css('background-image', 'url("assets/img/bg-img/background-0' + nBoardImgNo + '.png")'); 71 | } 72 | function addUser(_name){ 73 | nCurPlayingCount++; 74 | nCurrentUserNumber ++; 75 | arrPlayerNames.push(_name); 76 | var car = $("#player" + (nCurPlayingCount)); 77 | car.find(".playerName").html(arrPlayerNames[nCurPlayingCount-1]); 78 | car.removeClass("HideItem"); 79 | car.addClass("ShowItem"); 80 | nAllUserCount = nCurPlayingCount; 81 | arrCars.push(car); 82 | arrCurStep.push(-1); 83 | gotoStep(_name,1); 84 | arrCarPosInCard.push(nCurPlayingCount-1); 85 | } 86 | $(".dice_Btn").on("click", function(){ //NEXT button 87 | if( $("#myAnswer").val() == "" && document.getElementById("myAnswer").disabled == false){ 88 | alert("Please enter the answer."); 89 | return; 90 | } 91 | var _answer = $("#myAnswer").val(); 92 | $("#myAnswer").val(""); 93 | $(".flip-container").removeClass("hover"); 94 | 95 | var nBuff = nCurrentUserNumber + 1; 96 | nBuff %= nAllUserCount; 97 | var _name = arrPlayerNames[nBuff]; 98 | SetUserTurn(_name); 99 | isCanPlay = true; 100 | }); 101 | 102 | // soundManager.setup({ 103 | // // where to find flash audio SWFs, as needed 104 | // url: '/path/to/swf-files/', 105 | // onready: function() { 106 | // // SM2 is ready to play audio! 107 | // } 108 | // }); 109 | function gotoStep(carName, number){ 110 | if(nAllUserCount == 0) return; 111 | nCurrentUserNumber = arrPlayerNames.indexOf(carName); 112 | if(arrCurStep[nCurrentUserNumber] >= 18) 113 | return; 114 | var prevStep = arrCurStep[nCurrentUserNumber]; 115 | arrCurStep[nCurrentUserNumber] += number; 116 | if(arrCurStep[nCurrentUserNumber] >= 18){ 117 | arrCurStep[nCurrentUserNumber] = 18; 118 | $(".ani-gif").removeClass("HideItem"); 119 | $(".ani-gif").addClass("ShowItem"); 120 | setTimeout(function(){ 121 | $(".ani-gif").removeClass("ShowItem"); 122 | $(".ani-gif").addClass("HideItem"); 123 | }, 5000); 124 | var audio = $("audio")[1]; 125 | try{ 126 | audio.load(); 127 | audio.pause(); 128 | audio.currentTime = 0; 129 | audio.play(); 130 | } catch(e){ 131 | console.log(e); 132 | } 133 | } 134 | var car = arrCars[nCurrentUserNumber]; 135 | if( arrCurStep[nCurrentUserNumber] != 0 && arrCurStep[nCurrentUserNumber]!= 18){ 136 | var curCardElem = $("#cardContainer"+arrCurStep[nCurrentUserNumber]); 137 | curCardElem.toggleClass('hover'); 138 | } 139 | var carPos = calcCarPosition(nCurrentUserNumber, arrCurStep[nCurrentUserNumber], true); 140 | var nleft = carPos.left; 141 | var ntop = carPos.top; 142 | car.css({top:ntop, left:nleft, position:'absolute'}); 143 | for( i = 0; i < nAllUserCount; i++){ 144 | if( (arrCurStep[i] == prevStep) && arrCurStep[i] < 18){ 145 | car = arrCars[i]; 146 | arrCarPosInCard[i]--; 147 | carPos = calcCarPosition(i, arrCurStep[i], false); 148 | car.css({top:carPos.top, left:carPos.left, position:'absolute'}); 149 | } 150 | } 151 | return arrCurStep[nCurrentUserNumber]; 152 | } 153 | function rolledDice(number){ 154 | $(".flip-container").removeClass("hover"); 155 | nCurrentUserNumber ++; 156 | nCurrentUserNumber %= nAllUserCount; 157 | var userName = arrPlayerNames[nCurrentUserNumber]; 158 | rolledDiceNameNumber( userName, number); 159 | isCanPlay = false; 160 | } 161 | function rolledDiceNameNumber(_name,_number){ 162 | gotoStep( _name, _number); 163 | } 164 | function calcCarPosition( nCurrentUser, nCardNumber, isNew){ 165 | var nleft; 166 | var ntop; 167 | var samePosCount = -1; 168 | for ( i = 0; i < nAllUserCount; i++){ 169 | if(arrCurStep[i] == nCardNumber){ 170 | samePosCount++; 171 | } 172 | } 173 | if( isNew) 174 | arrCarPosInCard[nCurrentUser] = samePosCount; 175 | var position = $("#cardContainer"+nCardNumber).position(); 176 | nleft = position.left - 320; 177 | ntop = position.top; 178 | if( ((nCardNumber >= 0) && (nCardNumber < 5)) || (nCardNumber >= 15)){ 179 | ntop -= 50; 180 | ntop -= 50 * parseInt( arrCarPosInCard[nCurrentUser] / 2); 181 | nleft += 50 * parseInt(arrCarPosInCard[nCurrentUser] % 2); 182 | } else if( (nCardNumber >= 5) && (nCardNumber < 7)){ 183 | nleft += 160; 184 | ntop -= 50 * parseInt( arrCarPosInCard[nCurrentUser] / 2); 185 | nleft += 50 * parseInt(arrCarPosInCard[nCurrentUser] % 2); 186 | } else if( (nCardNumber >= 7) && (nCardNumber <= 10)){ 187 | ntop += 70; 188 | ntop += 50 * parseInt( arrCarPosInCard[nCurrentUser] / 2); 189 | nleft += 50 * parseInt(arrCarPosInCard[nCurrentUser] % 2); 190 | } else{ 191 | nleft -= 50; 192 | ntop += 50 * parseInt( arrCarPosInCard[nCurrentUser] / 2); 193 | nleft -= 50 * parseInt(arrCarPosInCard[nCurrentUser] % 2); 194 | } 195 | return {left:nleft, top:ntop}; 196 | } 197 | function fillImageCards(){ 198 | for ( i = 0; i < 19; i++){ 199 | $("#cardContainer"+i).find(".front").css('background-image', 'url("assets/img/card-img/card-img-0'+(i % 6+ 1)+'.png")'); 200 | } 201 | $("#cardContainer0").find(".front").html('Start'); 202 | $("#cardContainer18").find(".front").html('Finish'); 203 | } 204 | fillImageCards(); 205 | 206 | function refreshTopicList(){ 207 | jQuery.ajax({ 208 | type: 'POST', 209 | url: 'topicManager.php', 210 | dataType: 'json', 211 | data: { getTopics: "getTopics"}, 212 | success: function(obj, textstatus){ 213 | var strHtml = ""; 214 | for( i = 0; i < obj.length; i++){ 215 | strHtml += ""; 216 | } 217 | $("#topicList").html(strHtml); 218 | } 219 | }); 220 | } 221 | refreshTopicList(); 222 | $(".start_Btn").on('click', function(){ 223 | $(".flip-container").removeClass("hover"); 224 | g_topicName = getSelectedTopicName(); 225 | if(g_topicName == ""){ 226 | alert("Please select a topic."); 227 | return; 228 | } 229 | $(".player").removeClass("ShowItem"); 230 | $(".player").addClass("HideItem"); 231 | arrCars = []; 232 | arrCurStep = []; 233 | arrCarPosInCard = []; 234 | nAllUserCount = 0; 235 | $(".answerList").html(""); 236 | nBoardImgNo = Math.floor((Math.random() * 9) + 1); 237 | setBackgroundImg( nBoardImgNo); 238 | arrQuestionNumbers = []; 239 | setContentsToCards(g_topicName, arrQuestionNumbers); 240 | 241 | nCurPlayingCount = 0; 242 | nCurrentUserNumber = 0; 243 | arrPlayerNames = []; 244 | 245 | addUser("player1"); 246 | if ($('input[name="playerCount"]:checked').val() == '1player') { 247 | console.log("1player"); 248 | } else{ 249 | addUser("player2"); 250 | console.log("2player"); 251 | } 252 | SetUserTurn("player1"); 253 | isCanPlay = true; 254 | }) 255 | function SetUserTurn(_name){ 256 | $(".onesTurn").removeClass("HideItem"); 257 | $(".onesTurn").addClass("ShowItem"); 258 | $("#turnUserName").html(_name + "`s "); 259 | } -------------------------------------------------------------------------------- /leader.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 123 |
124 |
Leader
125 |
126 | 127 | 128 |

OK

129 |
130 | 131 |
132 | 135 |
136 |
137 |
Require textX
138 |
139 |
140 |
141 | 142 | 143 | 144 |
145 | 148 |
149 |
150 |
151 | Play 152 |
153 |
154 |
155 | 156 | 157 | 160 | -------------------------------------------------------------------------------- /assets/js/index.js: -------------------------------------------------------------------------------- 1 | function setContentsToCards(strTopic, arrQuestions){ 2 | if( strTopic == "")return; 3 | $("#topicList > option").filter(function(){ 4 | return $(this).html() === strTopic; 5 | }).prop('selected', true); 6 | jQuery.ajax({ 7 | type: 'POST', 8 | url: 'topicManager.php', 9 | data: { getContents: strTopic}, 10 | success: function(obj, textstatus){ 11 | var arrRet = obj.split("\n"); 12 | var strHtml = ""; 13 | for( i = 0; i < arrRet.length; i++){ 14 | if(arrRet[i] == "") 15 | continue; 16 | arrContents.push(arrRet[i]); 17 | } 18 | if(arrQuestions.length != 0){ 19 | arrQuestionNumbers = arrQuestions; 20 | } else{ 21 | if ( arrContents.length < nAllCardCount) { 22 | for( ii = 1; ii < nAllCardCount; ii++){ 23 | var ran = Math.floor(Math.random()*arrContents.length); 24 | arrQuestionNumbers.push(ran); 25 | } 26 | } else{ 27 | while( arrQuestionNumbers.length < nAllCardCount){ 28 | var ran = Math.floor(Math.random()*arrContents.length); 29 | if( arrQuestionNumbers.indexOf(ran) == -1){ 30 | arrQuestionNumbers.push(ran); 31 | } 32 | } 33 | } 34 | } 35 | setTimeout(function(){ 36 | __user_obj = {'type':'g_card_contents', 'gameCode': gameCode, 'masterName':userName, 'cardContents':arrQuestionNumbers.join(",")}; 37 | socket.emit('sentence message', JSON.stringify(__user_obj)); 38 | }, 1000); 39 | 40 | for( i = 1; i < nAllCardCount; i++){ 41 | $("#cardContainer"+i).find(".questionTxt").html(arrContents[arrQuestionNumbers[i-1]]); 42 | } 43 | } 44 | }); 45 | } 46 | function setBackgroundImg(nImgNo){ 47 | $(".game_container").css('background-image', 'url("assets/img/bg-img/background-0' + nImgNo + '.png")'); 48 | } 49 | setContentsToCards(g_topicName, arrQuestionNumbers); 50 | $(".dice_Btn").on("click", function(){ //NEXT button 51 | if( $("#myAnswer").val() == "" && document.getElementById("myAnswer").disabled == false){ 52 | alert("Please enter the answer."); 53 | return; 54 | } 55 | var _answer = $("#myAnswer").val(); 56 | $("#myAnswer").val(""); 57 | $(".flip-container").removeClass("hover"); 58 | sendNextTurnMsg(_answer); 59 | }); 60 | function sendNextTurnMsg(_answer){ 61 | if( gameState == false) { 62 | var strHtml = '

A:' + _answer +'

'; 63 | $(".answerList").append(strHtml); 64 | isCanPlay = true; 65 | return; 66 | } 67 | nCurrentUserNumber ++; 68 | nCurrentUserNumber %= nAllUserCount; 69 | setUserTurn( arrPlayerNames[nCurrentUserNumber], _answer); 70 | } 71 | function getUserPanelStep(userStep){ 72 | if( userStep < 16) return 1; 73 | if( userStep < 19 + 16) return 2; 74 | if( userStep < 19 + 16 + 13) return 3; 75 | return 4; 76 | } 77 | function setProgress(){ 78 | for( var i = 0; i < nAllUserCount; i++){ 79 | var car_pro = $("#player_prog"+(i+1)); 80 | if( arrCurStep[i] == -1) continue; 81 | var tblElem = $("#barCell" + [arrCurStep[i]]); 82 | var curStep = arrCurStep[i]; 83 | var eqCount = 1; 84 | for( var j = 0; j < i; j++){ 85 | if( arrCurStep[j] == curStep){ 86 | eqCount ++; 87 | } 88 | } 89 | var nleft = tblElem.position().left - 25; 90 | var ntop = tblElem.position().top - eqCount * 50; 91 | car_pro.css({top:ntop, left:nleft, position:'absolute'}); 92 | } 93 | } 94 | function gotoStep(carName, number){ 95 | isCanPlay = false; 96 | if(nAllUserCount == 0) return; 97 | nCurrentUserNumber = arrPlayerNames.indexOf(carName); 98 | if(arrCurStep[nCurrentUserNumber] >= nAllCardCount+1) 99 | return; 100 | var prevStep = arrCurStep[nCurrentUserNumber]; 101 | arrCurStep[nCurrentUserNumber] += number; 102 | if( carName == userName){ 103 | if( arrCurStep[nCurrentUserNumber] < 16){ 104 | // setBackgroundImg(1); 105 | } else if( arrCurStep[nCurrentUserNumber] < 19+16){ 106 | $("#boardPanel0").removeClass("DisplayBlock"); 107 | $("#boardPanel0").addClass("DisplayNone"); 108 | $("#boardPanel1").removeClass("DisplayNone"); 109 | $("#boardPanel1").addClass("DisplayBlock"); 110 | // setBackgroundImg(2); 111 | } else if( arrCurStep[nCurrentUserNumber] < 19+16+13){ 112 | $("#boardPanel1").removeClass("DisplayBlock"); 113 | $("#boardPanel1").addClass("DisplayNone"); 114 | $("#boardPanel2").removeClass("DisplayNone"); 115 | $("#boardPanel2").addClass("DisplayBlock"); 116 | // setBackgroundImg(3); 117 | } else { 118 | $("#boardPanel2").removeClass("DisplayBlock"); 119 | $("#boardPanel2").addClass("DisplayNone"); 120 | $("#boardPanel3").removeClass("DisplayNone"); 121 | $("#boardPanel3").addClass("DisplayBlock"); 122 | // setBackgroundImg(4); 123 | } 124 | setBackgroundImg( getUserPanelStep(arrCurStep[nCurrentUserNumber])); 125 | } 126 | if(arrCurStep[nCurrentUserNumber] >= nAllCardCount){ 127 | arrCurStep[nCurrentUserNumber] = nAllCardCount; 128 | $(".ani-gif").removeClass("HideItem"); 129 | $(".ani-gif").addClass("ShowItem"); 130 | setTimeout(function(){ 131 | $(".ani-gif").removeClass("ShowItem"); 132 | $(".ani-gif").addClass("HideItem"); 133 | }, 5000); 134 | var audio = $("audio")[1]; 135 | try{ 136 | audio.pause(); 137 | audio.currentTime = 0; 138 | audio.play(); 139 | } catch(e){ 140 | console.log(e); 141 | } 142 | } 143 | for( i = 0; i < nAllUserCount; i++){ 144 | if( getUserPanelStep(arrCurStep[myNumber]) != getUserPanelStep(arrCurStep[i])){ 145 | arrCars[i].removeClass("ShowItem"); 146 | arrCars[i].addClass("HideItem"); 147 | } else { 148 | arrCars[i].removeClass("HideItem"); 149 | arrCars[i].addClass("ShowItem"); 150 | } 151 | } 152 | var car = arrCars[nCurrentUserNumber]; 153 | if( arrCurStep[nCurrentUserNumber] != 0 && arrCurStep[nCurrentUserNumber]!= nAllCardCount){ 154 | var curCardElem = $("#cardContainer"+arrCurStep[nCurrentUserNumber]); 155 | curCardElem.toggleClass('hover'); 156 | } 157 | var carPos = calcCarPosition(nCurrentUserNumber, arrCurStep[nCurrentUserNumber], true); 158 | var nleft = carPos.left; 159 | var ntop = carPos.top; 160 | car.css({top:ntop, left:nleft, position:'absolute'}); 161 | // if(number == 0)return; 162 | for( i = 0; i < nAllUserCount; i++){ 163 | if( (arrCurStep[i] == prevStep) && (arrCurStep[i] < nAllCardCount+1)){ 164 | // if( (arrCurStep[i] == prevStep) && (arrCurStep[i] < nAllCardCount+1)){ 165 | car = arrCars[i]; 166 | arrCarPosInCard[i]--; 167 | carPos = calcCarPosition(i, arrCurStep[i], false); 168 | car.css({top:carPos.top, left:carPos.left, position:'absolute'}); 169 | } else{ 170 | car = arrCars[i]; 171 | // arrCarPosInCard[i]--; 172 | carPos = calcCarPosition(i, arrCurStep[i], false); 173 | car.css({top:carPos.top, left:carPos.left, position:'absolute'}); 174 | } 175 | } 176 | setProgress(); 177 | return arrCurStep[nCurrentUserNumber]; 178 | } 179 | for( var _i = 0; _i < nAllUserCount; _i ++){ 180 | gotoStep(arrPlayerNames[_i], 1); 181 | } 182 | isCanPlay = (arrPlayerNames[0] == userName) ? true : false; 183 | function rolledDice(number){ 184 | var stepNumber = gotoStep(userName, number); 185 | console.log("Rolled Number : "+stepNumber); 186 | var question = $("#cardContainer"+stepNumber).find(".questionTxt").html(); 187 | var strHtml = '

Q:' + question +'

'; 188 | $(".answerList").append(strHtml); 189 | sendMyDiceNumber(number); 190 | } 191 | function rolledDiceNameNumber(_name,_number){ 192 | nCurrentUserNumber++; 193 | nCurrentUserNumber %= nCurPlayingCount; 194 | var stepNumber = gotoStep(_name, _number); 195 | var question = $("#cardContainer"+stepNumber).find(".questionTxt").html(); 196 | var strHtml = '

' + question +'

'; 197 | $(".answerList").append(strHtml); 198 | } 199 | function calcCarPosition( nCurrentUser, nCardNumber, isNew){ 200 | if( nCardNumber < 0) return {left:0,top:0}; 201 | var nleft; 202 | var ntop; 203 | var samePosCount = -1; 204 | for ( i = 0; i < nAllUserCount; i++){ 205 | if(arrCurStep[i] == nCardNumber){ 206 | samePosCount++; 207 | } 208 | } 209 | if( isNew) 210 | arrCarPosInCard[nCurrentUser] = samePosCount; 211 | var cardElem = $("#cardContainer"+nCardNumber); 212 | var position = cardElem.position(); 213 | console.log(nCardNumber); 214 | nleft = position.left;// - 500; 215 | ntop = position.top; 216 | 217 | col = cardElem.parent().parent().children().index(cardElem.parent()); 218 | if( col == 0){ 219 | nleft -= 60; 220 | ntop -= 50 * parseInt( arrCarPosInCard[nCurrentUser] / 2); 221 | nleft -= 50 * parseInt(arrCarPosInCard[nCurrentUser] % 2); 222 | } else if( col == 6){ 223 | nleft += 150; 224 | ntop -= 50 * parseInt( arrCarPosInCard[nCurrentUser] / 2); 225 | nleft += 50 * parseInt(arrCarPosInCard[nCurrentUser] % 2); 226 | } else { 227 | ntop -= 50; 228 | ntop += 50 * parseInt( arrCarPosInCard[nCurrentUser] / 2); 229 | nleft += 50 * parseInt(arrCarPosInCard[nCurrentUser] % 2); 230 | } 231 | return {left:nleft, top:ntop}; 232 | } 233 | function fillImageCards(){ 234 | for ( i = 0; i < nAllCardCount+1; i++){ 235 | $("#cardContainer"+i).find(".front").css('background-image', 'url("assets/img/card-img/card-img-0'+(i % 6+ 1)+'.png")'); 236 | } 237 | $("#cardContainer0").find(".front").html('Start'); 238 | $("#cardContainer"+nAllCardCount).find(".front").html('Finish'); 239 | } 240 | fillImageCards(); 241 | 242 | function initAllCurrentUsers(){ 243 | $("#playingUsers").html(""); 244 | arrPlayerNames = []; 245 | nCurPlayingCount = 0; 246 | if( userName != "") 247 | addUser(userName); 248 | else 249 | addUser("ME"); 250 | } 251 | function userAccepted(_userName) { 252 | addUser(_userName); 253 | } 254 | $(".exit_Btn").on('click', function(){ 255 | if( gameState == false)return; 256 | gameState = false; 257 | isPlaying = false; 258 | __user_obj = {'type':'g_exit_game', 'gameCode': gameCode, 'masterName':masterUserName, 'userName':userName}; 259 | socket.emit('sentence message', JSON.stringify(__user_obj)); 260 | $("#playingUsers").html(""); 261 | $(".answerList").html(""); 262 | nAllUserCount = 0; 263 | nCurPlayingCount = 0; 264 | arrPlayerNames = []; 265 | arrCarPosInCard = []; 266 | arrCurStep = []; 267 | }) 268 | function setUserTurn(_name, _answer){ 269 | if(isMaster == false){ 270 | __user_obj = {'type':'g_user_Turn_Slave', 'gameCode': gameCode, 'masterName':masterUserName, 'curUserName': userName,'answer':_answer}; 271 | socket.emit('sentence message', JSON.stringify(__user_obj)); 272 | return; 273 | } 274 | __user_obj = {'type':'g_user_Turn', 'gameCode': gameCode, 'masterName':userName, 'nextUserName':_name, 'answer':_answer}; 275 | socket.emit('sentence message', JSON.stringify(__user_obj)); 276 | } 277 | function sendMyDiceNumber(_number){ 278 | if( gameState == false)return; 279 | __user_obj = {'type':'g_dice_Number', 'gameCode': gameCode, 'masterName':masterUserName, 'curUserName': userName, 'diceNumber': _number}; 280 | socket.emit('sentence message', JSON.stringify(__user_obj)); 281 | } 282 | function checkHandle(checkboxElem){ 283 | if( checkboxElem.checked){ 284 | document.getElementById("myAnswer").disabled=false; 285 | } else { 286 | document.getElementById("myAnswer").disabled=true; 287 | } 288 | } -------------------------------------------------------------------------------- /assets/js/socket.io-1.2.0.js: -------------------------------------------------------------------------------- 1 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.io=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0&&!this.encoding){var pack=this.packetBuffer.shift();this.packet(pack)}};Manager.prototype.cleanup=function(){var sub;while(sub=this.subs.shift())sub.destroy();this.packetBuffer=[];this.encoding=false;this.decoder.destroy()};Manager.prototype.close=Manager.prototype.disconnect=function(){this.skipReconnect=true;this.readyState="closed";this.engine&&this.engine.close()};Manager.prototype.onclose=function(reason){debug("close");this.cleanup();this.readyState="closed";this.emit("close",reason);if(this._reconnection&&!this.skipReconnect){this.reconnect()}};Manager.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var self=this;this.attempts++;if(this.attempts>this._reconnectionAttempts){debug("reconnect failed");this.emitAll("reconnect_failed");this.reconnecting=false}else{var delay=this.attempts*this.reconnectionDelay();delay=Math.min(delay,this.reconnectionDelayMax());debug("will wait %dms before reconnect attempt",delay);this.reconnecting=true;var timer=setTimeout(function(){if(self.skipReconnect)return;debug("attempting reconnect");self.emitAll("reconnect_attempt",self.attempts);self.emitAll("reconnecting",self.attempts);if(self.skipReconnect)return;self.open(function(err){if(err){debug("reconnect attempt error");self.reconnecting=false;self.reconnect();self.emitAll("reconnect_error",err.data)}else{debug("reconnect success");self.onreconnect()}})},delay);this.subs.push({destroy:function(){clearTimeout(timer)}})}};Manager.prototype.onreconnect=function(){var attempt=this.attempts;this.attempts=0;this.reconnecting=false;this.emitAll("reconnect",attempt)}},{"./on":4,"./socket":5,"./url":6,"component-bind":7,"component-emitter":8,debug:9,"engine.io-client":10,indexof:36,"object-component":37,"socket.io-parser":40}],4:[function(_dereq_,module,exports){module.exports=on;function on(obj,ev,fn){obj.on(ev,fn);return{destroy:function(){obj.removeListener(ev,fn)}}}},{}],5:[function(_dereq_,module,exports){var parser=_dereq_("socket.io-parser");var Emitter=_dereq_("component-emitter");var toArray=_dereq_("to-array");var on=_dereq_("./on");var bind=_dereq_("component-bind");var debug=_dereq_("debug")("socket.io-client:socket");var hasBin=_dereq_("has-binary");module.exports=exports=Socket;var events={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1};var emit=Emitter.prototype.emit;function Socket(io,nsp){this.io=io;this.nsp=nsp;this.json=this;this.ids=0;this.acks={};if(this.io.autoConnect)this.open();this.receiveBuffer=[];this.sendBuffer=[];this.connected=false;this.disconnected=true}Emitter(Socket.prototype);Socket.prototype.subEvents=function(){if(this.subs)return;var io=this.io;this.subs=[on(io,"open",bind(this,"onopen")),on(io,"packet",bind(this,"onpacket")),on(io,"close",bind(this,"onclose"))]};Socket.prototype.open=Socket.prototype.connect=function(){if(this.connected)return this;this.subEvents();this.io.open();if("open"==this.io.readyState)this.onopen();return this};Socket.prototype.send=function(){var args=toArray(arguments);args.unshift("message");this.emit.apply(this,args);return this};Socket.prototype.emit=function(ev){if(events.hasOwnProperty(ev)){emit.apply(this,arguments);return this}var args=toArray(arguments);var parserType=parser.EVENT;if(hasBin(args)){parserType=parser.BINARY_EVENT}var packet={type:parserType,data:args};if("function"==typeof args[args.length-1]){debug("emitting packet with ack id %d",this.ids);this.acks[this.ids]=args.pop();packet.id=this.ids++}if(this.connected){this.packet(packet)}else{this.sendBuffer.push(packet)}return this};Socket.prototype.packet=function(packet){packet.nsp=this.nsp;this.io.packet(packet)};Socket.prototype.onopen=function(){debug("transport is open - connecting");if("/"!=this.nsp){this.packet({type:parser.CONNECT})}};Socket.prototype.onclose=function(reason){debug("close (%s)",reason);this.connected=false;this.disconnected=true;this.emit("disconnect",reason)};Socket.prototype.onpacket=function(packet){if(packet.nsp!=this.nsp)return;switch(packet.type){case parser.CONNECT:this.onconnect();break;case parser.EVENT:this.onevent(packet);break;case parser.BINARY_EVENT:this.onevent(packet);break;case parser.ACK:this.onack(packet);break;case parser.BINARY_ACK:this.onack(packet);break;case parser.DISCONNECT:this.ondisconnect();break;case parser.ERROR:this.emit("error",packet.data);break}};Socket.prototype.onevent=function(packet){var args=packet.data||[];debug("emitting event %j",args);if(null!=packet.id){debug("attaching ack callback to event");args.push(this.ack(packet.id))}if(this.connected){emit.apply(this,args)}else{this.receiveBuffer.push(args)}};Socket.prototype.ack=function(id){var self=this;var sent=false;return function(){if(sent)return;sent=true;var args=toArray(arguments);debug("sending ack %j",args);var type=hasBin(args)?parser.BINARY_ACK:parser.ACK;self.packet({type:type,id:id,data:args})}};Socket.prototype.onack=function(packet){debug("calling ack %s with %j",packet.id,packet.data);var fn=this.acks[packet.id];fn.apply(this,packet.data);delete this.acks[packet.id]};Socket.prototype.onconnect=function(){this.connected=true;this.disconnected=false;this.emit("connect");this.emitBuffered()};Socket.prototype.emitBuffered=function(){var i;for(i=0;i=hour)return(ms/hour).toFixed(1)+"h";if(ms>=min)return(ms/min).toFixed(1)+"m";if(ms>=sec)return(ms/sec|0)+"s";return ms+"ms"};debug.enabled=function(name){for(var i=0,len=debug.skips.length;i';iframe=document.createElement(html)}catch(e){iframe=document.createElement("iframe");iframe.name=self.iframeId;iframe.src="javascript:0"}iframe.id=self.iframeId;self.form.appendChild(iframe);self.iframe=iframe}initIframe();data=data.replace(rEscapedNewline,"\\\n");this.area.value=data.replace(rNewline,"\\n");try{this.form.submit()}catch(e){}if(this.iframe.attachEvent){this.iframe.onreadystatechange=function(){if(self.iframe.readyState=="complete"){complete()}}}else{this.iframe.onload=complete}}}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./polling":17,"component-inherit":20}],16:[function(_dereq_,module,exports){(function(global){var XMLHttpRequest=_dereq_("xmlhttprequest");var Polling=_dereq_("./polling");var Emitter=_dereq_("component-emitter");var inherit=_dereq_("component-inherit");var debug=_dereq_("debug")("engine.io-client:polling-xhr");module.exports=XHR;module.exports.Request=Request;function empty(){}function XHR(opts){Polling.call(this,opts);if(global.location){var isSSL="https:"==location.protocol;var port=location.port;if(!port){port=isSSL?443:80}this.xd=opts.hostname!=global.location.hostname||port!=opts.port;this.xs=opts.secure!=isSSL}}inherit(XHR,Polling);XHR.prototype.supportsBinary=true;XHR.prototype.request=function(opts){opts=opts||{};opts.uri=this.uri();opts.xd=this.xd;opts.xs=this.xs;opts.agent=this.agent||false;opts.supportsBinary=this.supportsBinary;opts.enablesXDR=this.enablesXDR;return new Request(opts)};XHR.prototype.doWrite=function(data,fn){var isBinary=typeof data!=="string"&&data!==undefined;var req=this.request({method:"POST",data:data,isBinary:isBinary});var self=this;req.on("success",fn);req.on("error",function(err){self.onError("xhr post error",err)});this.sendXhr=req};XHR.prototype.doPoll=function(){debug("xhr poll");var req=this.request();var self=this;req.on("data",function(data){self.onData(data)});req.on("error",function(err){self.onError("xhr poll error",err)});this.pollXhr=req};function Request(opts){this.method=opts.method||"GET";this.uri=opts.uri;this.xd=!!opts.xd;this.xs=!!opts.xs;this.async=false!==opts.async;this.data=undefined!=opts.data?opts.data:null;this.agent=opts.agent;this.isBinary=opts.isBinary;this.supportsBinary=opts.supportsBinary;this.enablesXDR=opts.enablesXDR;this.create()}Emitter(Request.prototype);Request.prototype.create=function(){var xhr=this.xhr=new XMLHttpRequest({agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR});var self=this;try{debug("xhr open %s: %s",this.method,this.uri);xhr.open(this.method,this.uri,this.async);if(this.supportsBinary){xhr.responseType="arraybuffer"}if("POST"==this.method){try{if(this.isBinary){xhr.setRequestHeader("Content-type","application/octet-stream")}else{xhr.setRequestHeader("Content-type","text/plain;charset=UTF-8")}}catch(e){}}if("withCredentials"in xhr){xhr.withCredentials=true}if(this.hasXDR()){xhr.onload=function(){self.onLoad()};xhr.onerror=function(){self.onError(xhr.responseText)}}else{xhr.onreadystatechange=function(){if(4!=xhr.readyState)return;if(200==xhr.status||1223==xhr.status){self.onLoad()}else{setTimeout(function(){self.onError(xhr.status)},0)}}}debug("xhr data %s",this.data);xhr.send(this.data)}catch(e){setTimeout(function(){self.onError(e)},0);return}if(global.document){this.index=Request.requestsCount++;Request.requests[this.index]=this}};Request.prototype.onSuccess=function(){this.emit("success");this.cleanup()};Request.prototype.onData=function(data){this.emit("data",data);this.onSuccess()};Request.prototype.onError=function(err){this.emit("error",err);this.cleanup()};Request.prototype.cleanup=function(){if("undefined"==typeof this.xhr||null===this.xhr){return}if(this.hasXDR()){this.xhr.onload=this.xhr.onerror=empty}else{this.xhr.onreadystatechange=empty}try{this.xhr.abort()}catch(e){}if(global.document){delete Request.requests[this.index]}this.xhr=null};Request.prototype.onLoad=function(){var data;try{var contentType;try{contentType=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(e){}if(contentType==="application/octet-stream"){data=this.xhr.response}else{if(!this.supportsBinary){data=this.xhr.responseText}else{data="ok"}}}catch(e){this.onError(e)}if(null!=data){this.onData(data)}};Request.prototype.hasXDR=function(){return"undefined"!==typeof global.XDomainRequest&&!this.xs&&this.enablesXDR};Request.prototype.abort=function(){this.cleanup()};if(global.document){Request.requestsCount=0;Request.requests={};if(global.attachEvent){global.attachEvent("onunload",unloadHandler)}else if(global.addEventListener){global.addEventListener("beforeunload",unloadHandler)}}function unloadHandler(){for(var i in Request.requests){if(Request.requests.hasOwnProperty(i)){Request.requests[i].abort()}}}}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./polling":17,"component-emitter":8,"component-inherit":20,debug:9,xmlhttprequest:19}],17:[function(_dereq_,module,exports){var Transport=_dereq_("../transport");var parseqs=_dereq_("parseqs");var parser=_dereq_("engine.io-parser");var inherit=_dereq_("component-inherit");var debug=_dereq_("debug")("engine.io-client:polling");module.exports=Polling;var hasXHR2=function(){var XMLHttpRequest=_dereq_("xmlhttprequest");var xhr=new XMLHttpRequest({xdomain:false});return null!=xhr.responseType}();function Polling(opts){var forceBase64=opts&&opts.forceBase64;if(!hasXHR2||forceBase64){this.supportsBinary=false}Transport.call(this,opts)}inherit(Polling,Transport);Polling.prototype.name="polling";Polling.prototype.doOpen=function(){this.poll()};Polling.prototype.pause=function(onPause){var pending=0;var self=this;this.readyState="pausing";function pause(){debug("paused");self.readyState="paused";onPause()}if(this.polling||!this.writable){var total=0;if(this.polling){debug("we are currently polling - waiting to pause");total++;this.once("pollComplete",function(){debug("pre-pause polling complete");--total||pause()})}if(!this.writable){debug("we are currently writing - waiting to pause");total++;this.once("drain",function(){debug("pre-pause writing complete");--total||pause()})}}else{pause()}};Polling.prototype.poll=function(){debug("polling");this.polling=true;this.doPoll();this.emit("poll")};Polling.prototype.onData=function(data){var self=this;debug("polling got data %s",data);var callback=function(packet,index,total){if("opening"==self.readyState){self.onOpen()}if("close"==packet.type){self.onClose();return false}self.onPacket(packet)};parser.decodePayload(data,this.socket.binaryType,callback);if("closed"!=this.readyState){this.polling=false;this.emit("pollComplete");if("open"==this.readyState){this.poll()}else{debug('ignoring poll - transport state "%s"',this.readyState)}}};Polling.prototype.doClose=function(){var self=this;function close(){debug("writing close packet");self.write([{type:"close"}])}if("open"==this.readyState){debug("transport open - closing");close()}else{debug("transport not open - deferring close");this.once("open",close)}};Polling.prototype.write=function(packets){var self=this;this.writable=false;var callbackfn=function(){self.writable=true;self.emit("drain")};var self=this;parser.encodePayload(packets,this.supportsBinary,function(data){self.doWrite(data,callbackfn)})};Polling.prototype.uri=function(){var query=this.query||{};var schema=this.secure?"https":"http";var port="";if(false!==this.timestampRequests){query[this.timestampParam]=+new Date+"-"+Transport.timestamps++}if(!this.supportsBinary&&!query.sid){query.b64=1}query=parseqs.encode(query);if(this.port&&("https"==schema&&this.port!=443||"http"==schema&&this.port!=80)){port=":"+this.port}if(query.length){query="?"+query}return schema+"://"+this.hostname+port+this.path+query}},{"../transport":13,"component-inherit":20,debug:9,"engine.io-parser":21,parseqs:29,xmlhttprequest:19}],18:[function(_dereq_,module,exports){var Transport=_dereq_("../transport");var parser=_dereq_("engine.io-parser");var parseqs=_dereq_("parseqs");var inherit=_dereq_("component-inherit");var debug=_dereq_("debug")("engine.io-client:websocket");var WebSocket=_dereq_("ws");module.exports=WS;function WS(opts){var forceBase64=opts&&opts.forceBase64;if(forceBase64){this.supportsBinary=false}Transport.call(this,opts)}inherit(WS,Transport);WS.prototype.name="websocket";WS.prototype.supportsBinary=true;WS.prototype.doOpen=function(){if(!this.check()){return}var self=this;var uri=this.uri();var protocols=void 0;var opts={agent:this.agent};this.ws=new WebSocket(uri,protocols,opts);if(this.ws.binaryType===undefined){this.supportsBinary=false}this.ws.binaryType="arraybuffer";this.addEventListeners()};WS.prototype.addEventListeners=function(){var self=this;this.ws.onopen=function(){self.onOpen()};this.ws.onclose=function(){self.onClose()};this.ws.onmessage=function(ev){self.onData(ev.data)};this.ws.onerror=function(e){self.onError("websocket error",e)}};if("undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)){WS.prototype.onData=function(data){var self=this;setTimeout(function(){Transport.prototype.onData.call(self,data)},0)}}WS.prototype.write=function(packets){var self=this;this.writable=false;for(var i=0,l=packets.length;i1){return{type:packetslist[type],data:data.substring(1)}}else{return{type:packetslist[type]}}}var asArray=new Uint8Array(data);var type=asArray[0];var rest=sliceBuffer(data,1);if(Blob&&binaryType==="blob"){rest=new Blob([rest])}return{type:packetslist[type],data:rest}};exports.decodeBase64Packet=function(msg,binaryType){var type=packetslist[msg.charAt(0)];if(!global.ArrayBuffer){return{type:type,data:{base64:true,data:msg.substr(1)}}}var data=base64encoder.decode(msg.substr(1));if(binaryType==="blob"&&Blob){data=new Blob([data])}return{type:type,data:data}};exports.encodePayload=function(packets,supportsBinary,callback){if(typeof supportsBinary=="function"){callback=supportsBinary;supportsBinary=null}if(supportsBinary){if(Blob&&!isAndroid){return exports.encodePayloadAsBlob(packets,callback)}return exports.encodePayloadAsArrayBuffer(packets,callback)}if(!packets.length){return callback("0:")}function setLengthHeader(message){return message.length+":"+message}function encodeOne(packet,doneCallback){exports.encodePacket(packet,supportsBinary,true,function(message){doneCallback(null,setLengthHeader(message))})}map(packets,encodeOne,function(err,results){return callback(results.join(""))})};function map(ary,each,done){var result=new Array(ary.length);var next=after(ary.length,done);var eachWithIndex=function(i,el,cb){each(el,function(error,msg){result[i]=msg;cb(error,result)})};for(var i=0;i0){var tailArray=new Uint8Array(bufferTail);var isString=tailArray[0]===0;var msgLength="";for(var i=1;;i++){if(tailArray[i]==255)break;if(msgLength.length>310){numberTooLong=true;break}msgLength+=tailArray[i]}if(numberTooLong)return callback(err,0,1);bufferTail=sliceBuffer(bufferTail,2+msgLength.length);msgLength=parseInt(msgLength);var msg=sliceBuffer(bufferTail,0,msgLength);if(isString){try{msg=String.fromCharCode.apply(null,new Uint8Array(msg))}catch(e){var typed=new Uint8Array(msg);msg="";for(var i=0;ibytes){end=bytes}if(start>=bytes||start>=end||bytes===0){return new ArrayBuffer(0)}var abv=new Uint8Array(arraybuffer);var result=new Uint8Array(end-start);for(var i=start,ii=0;i>2];base64+=chars[(bytes[i]&3)<<4|bytes[i+1]>>4];base64+=chars[(bytes[i+1]&15)<<2|bytes[i+2]>>6];base64+=chars[bytes[i+2]&63]}if(len%3===2){base64=base64.substring(0,base64.length-1)+"="}else if(len%3===1){base64=base64.substring(0,base64.length-2)+"=="}return base64};exports.decode=function(base64){var bufferLength=base64.length*.75,len=base64.length,i,p=0,encoded1,encoded2,encoded3,encoded4;if(base64[base64.length-1]==="="){bufferLength--;if(base64[base64.length-2]==="="){bufferLength--}}var arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i>4;bytes[p++]=(encoded2&15)<<4|encoded3>>2;bytes[p++]=(encoded3&3)<<6|encoded4&63}return arraybuffer}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],26:[function(_dereq_,module,exports){(function(global){var BlobBuilder=global.BlobBuilder||global.WebKitBlobBuilder||global.MSBlobBuilder||global.MozBlobBuilder;var blobSupported=function(){try{var b=new Blob(["hi"]);return b.size==2}catch(e){return false}}();var blobBuilderSupported=BlobBuilder&&BlobBuilder.prototype.append&&BlobBuilder.prototype.getBlob;function BlobBuilderConstructor(ary,options){options=options||{};var bb=new BlobBuilder;for(var i=0;i=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value)}return output}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint){if((codePoint&4294967168)==0){return stringFromCharCode(codePoint)}var symbol="";if((codePoint&4294965248)==0){symbol=stringFromCharCode(codePoint>>6&31|192)}else if((codePoint&4294901760)==0){symbol=stringFromCharCode(codePoint>>12&15|224);symbol+=createByte(codePoint,6)}else if((codePoint&4292870144)==0){symbol=stringFromCharCode(codePoint>>18&7|240);symbol+=createByte(codePoint,12);symbol+=createByte(codePoint,6)}symbol+=stringFromCharCode(codePoint&63|128);return symbol}function utf8encode(string){var codePoints=ucs2decode(string);var length=codePoints.length;var index=-1;var codePoint;var byteString="";while(++index=byteCount){throw Error("Invalid byte index")}var continuationByte=byteArray[byteIndex]&255;byteIndex++;if((continuationByte&192)==128){return continuationByte&63}throw Error("Invalid continuation byte")}function decodeSymbol(){var byte1;var byte2;var byte3;var byte4;var codePoint;if(byteIndex>byteCount){throw Error("Invalid byte index")}if(byteIndex==byteCount){return false}byte1=byteArray[byteIndex]&255;byteIndex++;if((byte1&128)==0){return byte1}if((byte1&224)==192){var byte2=readContinuationByte();codePoint=(byte1&31)<<6|byte2;if(codePoint>=128){return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&240)==224){byte2=readContinuationByte();byte3=readContinuationByte();codePoint=(byte1&15)<<12|byte2<<6|byte3;if(codePoint>=2048){return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&248)==240){byte2=readContinuationByte();byte3=readContinuationByte();byte4=readContinuationByte();codePoint=(byte1&15)<<18|byte2<<12|byte3<<6|byte4;if(codePoint>=65536&&codePoint<=1114111){return codePoint}}throw Error("Invalid UTF-8 detected")}var byteArray;var byteCount;var byteIndex;function utf8decode(byteString){byteArray=ucs2decode(byteString);byteCount=byteArray.length;byteIndex=0;var codePoints=[];var tmp;while((tmp=decodeSymbol())!==false){codePoints.push(tmp)}return ucs2encode(codePoints)}var utf8={version:"2.0.0",encode:utf8encode,decode:utf8decode};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return utf8})}else if(freeExports&&!freeExports.nodeType){if(freeModule){freeModule.exports=utf8}else{var object={};var hasOwnProperty=object.hasOwnProperty;for(var key in utf8){hasOwnProperty.call(utf8,key)&&(freeExports[key]=utf8[key])}}}else{root.utf8=utf8}})(this)}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],28:[function(_dereq_,module,exports){(function(global){var rvalidchars=/^[\],:{}\s]*$/;var rvalidescape=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;var rvalidtokens=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;var rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g;var rtrimLeft=/^\s+/;var rtrimRight=/\s+$/;module.exports=function parsejson(data){if("string"!=typeof data||!data){return null}data=data.replace(rtrimLeft,"").replace(rtrimRight,"");if(global.JSON&&JSON.parse){return JSON.parse(data)}if(rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,""))){return new Function("return "+data)()}}}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],29:[function(_dereq_,module,exports){exports.encode=function(obj){var str="";for(var i in obj){if(obj.hasOwnProperty(i)){if(str.length)str+="&";str+=encodeURIComponent(i)+"="+encodeURIComponent(obj[i])}}return str};exports.decode=function(qs){var qry={};var pairs=qs.split("&");for(var i=0,l=pairs.length;i1)))/4)-floor((year-1901+month)/100)+floor((year-1601+month)/400)}}if(!(isProperty={}.hasOwnProperty)){isProperty=function(property){var members={},constructor;if((members.__proto__=null,members.__proto__={toString:1},members).toString!=getClass){isProperty=function(property){var original=this.__proto__,result=property in(this.__proto__=null,this);this.__proto__=original;return result}}else{constructor=members.constructor;isProperty=function(property){var parent=(this.constructor||constructor).prototype;return property in this&&!(property in parent&&this[property]===parent[property])}}members=null;return isProperty.call(this,property)}}var PrimitiveTypes={"boolean":1,number:1,string:1,undefined:1};var isHostType=function(object,property){var type=typeof object[property];return type=="object"?!!object[property]:!PrimitiveTypes[type]};forEach=function(object,callback){var size=0,Properties,members,property;(Properties=function(){this.valueOf=0}).prototype.valueOf=0;members=new Properties;for(property in members){if(isProperty.call(members,property)){size++}}Properties=members=null;if(!size){members=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];forEach=function(object,callback){var isFunction=getClass.call(object)==functionClass,property,length;var hasProperty=!isFunction&&typeof object.constructor!="function"&&isHostType(object,"hasOwnProperty")?object.hasOwnProperty:isProperty;for(property in object){if(!(isFunction&&property=="prototype")&&hasProperty.call(object,property)){callback(property)}}for(length=members.length;property=members[--length];hasProperty.call(object,property)&&callback(property));}}else if(size==2){forEach=function(object,callback){var members={},isFunction=getClass.call(object)==functionClass,property;for(property in object){if(!(isFunction&&property=="prototype")&&!isProperty.call(members,property)&&(members[property]=1)&&isProperty.call(object,property)){callback(property)}}}}else{forEach=function(object,callback){var isFunction=getClass.call(object)==functionClass,property,isConstructor;for(property in object){if(!(isFunction&&property=="prototype")&&isProperty.call(object,property)&&!(isConstructor=property==="constructor")){callback(property)}}if(isConstructor||isProperty.call(object,property="constructor")){callback(property)}}}return forEach(object,callback)};if(!has("json-stringify")){var Escapes={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"};var leadingZeroes="000000";var toPaddedString=function(width,value){return(leadingZeroes+(value||0)).slice(-width)};var unicodePrefix="\\u00";var quote=function(value){var result='"',index=0,length=value.length,isLarge=length>10&&charIndexBuggy,symbols;if(isLarge){symbols=value.split("")}for(;index-1/0&&value<1/0){if(getDay){date=floor(value/864e5);for(year=floor(date/365.2425)+1970-1;getDay(year+1,0)<=date;year++);for(month=floor((date-getDay(year,0))/30.42);getDay(year,month+1)<=date;month++);date=1+date-getDay(year,month);time=(value%864e5+864e5)%864e5;hours=floor(time/36e5)%24;minutes=floor(time/6e4)%60;seconds=floor(time/1e3)%60;milliseconds=time%1e3}else{year=value.getUTCFullYear();month=value.getUTCMonth();date=value.getUTCDate();hours=value.getUTCHours();minutes=value.getUTCMinutes();seconds=value.getUTCSeconds();milliseconds=value.getUTCMilliseconds()}value=(year<=0||year>=1e4?(year<0?"-":"+")+toPaddedString(6,year<0?-year:year):toPaddedString(4,year))+"-"+toPaddedString(2,month+1)+"-"+toPaddedString(2,date)+"T"+toPaddedString(2,hours)+":"+toPaddedString(2,minutes)+":"+toPaddedString(2,seconds)+"."+toPaddedString(3,milliseconds)+"Z"}else{value=null}}else if(typeof value.toJSON=="function"&&(className!=numberClass&&className!=stringClass&&className!=arrayClass||isProperty.call(value,"toJSON"))){value=value.toJSON(property)}}if(callback){value=callback.call(object,property,value)}if(value===null){return"null"}className=getClass.call(value);if(className==booleanClass){return""+value}else if(className==numberClass){return value>-1/0&&value<1/0?""+value:"null"}else if(className==stringClass){return quote(""+value)}if(typeof value=="object"){for(length=stack.length;length--;){if(stack[length]===value){throw TypeError()}}stack.push(value);results=[];prefix=indentation;indentation+=whitespace;if(className==arrayClass){for(index=0,length=value.length;index0){for(whitespace="",width>10&&(width=10);whitespace.length=48&&charCode<=57||charCode>=97&&charCode<=102||charCode>=65&&charCode<=70)){abort()}}value+=fromCharCode("0x"+source.slice(begin,Index));break;default:abort()}}else{if(charCode==34){break}charCode=source.charCodeAt(Index);begin=Index;while(charCode>=32&&charCode!=92&&charCode!=34){charCode=source.charCodeAt(++Index)}value+=source.slice(begin,Index)}}if(source.charCodeAt(Index)==34){Index++;return value}abort();default:begin=Index;if(charCode==45){isSigned=true;charCode=source.charCodeAt(++Index)}if(charCode>=48&&charCode<=57){if(charCode==48&&(charCode=source.charCodeAt(Index+1),charCode>=48&&charCode<=57)){abort()}isSigned=false;for(;Index=48&&charCode<=57);Index++);if(source.charCodeAt(Index)==46){position=++Index;for(;position=48&&charCode<=57);position++);if(position==Index){abort()}Index=position}charCode=source.charCodeAt(Index);if(charCode==101||charCode==69){charCode=source.charCodeAt(++Index);if(charCode==43||charCode==45){Index++}for(position=Index;position=48&&charCode<=57);position++);if(position==Index){abort()}Index=position}return+source.slice(begin,Index)}if(isSigned){abort()}if(source.slice(Index,Index+4)=="true"){Index+=4;return true}else if(source.slice(Index,Index+5)=="false"){Index+=5;return false}else if(source.slice(Index,Index+4)=="null"){Index+=4;return null}abort()}}return"$"};var get=function(value){var results,hasMembers;if(value=="$"){abort()}if(typeof value=="string"){if((charIndexBuggy?value.charAt(0):value[0])=="@"){return value.slice(1)}if(value=="["){results=[];for(;;hasMembers||(hasMembers=true)){value=lex();if(value=="]"){break}if(hasMembers){if(value==","){value=lex();if(value=="]"){abort()}}else{abort()}}if(value==","){abort()}results.push(get(value))}return results}else if(value=="{"){results={};for(;;hasMembers||(hasMembers=true)){value=lex();if(value=="}"){break}if(hasMembers){if(value==","){value=lex();if(value=="}"){abort()}}else{abort()}}if(value==","||typeof value!="string"||(charIndexBuggy?value.charAt(0):value[0])!="@"||lex()!=":"){abort()}results[value.slice(1)]=get(lex())}return results}abort()}return value};var update=function(source,property,callback){var element=walk(source,property,callback);if(element===undef){delete source[property]}else{source[property]=element}};var walk=function(source,property,callback){var value=source[property],length;if(typeof value=="object"&&value){if(getClass.call(value)==arrayClass){for(length=value.length;length--;){update(value,length,callback)}}else{forEach(value,function(property){update(value,property,callback)})}}return callback.call(source,property,value)};JSON3.parse=function(source,callback){var result,value;Index=0;Source=""+source;result=get(lex());if(lex()!="$"){abort()}Index=Source=null;return callback&&getClass.call(callback)==functionClass?walk((value={},value[""]=result,value),"",callback):result}}}if(isLoader){define(function(){return JSON3})}})(this)},{}],44:[function(_dereq_,module,exports){module.exports=toArray;function toArray(list,index){var array=[];index=index||0;for(var i=index||0;i