-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
71 lines (66 loc) · 2.12 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
<title>a leaf on the wind</title>
<script src=goodies.js></script>
<script src=glider.js></script>
<script src=grav.js></script>
<link rel=stylesheet href=./fb-buttons.css />
<style>
#fbld {
position: absolute;
bottom: 10px;
left: 10px;
}
.hidden {
display: none;
}
.wide {
width: 100%;
}
</style>
<meta property="fb:app_id" content="207758649408103" />
<body onload=go()>
<canvas style="border:2px solid #ccc;" id=c></canvas>
<div id=fbld class=hidden>
<fb:login-button id=fbl show-faces="true" width="100" max-rows="1" scope=publish_actions></fb:login-button>
<span id=in class=hidden>
<div><input type=button class="uibutton confirm wide" onclick=challenge() value="Challenge a Friend"></div>
<div><input type=button class="uibutton confirm wide" onclick=brag() value="Brag about your Score"></div>
</span>
</div>
<div id="fb-root"></div>
<script>
connected = false;
window.fbAsyncInit = function() {
FB.init({
appId : '207758649408103', // App ID from the app dashboard
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
FB.getLoginStatus(function(response) {
console.log(response);
if (response.authResponse) {
connected = true;
document.getElementById('in').classList.remove('hidden');
} else{
connected = false;
}
}, true);
FB.Event.subscribe('auth.authResponseChange', function (response) {
if (response.authResponse) {
document.getElementById('in').classList.remove('hidden');
connected = true;
} else {
connected = false;
}
});
};
// Load the SDK asynchronously
(function(){
if (document.getElementById('facebook-jssdk')) {return;}
var firstScriptElement = document.getElementsByTagName('script')[0];
var facebookJS = document.createElement('script');
facebookJS.id = 'facebook-jssdk';
facebookJS.src = '//connect.facebook.net/en_US/all.js';
firstScriptElement.parentNode.insertBefore(facebookJS, firstScriptElement);
}());
</script>
</body>