diff --git a/demo.css b/demo.css new file mode 100644 index 0000000..41b20dc --- /dev/null +++ b/demo.css @@ -0,0 +1,57 @@ +body{ + background-image: url("http://www.designbolts.com/wp-content/uploads/2012/11/Free-Simple-Black-Seamless-Pattern-for-Website-Background.jpg"); + margin: 20px; + padding: 10px; + +} +h1{ + color: white; + font-family: comic sans ms; + text-align: center; + font-size: 40px; + margin-bottom: 30px; +} +p{ + font-size: 18px; + font-family: comic sans ms; + margin: 10px; + padding: 10px; + text-align: center; + color: white; +} +#username{ + font-size: 15px; + font-family: times new roman; + padding: 5px; + margin: 10px; + text-align: center; + border: 2px,solid,white; + border-radius: 5px; + +} +#password{ + font-size: 15px; + font-family: times new roman; + padding: 5px; + margin: 10px; + text-align: center; + border: 2px,solid,white; + border-radius: 5px; +} +#btn{ + font-family: comic sans ms; + font-size: px; + border-radius: 5px; + width: 205px; + margin: 25px; + padding: 5px; + background-color: #ccc; +} + +.t{ + font-size: 20px; + font-weight: bold; + color: white; + font-family: comic sans ms; + margin: 2px; +} \ No newline at end of file diff --git a/demo.html b/demo.html new file mode 100644 index 0000000..01417e1 --- /dev/null +++ b/demo.html @@ -0,0 +1,30 @@ + + + + + + + +

Project Lumos!

+
+
+
+ Username : +
+
+
+ Password : +
+
+
+ +
+ +

Do not have an account? sign up

+

+
+ + + + + \ No newline at end of file diff --git a/login.js b/login.js new file mode 100644 index 0000000..9cf12f8 --- /dev/null +++ b/login.js @@ -0,0 +1,56 @@ +var xmlHttp = createXmlHttpRequestObject(); + +function createXmlHttpRequestObject(){ + var xmlHttp; + + if(window.XMLHttpRequest){ + xmlHttp = new XMLHttpRequest(); + }else{ + xmlHttp = new ActiveXObject("microsoft.XMLHTTP"); + } + + return xmlHttp; +} + + +function login(){ + var username=document.getElementById('username').value; + var password=document.getElementById('password').value; + var senddata="username="+username+"&password="+password; + username.value=''; + password.value=''; + + if(xmlHttp){ + try{ + xmlHttp.open("POST","Http://moodshare.herokuapp.com/login",true); + xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); + xmlHttp.setRequestHeader("Access-Control-Allow-Origin","*"); + xmlHttp.onreadystatechange = handleServerResponse; + xmlHttp.send(senddata); + }catch(e){ + alert( e.toString() ); + } + } + +} + + +function handleServerResponse(){ + theD = document.getElementById('theD'); + if(xmlHttp.readyState==4){ + if(xmlHttp.status==202){ + try{ + text=xmlHttp.responseText; + theD.innerHTML+=text + + }catch(e){ + alert(e.toString()); + } + }else{ + alert(xmlHttp.statusText); + } + } +} + +username.focus(); +