Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (48 sloc) 2.85 KB
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<a class="brand">Twilio Madlibs</a>
<div class="container">
<div class="hero-unit">
<span class="machine-input">There was once a young prince whose name was Devon Peticolas. He loved to </span><strong><span class="verb unfilled">Verb</span></strong><span class="machine-input"> and</span><strong><span class="verb unfilled">Verb</span></strong><span class="machine-input"> all day. One day a(n)</span><strong><span class="adjective unfilled"> Adjective </span></strong><strong><span class="noun unfilled"> Noun </span></strong><span class="machine-input"> came to visit the castle. This </span><strong><span class="noun unfilled">Noun</span></strong><span class="machine-input">brought seventy-two different types of hackathon projects with them to share. Devon decided that he wanted to spend time with the visitors and offer them some awesome prizes. The visitor told the prince he had a gift for him. This gift was made out of</span><strong><span class="adjective unfilled"> Adjective </span></strong><strong><span class="noun unfilled"> Noun </span></strong><span class="machine-input">, and he was told that it would make him</span><strong><span class="adjective unfilled"> Adjective </span></strong><span class="machine-input">Devon took the gift, and when he woke the next morning he found that his</span><strong><span class="noun unfilled"> Noun </span></strong><span class="machine-input">was filled with</span><strong><span class="adjective unfilled"> Adjective </span></strong><span class="machine-input">computers.</span><span><strong>The end</strong></span>
<script src=""></script>
<script src=""></script>
<script src="/"></script>
var socket = io.connect();
socket.on("message", function(data){
var partsOfSpeech = data.partsOfSpeech;
if(partsOfSpeech != undefined){
for(var i = 0; i<partsOfSpeech.length; i++){
var unfilledObj = $("."+partsOfSpeech[i] + ".unfilled:first");
if(unfilledObj.length > 0){
unfilledObj.text(" " + data.word + " ");;
unfilledObj.css("display", "");
if($(".unfilled").length === 0){
console.log("into the no length statement");
$(".machine-input").animate({opacity: 1}, 350);
socket.emit('completed', {message: jQuery.trim($(".hero-unit").text())});
console.log("emitted a completed message");