jtvidela's picture
Update templates/index.html
76f3f04 verified
<!DOCTYPE html>
<html>
<head>
<title>My Landing Page</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
padding: 50px;
}
form {
margin: 20px auto;
padding: 10px;
display: inline-block;
text-align: left;
border: 1px solid #ccc;
border-radius: 5px;
width: 300px;
background-color: #f9f9f9;
}
input, button {
display: block;
width: 90%;
margin: 10px auto;
padding: 10px;
font-size: 14px;
}
.form-header {
text-align: center;
font-weight: bold;
margin-bottom: 10px;
}
#links {
display: none; /* Initially hidden, shown after successful login */
}
a {
display: block;
margin: 10px;
padding: 10px;
background-color: #0078D4;
color: white;
text-decoration: none;
border-radius: 5px;
width: 200px;
margin-left: auto;
margin-right: auto;
}
a:hover {
background-color: #005BB5;
}
</style>
</head>
<body>
<h1>Welcome to My Spaces!</h1>
<!-- Login Form -->
<form action="/login" method="POST">
<div class="form-header">Login</div>
<label for="login-username">Username:</label>
<input type="text" id="login-username" name="username" required>
<label for="login-password">Password:</label>
<input type="password" id="login-password" name="password" required>
<button type="submit">Login</button>
</form>
<!-- Registration Form -->
<form action="/register" method="POST">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<button type="submit">Register</button>
</form>
<!-- Links Section -->
<div id="links">
<p>Select a Space to explore:</p>
<a href="https://huggingface.co/spaces/jtvidela/signpost_assistant" target="_blank">Space 1</a>
<a href="https://huggingface.co/spaces/jtvidela/StoryCompass" target="_blank">Space 2</a>
<a href="https://huggingface.co/spaces/username/space3" target="_blank">Space 3</a>
</div>
<script>
// Check if user is logged in
const loggedIn = document.cookie.includes('logged_in=true');
if (loggedIn) {
document.getElementById('links').style.display = 'block';
}
</script>
</body>
</html>