aboutsummaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorKumar Priyansh <[email protected]>2019-06-09 19:25:58 +0530
committerKumar Priyansh <[email protected]>2019-06-09 19:25:58 +0530
commitd19e879609da765d2a9d74990e25ad1761216654 (patch)
treec2234932a97295055e200caa72180e5f3a4ad595 /shared
parentf9649f4578fb73f998f5c7d0e81a3802169a6520 (diff)
downloadfirebase-ecommerce-d19e879609da765d2a9d74990e25ad1761216654.tar.xz
firebase-ecommerce-d19e879609da765d2a9d74990e25ad1761216654.zip
Added Login Page
Diffstat (limited to 'shared')
-rw-r--r--shared/css/main.css3
-rw-r--r--shared/js/Login.js19
2 files changed, 10 insertions, 12 deletions
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)
// ...
});
}