-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogin.html
More file actions
158 lines (135 loc) · 5.92 KB
/
Copy pathlogin.html
File metadata and controls
158 lines (135 loc) · 5.92 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - Readerbench</title>
<!-- Include CSRF token in a meta tag for easy access in JavaScript -->
<meta name="csrf-token" content="{{ csrf_token }}">
<!-- Include Vue.js from CDN -->
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="{% static 'css/soft-design-system.css' %}" rel="stylesheet">
<link href="{% static 'css/nucleo-icons.css' %}" rel="stylesheet">
<link href="{% static 'css/nucleo-svg.css' %}" rel="stylesheet">
<!-- Include compiled CSS (from your SCSS) -->
<style>
.body {
background-color: #f8f9fa;
}
.login-form {
background-color: #f8f9fa;
overflow: hidden;
box-shadow: none;
padding: 0.3rem;
}
.login-form-card {
position: relative;
background-color: #fff;
width: 100%;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
}
.login-form::before {
content: "";
position: absolute;
top: -50%;
left: -50%;
width: 100%;
height: 100%;
background: linear-gradient(0deg, transparent, transparent, #4c00ff, #7300ff, #bf00ff);
animation: animate 5s linear infinite;
transform-origin: bottom right;
}
@keyframes animate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
</style>
</head>
<body>
<div class="body page-header min-vh-100" id="app">
<div class="container">
<div class="row d-flex justify-content-around">
<div class="col-4 card login-form">
<div class="login-form-card card">
<div class="card-header" style="box-shadow: none">
<p class="mb-0">Enter your username and password to sign in</p>
</div>
<div class="card-body">
<form role="form" method="POST">
{% csrf_token %}
<!-- Username Field (instead of Email) -->
<div class="mb-3">
{{ form.username }}
</div>
<!-- Password Field -->
<div class="mb-3">
{{ form.password }}
</div>
<!-- Sign In Button -->
<div class="text-center">
<button type="submit"
class="btn btn-lg bg-gradient-primary btn-lg w-100 mt-4 mb-0">Sign in</button>
</div>
{% if messages %}
<div class="text-center text-danger pt-2">
<ul>
{% for message in messages %}
{{ message }}
{% endfor %}
</ul>
</div>
{% endif %}
</form>
</div>
<div class="card-footer text-center pt-0 px-lg-2 px-1">
<p class="mb-1 text-sm mx-auto">
Don't have an account? <a href="{% if client_id %}{% url 'signup' %}?client_id={{ client_id }}&redirect_uri={{redirect_uri}}&code_challenge={{ code_challenge }}&code_challenge_method={{ code_challenge_method }}{% else %}{% url 'signup' %}{% endif %}"
class="text-primary text-gradient font-weight-bold">Sign Up</a>
</p>
</div>
<div class="card-footer text-center pt-0 px-lg-2 px-1">
<p class="text-sm mx-auto">
<a href="#forgot-password-not-implemented">Forgot password ?</a>
</p>
</div>
</div>
</div>
<div class="col-4 d-flex justify-content-center align-items-center">
<img class="w-80 h-80" src="{% static 'img/readerbench-small.svg' %}">
</div>
</div>
</div>
</div>
<!-- Vue.js instance -->
<script>
new Vue({
el: '#app',
mounted() {
const usernameField = document.getElementById("id_username");
if (usernameField) {
usernameField.classList.add("form-control");
usernameField.setAttribute("placeholder", "Username");
}
const passwordField = document.getElementById("id_password");
if (passwordField) {
passwordField.classList.add("form-control");
passwordField.setAttribute("placeholder", "Password");
}
},
delimiters: ['[[', ']]']
});
</script>
</body>
</html>