File size: 2,880 Bytes
04cac21
4eb72fb
04cac21
 
 
 
 
 
 
 
ac1cd5b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
04cac21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ac1cd5b
ba58c11
7788cdd
ac1cd5b
 
 
 
 
7788cdd
 
ac1cd5b
 
 
 
 
 
 
 
 
 
7788cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
04cac21
4eb72fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!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">
        <div class="form-header">Register</div>
        <label for="register-username">Username:</label>
        <input type="text" id="register-username" name="username" required>
        <label for="register-password">Password:</label>
        <input type="password" id="register-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>