forked from play-with-go/play-with-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
69 lines (63 loc) · 2.25 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
---
layout: plain
---
<script charset="utf-8">
if (localStorage.getItem("authenticated") == "true") {
document.location.href = "guides.html";
}
function performLogin(provider) {
var width = screen.width * 0.6;
var height = screen.height * 0.6;
var x = screen.width / 2 - width / 2;
var y = screen.height / 2 - height / 2;
window.open(
"{{site.pwdurl}}" +
"/oauth/providers/"+provider+"/login",
"PWDLogin",
"width=" + width + ",height=" + height + ",left=" + x + ",top=" + y
);
var eventMethod = window.addEventListener
? "addEventListener"
: "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
// Listen to message from child window
eventer(
messageEvent,
function (e) {
if (e.data === "done") {
localStorage.setItem("authenticated", true);
document.location.href = "guides.html"
}
},
false
);
}
</script>
<div class="landing" style="height: 100%">
<div class="container" >
<div class="text-center">
<h1 class="cover-heading title-guides mt-8" style="color: seashell;">Play with Go</h1>
<p class="lead welcome-par" style="color: seashell;">
Hands-on, interactive guides for programming in Go.</br>
</p>
<div class="container">
<div class="row align-items-center justify-content-center">
<div class="col-xs">
<button onclick="performLogin('google')" class="btn np-login btn-primary btn-welcome">
<img class="img-fluid" src="{{site.baseurl}}/images/google.svg" alt="Text"/>
<span>Sign-in with Google</span>
</button>
</div>
<div class="col-xs">
<button onclick="performLogin('github')" class="btn np-login btn-primary btn-welcome">
<img src="{{site.baseurl}}/images/github.svg" alt="Text"/>
<span>Sign-in with Github</span>
</button>
</div>
</div>
</div>
<img class="img-fluid d-none d-lg-block mt-4" style="max-width: 50%; margin: 0 auto;" alt="Responsive image" src="{{site.baseurl}}/images/playgo.png"/>
</div>
</div>
</div>