forked from Nixius/authelia
1
0
Fork 0
ATLAS/docker/ss-atlas/templates/pages/activate.html

176 lines
6.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>a250.ca - Activate</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #0f1117;
--surface: #1a1d27;
--border: #2a2d3a;
--text: #e4e4e7;
--muted: #a1a1aa;
--accent: #6366f1;
--accent-hover: #818cf8;
--green: #22c55e;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem;
}
.container { max-width: 520px; width: 100%; }
.logo { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 0.5rem; }
.subtitle { font-size: 1.1rem; font-weight: 600; margin-bottom: 2rem; }
.subtitle-green { color: var(--green); }
.subtitle-muted { color: var(--muted); }
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 2rem;
text-align: center;
}
.card h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.75rem; }
.card p { color: var(--muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.5rem; }
.btn {
display: inline-block;
background: var(--accent);
color: #fff;
border: none;
border-radius: 8px;
padding: 0.75rem 2rem;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
text-decoration: none;
transition: background 0.2s;
}
.btn:hover { background: var(--accent-hover); }
.btn-outline {
background: transparent;
border: 1px solid var(--accent);
color: var(--accent);
padding: 0.5rem 1rem;
font-size: 0.9rem;
border-radius: 6px;
cursor: pointer;
transition: opacity 0.2s;
}
.btn-outline:hover:not(:disabled) { opacity: 0.9; }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }
.resend { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.resend p { margin-bottom: 0.5rem; font-size: 0.9rem; }
.resend input { margin-right: 0.5rem; padding: 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 12rem; }
.resend .msg { font-size: 0.85rem; margin-top: 0.5rem; }
.resend .msg.success { color: var(--green); }
.resend .msg.error { color: #ef4444; }
.icon {
font-size: 3rem;
margin-bottom: 1rem;
display: block;
}
</style>
{{template "analytics"}}
</head>
<body>
<div class="container">
<div class="logo">a250.ca</div>
{{if .NeedLogin}}
<div class="subtitle subtitle-muted">Almost there</div>
<div class="card">
<span class="icon">&#128274;</span>
<h2>Sign In First</h2>
<p>You need to sign in with your new password before activating your stack. If you haven't set your password yet, do that first.</p>
<a href="{{.AutheliaURL}}" class="btn">Sign In</a>
<div class="resend">
<p>Didn't get the setup email?</p>
<form id="resend-form">
<input type="email" name="email" placeholder="Your email" required>
<button type="submit" class="btn-outline" id="resend-btn">Resend</button>
</form>
<p class="msg" id="resend-msg"></p>
</div>
</div>
<script>
(function() {
var form = document.getElementById('resend-form');
if (!form) return;
var btn = document.getElementById('resend-btn');
var msg = document.getElementById('resend-msg');
var cooldown = 0, interval;
function setCooldown(sec) {
cooldown = sec;
btn.disabled = true;
btn.textContent = 'Resend (' + sec + 's)';
if (interval) clearInterval(interval);
interval = setInterval(function() {
cooldown--;
if (cooldown <= 0) {
clearInterval(interval);
btn.disabled = false;
btn.textContent = 'Resend';
return;
}
btn.textContent = 'Resend (' + cooldown + 's)';
}, 1000);
}
form.addEventListener('submit', function(e) {
e.preventDefault();
btn.disabled = true;
msg.textContent = '';
fetch('/resend-reset', {
method: 'POST',
body: new FormData(form),
headers: { 'X-Requested-With': 'XMLHttpRequest' }
}).then(function(r) {
return r.json().then(function(data) {
if (data.ok) {
msg.textContent = data.message;
msg.className = 'msg success';
setCooldown(60);
} else if (data.retry_after_seconds) {
msg.textContent = data.error + ' Try again in ' + data.retry_after_seconds + 's.';
msg.className = 'msg error';
setCooldown(data.retry_after_seconds);
} else {
msg.textContent = data.error;
msg.className = 'msg error';
btn.disabled = false;
btn.textContent = 'Resend';
}
});
}).catch(function() {
msg.textContent = 'Something went wrong. Please try again.';
msg.className = 'msg error';
btn.disabled = false;
btn.textContent = 'Resend';
});
});
})();
</script>
{{else if .Ready}}
<div class="subtitle subtitle-green">Welcome, {{.User}}</div>
<div class="card">
<span class="icon">&#9889;</span>
<h2>Activate Your Stack</h2>
<p>Your account is verified. Click below to provision your dedicated environment and get full access.</p>
<form method="POST" action="/activate">
<button type="submit" class="btn">Activate Now</button>
</form>
</div>
{{end}}
</div>
</body>
</html>