Skip to content

Commit 7f7a6cb

Browse files
images
1 parent c1238f0 commit 7f7a6cb

File tree

5 files changed

+115
-1
lines changed

5 files changed

+115
-1
lines changed

FB_btn.png

483 Bytes
Loading

backToGame_btn.png

2.13 KB
Loading

flappyBids.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function create() {
170170
}
171171

172172
function onClickScoreboard(){
173-
window.location.href = "/scoreboard.html?s=" + scoreStringFromScore(score);
173+
window.location.href = "index.html?s=" + scoreStringFromScore(score);
174174
}
175175

176176
function generateWalls(){

index.html

+114
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,127 @@
1313
-webkit-border-radius: 5px;
1414
border-radius: 5px;
1515
}
16+
17+
body {
18+
margin: 0;
19+
padding: 0;
20+
background-color: #000000;
21+
color:#eee;
22+
font-family:Helvetica, Arial, sans-serif;
23+
}
24+
.btns {
25+
height: 60px;
26+
width:320px;
27+
overflow: hidden;
28+
}
29+
30+
.btns a{
31+
height: 60px;
32+
width: 160px;
33+
float: left;
34+
}
35+
36+
.fb-btn {
37+
background: #999;
38+
}
39+
40+
.tw-btn {
41+
background: #888;
42+
}
43+
44+
.btns-i {
45+
width:400px;
46+
}
47+
48+
#scoreboard {
49+
position: absolute;
50+
background: #000;
51+
z-index: 1000;
52+
top: 0;
53+
left:0;
54+
width:320px;
55+
display: none;
56+
}
57+
1658
</style>
59+
1760
<script src="phaser.min.js"></script>
61+
62+
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
63+
64+
1865
</head>
1966
<body>
2067

2168
<script src="flappyBids.js"></script>
69+
<div id="scoreboard">
70+
<a href="index.html">Back to Game</a>
71+
<div id="score"></div>
72+
<div class="btns">
73+
<div class="btns-i">
74+
<a class="fb-btn" href="javascript:void(0);"></a>
75+
<a class="tw-btn" href="javascript:void(0);"></a>
76+
</div>
77+
</div>
78+
<div class="stream">
79+
<a class="twitter-timeline" href="https://twitter.com/search?q=%23flappybids" data-widget-id="435820094212435968">Tweets about "#flappybids"</a></div>
80+
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
81+
</div>
82+
83+
<script type="text/javascript">
84+
function getScore() {
85+
var url = window.location.href;
86+
if(url.indexOf('?s=') >= 0) {
87+
score = url.split('?s=')[1];
88+
document.getElementById('score').innerHTML = 'Your Score: ' + score;
89+
document.getElementById('scoreboard').style.display = 'block';
90+
}
91+
92+
}
93+
94+
function bindBtns() {
95+
$(document).on('click', '.tw-btn', function() {
96+
window.open('https://twitter.com/share?url=https%3A%2F%2Fdev.twitter.com%2Fpages%2Ftweet-button', 'TweetWin', 'outerWidth=600,width=500,innerWidth=400,resizable,scrollbars,status');
97+
return false;
98+
});
2299

100+
$(document).on('click', '.fb-btn', function() {
101+
FB.ui(
102+
{
103+
method: 'feed',
104+
name: 'Facebook Dialogs',
105+
link: 'https://developers.facebook.com/docs/dialogs/',
106+
picture: 'http://fbrell.com/f8.jpg',
107+
caption: 'Reference Documentation',
108+
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
109+
},
110+
function(response) {
111+
if (response && response.post_id) {
112+
alert('Post was published.');
113+
} else {
114+
alert('Post was not published.');
115+
}
116+
}
117+
);
118+
return false;
119+
});
120+
}
121+
122+
$(document).ready(function() {
123+
bindBtns();
124+
});
125+
126+
getScore();
23127
</script>
128+
<script type="text/javascript">
129+
(function(d){
130+
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
131+
js = d.createElement('script'); js.id = id; js.async = true;
132+
js.src = "//connect.facebook.net/en_US/all.js";
133+
d.getElementsByTagName('head')[0].appendChild(js);
134+
}(document));</script>
135+
136+
137+
24138
</body>
25139
</html>

twitter_btn.png

952 Bytes
Loading

0 commit comments

Comments
 (0)