Permalink
Browse files

Sledging.

  • Loading branch information...
squaremo committed Apr 15, 2012
1 parent 8fa7dd1 commit 8175e3fd79edf5173ba9d76f338f4e995b2c1cd7
Showing with 16 additions and 15 deletions.
  1. +6 −0 public/css/ponk.css
  2. +5 −3 public/js/ponk.js
  3. +5 −12 public/start.html
View
@@ -32,5 +32,11 @@ div#flash p {
position: absolute;
z-index: 1;
font-size: 4em;
+ font-weight: bold;
color: green;
+ text-align: center;
+}
+
+div#flash p.sledge {
+ color: red;
}
View
@@ -36,7 +36,7 @@ function flash(msg, kind) {
if (kind) elem.addClass(kind);
elem.text(msg);
$('#flash').append(elem);
- elem.fadeOut(function() {
+ elem.fadeOut(1500, function() {
$('#flash').empty();
});
}
@@ -72,7 +72,7 @@ function handleHighscore(payload) {
}
function handleSledge(txt) {
- flash(txt);
+ flash(txt, 'sledge');
}
var handlers = {
@@ -83,7 +83,8 @@ var handlers = {
'stop': handleStop,
'pos': handlePos,
'win': handleWin,
- 'highscore': handleHighscore
+ 'highscore': handleHighscore,
+ 'sledge': handleSledge
};
function die(event) {
@@ -229,4 +230,5 @@ function log(msg) {
$('#sledge').submit(function() {
var txt = $('#insult').val();
sock.send(event('sledge', txt));
+ return false;
});
View
@@ -59,7 +59,11 @@
<div class="span2">
<h2>Chat</h2>
<!-- sledging tools -->
- </div>
+ <form name="sledge" id="sledge">
+ <input type="text" id="insult" name="insult" placeholder="Vous avez un gross nez"/>
+ <input type="submit" value="Fire!"/>
+ </form>
+ </div>
<div class="span8">
<div id="login-window">
<h2>Start a new game...</h2>
@@ -91,17 +95,6 @@ <h2>Scores</h2>
</div>
</div>
- <div class="row">
- <div class="span10">
- <form name="sledge" id="sledge">
- <input type="text" id="insult" name="insult" placeholder="Vous avez un gross nez"/>
- <input type="submit" value="Fling"/>
- </form>
- </div>
- <div class="span2">
- </div>
- </div>
-
<hr>
<footer>

0 comments on commit 8175e3f

Please sign in to comment.