forked from robertcedwards/HIT-timer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
81 lines (71 loc) · 2.64 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<html>
<head>
<script type="text/javascript" src="https://cdn.firebase.com/v0/firebase.js"></script>
<script type="text/javascript" src="https://cdn.firebase.com/v0/firebase-auth-client.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js"></script>
<script type="text/javascript" src="http://hiroshi.github.io/knockoutFire/knockoutfire-0.0.4.js"></script>
<script type="text/javascript" src="js/moment.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<h1>Konami - Easter Egging at it's best</h1>
<section id="konami">
<!-- ko with: konami.newItem -->
<form data-bind="submit: create">
<label>Name</label>
<input id="title" type="text" name="title" placeholder="Vogue.com raptor attack" data-bind="value: title, valueUpdate: 'keyup'">
<label>Website Url</label>
<input type="text" name="website" placeholder="http://vogue.co.uk" data-bind="value: website, valueUpdate: 'keyup'">
<label>Description</label>
<input type="text" name="desc"placeholder="Vogue Site features a raptor easter egg that pops up random raptors with hats" data-bind="value: desc, valueUpdate: 'keyup'">
<label>Thumbnail URL</label>
<input type="text" name="thumb"placeholder="http://dl.dropbox.com/u/980/Screenshots/dtyl~0k65_tp.png" data-bind="value: thumb, valueUpdate: 'keyup'">
<span class="form-actions">
<button type="submit">Submit</button>
<button type="submit">Reset</button>
</span>
</form>
<!-- /ko -->
<ul data-bind="foreach: konami">
<li>
<a class="remove" data-bind="click: $parent.removeItem" href="#">[x]</a>
<h2 data-bind="text: title"></h2>
</li>
<li>
</li>
<li>
<label>Description</label>
<p type="text" data-bind="text: desc"></p>
<a name="thumb" data-bind="attr:{href: website}">
<img data-bind="attr:{src: thumb}"/>
</a>
<hr/>
</li>
</ul>
</section>
<script>
var now = moment().format();
var url = "https://konami-codes.firebaseio.com/"
var firebase = new Firebase(url);
var viewModel = {
"konami": KnockoutFire.observable(
firebase, {
"$konami": {
"title": true,
"website": true,
"desc": true,
"thumb": true
},
".newItem": {
".priority": function() { return Date.now() }
}
}
),
"removeItem": function(item) {
firebase.child(item.firebase.name()).remove();
}
};
ko.applyBindings(viewModel, document.getElementById("konami"));
</script>
</body>
</html>