A Pen by Alex Persian on CodePen.
Created
November 23, 2014 20:26
-
-
Save alexpersian/e1e07169f3c5c0f19eae to your computer and use it in GitHub Desktop.
VYLZdw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Halo: The Master Chief Collection</h1> | |
<p id="status">SEARCHING FOR PLAYERS...</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 0; | |
var message = document.getElementById("status"); | |
setInterval(function() { | |
if (count === 0) { | |
message.innerHTML = "SEARCHING FOR PLAYERS..."; | |
count++; | |
} else if (count === 1) { | |
message.innerHTML = "PLAYERS FOUND..."; | |
count++; | |
} else if (count === 2) { | |
message.innerHTML = "CONNECTING SESSION..."; | |
count++; | |
} else if (count === 3) { | |
alert("Connection to the host has failed."); | |
count = 0; | |
} else { | |
count = 0; | |
} | |
}, 5000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1 { | |
text-align: center | |
} | |
p { | |
text-align: center | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment