From d19e879609da765d2a9d74990e25ad1761216654 Mon Sep 17 00:00:00 2001 From: Kumar Priyansh Date: Sun, 9 Jun 2019 19:25:58 +0530 Subject: Added Login Page --- index.html | 2 +- login/index.html | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++ shared/css/main.css | 3 ++ shared/js/Login.js | 19 +++++-------- 4 files changed, 93 insertions(+), 13 deletions(-) create mode 100644 login/index.html diff --git a/index.html b/index.html index 9b3bc94..9dd56b9 100644 --- a/index.html +++ b/index.html @@ -88,6 +88,6 @@ - + diff --git a/login/index.html b/login/index.html new file mode 100644 index 0000000..4556d30 --- /dev/null +++ b/login/index.html @@ -0,0 +1,82 @@ + + + + + + + Firebase ECommerce Solution + + + + +
+
+
+ Message + +
+
+ Hello, world! This is a toast message. +
+
+
+ +
+
+
+ Login to Firebase ECommerce +
+
+
+ + + We'll never share your email with anyone else. +
+
+ + +
+ +
+
+
+ + + + + + + + diff --git a/shared/css/main.css b/shared/css/main.css index 9b97325..5b21812 100644 --- a/shared/css/main.css +++ b/shared/css/main.css @@ -1,6 +1,9 @@ .padded { padding: 0px 0px 30px 0px; } +.padded-top{ + padding: 50px; +} .padded-bar { padding: 10px 0px 5px 10px; } diff --git a/shared/js/Login.js b/shared/js/Login.js index d8352eb..e1b9d3c 100644 --- a/shared/js/Login.js +++ b/shared/js/Login.js @@ -1,25 +1,20 @@ $(document).ready(function(){ - function showAlert(message) { - // Get the snackbar DIV - var x = document.getElementById("snackbar"); - $('#snackbar').text(message) - // Add the "show" class to DIV - x.className = "show"; - - // After 3 seconds, remove the show class from DIV - setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); - } + function showAlert(message, body) { + $('#message').text(message); + $('#body').text(body) + $('.toast').toast('show') + } $('#login').click(function(){ var email = $("#email").val() var password = $("#password").val() if(email === '' || password === '') { - showAlert('Please fill in all the fields') + showAlert('Error', 'Please fill in all the fields') } else { firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) { // Handle Errors here. var errorCode = error.code; var errorMessage = error.message; - showAlert(errorMessage) + showAlert('Error',errorMessage) // ... }); } -- cgit v1.2.3