Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 35 additions & 52 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@

<!DOCTYPE html>
<html lang="en">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">

<head>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">


<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand All @@ -25,20 +32,18 @@
<!-- Custom styles for this template -->
<link href="jumbotron-narrow.css" rel="stylesheet">
<style type="text/css">
body {background-color: #9CB2FA !important;}
.jumbotron {
text-align: left;
}

.jumbotron h1 {
font-size: 40px;
}

@media (min-width: 768px) {
.container {
max-width: initial;
}
}

#user {
margin: 10px 0;
}
Expand All @@ -50,72 +55,44 @@
<![endif]-->
</head>

<body>
<script src="md5.js"> </script>
<body bgcolor="9CB2FA">
<script src="https://www.gstatic.com/firebasejs/3.4.0/firebase.js"></script>
<script>
window.onload = function(){
var config = {
apiKey: " ",
authDomain: "linkblue-145814.firebaseio.com",
databaseURL: "https://linkblue-145814.firebaseio.com",
storageBucket: "gs://linkblue-145814.appspot.com"
};
firebase.initializeApp(config);
}
function onSignIn(googleUser) {
// Useful data for your client-side scripts:
// var ref = new Firebase("https://docs-examples.firebaseio.com/web/saving-data/fireblog");
/*ref.on("value", function(snapshot) {
var config = {
apiKey: " ",
authDomain: "linkblue-145814.firebaseio.com",
databaseURL: "https://linkblue-145814.firebaseio.com",
storageBucket: "gs://linkblue-145814.appspot.com"
};
firebase.initializeApp(config);
/*var ref = firebase.database().ref("profiles");
ref.on("value", function(snapshot) {
console.log(snapshot.val());
}, function(errorObject) {
console.log("The read failed: " + errorObject.code);
});*/
var usersRef = firebase.database().ref("ID");
/*usersRef.set({
alanisawesome: {
date_of_birth: "June 23, 1912",
full_name: "Alan Turing"
},
gracehop: {
date_of_birth: "December 9, 1906",
full_name: "Grace Hopper"
}
});*/
/*firebase.database().ref("asdf1234").set({
firebase.database().ref("asdf1234").set({
"bloodType": "O",
"numToes": 10
});
firebase.database().ref("asdf2231").set({
"bloodType": "B",
"numToes": 10
});*/
});
var profile = googleUser.getBasicProfile();
/*console.log("ID: " + profile.getId()); // Don't send this directly to your server!
console.log("ID: " + profile.getId()); // Don't send this directly to your server!
console.log('Full Name: ' + profile.getName());
console.log('Given Name: ' + profile.getGivenName());
console.log('Family Name: ' + profile.getFamilyName());
console.log("Image URL: " + profile.getImageUrl());
console.log("Email: " + profile.getEmail());*/
console.log("Email: " + profile.getEmail());
document.getElementById('user').innerHTML = "Logged in as: " + profile.getEmail();

// The ID token you need to pass to your backend:
var id_token = googleUser.getAuthResponse().id_token;
console.log("ID Token: " + id_token);
var hasProfile = false;
usersRef.on("value", function(snapshot) {
idObj = snapshot.val();
hasProfile = idObj && md5(profile.getEmail())+"" in idObj;
});
console.log(hasProfile);
if(hasProfile){
document.getElementById('loggedOpt').innerHTML =
'<div class="col-lg-6"><h4><a href="quiz.html">Retake Quiz</a></h4><p>Take the quiz to find your social mate.</p></div><div class="col-lg-6"><h4><a href="match.html">Look for Matches</a></h4><p>Now that you have completed the quiz, you can find your match!</p></div>';
} else{
document.getElementById('quiz').innerHTML = '<form action="quiz.html"><input type="submit" class="btn btn-info" value="Take Quiz"></form>';
document.getElementById('loggedOpt').innerHTML =
'<div class="col-lg-6"><h4><a href="quiz.html">Take Quiz</a></h4><p>Take the quiz to find your social mate.</p></div><div class="col-lg-6"><h4>Look for Matches</h4><p>Finish the quiz, then look for matches.</p></div>';
}
// The ID token you need to pass to your backend:

};
</script>

Expand All @@ -124,8 +101,8 @@
<nav>
<ul class="nav nav-pills pull-right">
<li role="presentation" class="active"><a href="index.html">Home</a></li>
<li role="presentation"><a href="#">About</a></li>
<li role="presentation"><a href="#">Contact</a></li>
<li role="presentation" class="active"><a href="about.html">About</a></li>
<li role="presentation" class="active"><a href="contact.html">Contact</a></li>
</ul>
</nav>
<h3 class="text-muted">Link Blue</h3>
Expand All @@ -141,19 +118,25 @@ <h1>Meet someone new in 5 minutes</h1>
</p>
</div>

<div class="row marketing" id="loggedOpt">
</div>

<footer class="footer">
<p>&copy; 2016 Link Blue</p>
</footer>

<div class="footer-social">
<span>Connect with us:</span>
<ul>
<li><a href="http://www.facebook.com"><img src='https://cdn3.iconfinder.com/data/icons/material-design-social-icons/152/facebook_icon-24.png' /></a></li>
<li><a href="http://www.twitter.com"><img src='https://cdn3.iconfinder.com/data/icons/material-design-social-icons/152/Twitter_icon-24.png' /></a></li>
<li><a href="http://plus.google.com"><img src='https://cdn3.iconfinder.com/data/icons/material-design-social-icons/152/google_plus_icon-24.png' /></a></li></ul>
</div>

</div>
<!-- /container -->


<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="ie10-viewport-bug-workaround.js"></script>
</body>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">

</html>