Tailwind Upgrade
This commit is contained in:
+21
-138
@@ -4,143 +4,26 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Sign In</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/pocketbase@0.26.5/dist/pocketbase.umd.js"></script>
|
||||
<script src="auth.js"></script>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.container {
|
||||
background: white;
|
||||
padding: 3rem;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
|
||||
text-align: center;
|
||||
max-width: 400px;
|
||||
width: 90%;
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
p {
|
||||
color: #666;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
button {
|
||||
background: #0078d4;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 0.875rem 2rem;
|
||||
font-size: 1rem;
|
||||
border-radius: 0.375rem;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
font-weight: 500;
|
||||
}
|
||||
button:hover:not(:disabled) {
|
||||
background: #005a9e;
|
||||
}
|
||||
button:disabled {
|
||||
background: #ccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.user-info {
|
||||
display: none;
|
||||
margin-top: 2rem;
|
||||
text-align: left;
|
||||
background: #f8f9fa;
|
||||
padding: 1.5rem;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
.user-info h2 {
|
||||
font-size: 1.125rem;
|
||||
margin-bottom: 1rem;
|
||||
color: #333;
|
||||
}
|
||||
.user-info p {
|
||||
margin-bottom: 0.75rem;
|
||||
color: #555;
|
||||
word-break: break-all;
|
||||
}
|
||||
.user-info strong {
|
||||
color: #333;
|
||||
}
|
||||
.error {
|
||||
color: #d32f2f;
|
||||
margin-top: 1rem;
|
||||
display: none;
|
||||
}
|
||||
.logout-btn {
|
||||
background: #6c757d;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.logout-btn:hover {
|
||||
background: #5a6268;
|
||||
}
|
||||
.notes-section {
|
||||
display: none;
|
||||
margin-top: 2rem;
|
||||
text-align: left;
|
||||
}
|
||||
.notes-section h3 {
|
||||
font-size: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
color: #333;
|
||||
}
|
||||
textarea {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 0.375rem;
|
||||
font-family: inherit;
|
||||
font-size: 0.9rem;
|
||||
resize: vertical;
|
||||
min-height: 80px;
|
||||
}
|
||||
textarea:focus {
|
||||
outline: none;
|
||||
border-color: #0078d4;
|
||||
}
|
||||
.submit-btn {
|
||||
margin-top: 0.75rem;
|
||||
width: 100%;
|
||||
}
|
||||
.success {
|
||||
color: #2e7d32;
|
||||
margin-top: 0.75rem;
|
||||
display: none;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Welcome</h1>
|
||||
<p>Sign in with your Microsoft account</p>
|
||||
<body class="font-sans bg-gradient-to-br from-indigo-500 to-purple-600 min-h-screen flex items-center justify-center">
|
||||
<div class="bg-white p-12 rounded-2xl shadow-2xl text-center max-w-md w-[90%]">
|
||||
<h1 class="text-gray-800 mb-2 text-3xl">Welcome</h1>
|
||||
<p class="text-gray-600 mb-8">Sign in with your Microsoft account</p>
|
||||
|
||||
<button id="loginBtn" onclick="login()">Sign in with Microsoft</button>
|
||||
<button id="loginBtn" onclick="login()" class="bg-blue-600 text-white border-none py-3.5 px-8 text-base rounded-md cursor-pointer transition-colors duration-200 font-medium hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed">Sign in with Microsoft</button>
|
||||
|
||||
<div class="error" id="error"></div>
|
||||
<div class="text-red-600 mt-4 hidden" id="error"></div>
|
||||
|
||||
<div class="user-info" id="userInfo">
|
||||
<h2>Signed in</h2>
|
||||
<p><strong>Name:</strong> <span id="displayName"></span></p>
|
||||
<p><strong>Email:</strong> <span id="email"></span></p>
|
||||
<div class="hidden mt-8 text-left bg-gray-50 p-6 rounded-lg" id="userInfo">
|
||||
<h2 class="text-lg mb-4 text-gray-800">Signed in</h2>
|
||||
<p class="mb-3 text-gray-600 break-all"><strong class="text-gray-800">Name:</strong> <span id="displayName"></span></p>
|
||||
<p class="mb-3 text-gray-600 break-all"><strong class="text-gray-800">Email:</strong> <span id="email"></span></p>
|
||||
|
||||
<button id="continueBtn" style="display:none;margin-top:1rem;" onclick="goToIndex()">Continue to Job Info</button>
|
||||
<button class="logout-btn" onclick="logout()">Sign out</button>
|
||||
<button id="continueBtn" onclick="goToIndex()" class="hidden mt-4 bg-blue-600 text-white border-none py-3.5 px-8 text-base rounded-md cursor-pointer transition-colors duration-200 font-medium hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed w-full">Continue to Job Info</button>
|
||||
<button onclick="logout()" class="bg-gray-600 text-white border-none py-3.5 px-8 text-base rounded-md cursor-pointer transition-colors duration-200 font-medium hover:bg-gray-700 mt-4">Sign out</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -157,11 +40,11 @@
|
||||
}
|
||||
|
||||
function showAuthedUI(displayName, email) {
|
||||
loginBtn.style.display = 'none';
|
||||
loginBtn.classList.add('hidden');
|
||||
loginBtn.disabled = false;
|
||||
loginBtn.textContent = 'Sign in with Microsoft';
|
||||
userInfo.style.display = 'block';
|
||||
continueBtn.style.display = 'block';
|
||||
userInfo.classList.remove('hidden');
|
||||
continueBtn.classList.remove('hidden');
|
||||
document.getElementById('displayName').textContent = displayName || 'Unknown';
|
||||
document.getElementById('email').textContent = email || 'Not available';
|
||||
}
|
||||
@@ -169,7 +52,7 @@
|
||||
async function login() {
|
||||
loginBtn.disabled = true;
|
||||
loginBtn.textContent = 'Signing in...';
|
||||
errorEl.style.display = 'none';
|
||||
errorEl.classList.add('hidden');
|
||||
|
||||
try {
|
||||
const authData = await pb.collection('users').authWithOAuth2({
|
||||
@@ -179,7 +62,7 @@
|
||||
} catch (error) {
|
||||
console.error('Login failed:', error);
|
||||
errorEl.textContent = error.message || 'Authentication failed. Please try again.';
|
||||
errorEl.style.display = 'block';
|
||||
errorEl.classList.remove('hidden');
|
||||
loginBtn.disabled = false;
|
||||
loginBtn.textContent = 'Sign in with Microsoft';
|
||||
}
|
||||
@@ -187,9 +70,9 @@
|
||||
|
||||
function logout() {
|
||||
pb.authStore.clear();
|
||||
loginBtn.style.display = 'block';
|
||||
userInfo.style.display = 'none';
|
||||
continueBtn.style.display = 'none';
|
||||
loginBtn.classList.remove('hidden');
|
||||
userInfo.classList.add('hidden');
|
||||
continueBtn.classList.add('hidden');
|
||||
loginBtn.disabled = false;
|
||||
loginBtn.textContent = 'Sign in with Microsoft';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user