Files
2026-10-22 23:10:45 +11:00

131 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Emberfall — Enter the Shadows</title>
<link rel="stylesheet" href="/css/main.css">
<style>
.landing {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
text-align: center;
padding: 2rem;
background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}
.landing-title {
font-size: 3.5rem;
font-weight: bold;
color: #e94560;
margin-bottom: 0.5rem;
text-shadow: 0 0 20px rgba(233, 69, 96, 0.4);
}
.landing-tagline {
font-size: 1.25rem;
color: #a59a8a;
margin-bottom: 2.5rem;
max-width: 400px;
}
.landing-actions {
display: flex;
gap: 1rem;
flex-wrap: wrap;
justify-content: center;
}
.landing-actions a,
.landing-actions button {
display: inline-block;
padding: 0.75rem 2rem;
border-radius: 4px;
text-decoration: none;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
border: none;
transition: opacity 0.2s, background 0.2s;
}
.landing-actions a:hover,
.landing-actions button:hover {
opacity: 0.85;
}
.btn-login {
background: transparent;
color: #e94560;
border: 2px solid #e94560;
}
.btn-register {
background: #e94560;
color: #fff;
}
.btn-play {
background: #27ae60;
color: #fff;
}
.btn-play:hover {
background: #219a52;
}
.hidden {
display: none !important;
}
</style>
</head>
<body>
<div class="landing">
<h1 class="landing-title">Emberfall</h1>
<p class="landing-tagline">Enter the shadows. Forge your legend.</p>
<div class="landing-actions">
<a href="/login.html" class="btn-login" id="btn-login">Login</a>
<a href="/register.html" class="btn-register" id="btn-register">Register</a>
<a href="/game.html" class="btn-play hidden" id="btn-play">Play</a>
</div>
</div>
<script>
(function () {
var loginBtn = document.getElementById('btn-login');
var registerBtn = document.getElementById('btn-register');
var playBtn = document.getElementById('btn-play');
function showPlay() {
loginBtn.classList.add('hidden');
registerBtn.classList.add('hidden');
playBtn.classList.remove('hidden');
}
function showAuth() {
loginBtn.classList.remove('hidden');
registerBtn.classList.remove('hidden');
playBtn.classList.add('hidden');
}
// Check if user is logged in with a hero
fetch('/api/auth/me', { method: 'GET', credentials: 'include' })
.then(function (res) { return res.json(); })
.then(function (data) {
if (data.ok && data.data && data.data.hasHero) {
showPlay();
} else {
showAuth();
}
})
.catch(function () {
showAuth();
});
})();
</script>
</body>
</html>