Login
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f2f2f2;
}
.login-box {
background-color: #fff;
border-radius: 15px;
padding: 40px;
width: 300px;
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
}
.login-box h2 {
text-align: center;
margin-bottom: 30px;
}
.input-box {
margin-bottom: 20px;
}
.input-box input {
width: 100%;
padding: 10px;
border-radius: 10px;
border: 1px solid #ccc;
box-sizing: border-box;
}
.login-btn {
width: 100%;
padding: 10px;
background-color: orange;
border: none;
border-radius: 10px;
color: white;
font-size: 16px;
cursor: pointer;
}
.login-btn:disabled {
background-color: grey;
cursor: not-allowed;
}
.login-btn.green {
background-color: green;
}
.login-btn.red {
background-color: red;
}
.error-message {
color: red;
text-align: center;
margin-top: 10px;
display: none;
}
.success-message {
color: green;
text-align: center;
margin-top: 10px;
display: none;
}
function validateLogin() {
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
var loginBtn = document.getElementById('login-btn');
var errorMessage = document.getElementById('error-message');
var successMessage = document.getElementById('success-message');
if (username && password) {
google.script.run.withSuccessHandler(function(valid) {
if (valid) {
loginBtn.classList.add('green');
successMessage.style.display = 'block';
errorMessage.style.display = 'none';
setTimeout(function() {
window.location.href = 'https://sanadischools.com/'; // Redirect link
}, 2000);
} else {
loginBtn.classList.add('red');
errorMessage.style.display = 'block';
successMessage.style.display = 'none';
}
}).checkCredentials(username, password);
}
}
Login
Invalid Credentials
Login Successful