105
105
106
106
include_once App::filepath ('include|custom| ' , 'top.php ' );
107
107
108
+ // Add inline styles for login page enhancement
109
+ echo '
110
+ <style>
111
+ .login-page {
112
+ background: linear-gradient(135deg, rgba(245,247,250,1) 0%, rgba(230,233,240,1) 100%);
113
+ display: flex;
114
+ align-items: center;
115
+ justify-content: center;
116
+ min-height: 100vh;
117
+ }
118
+ .login-box {
119
+ margin: 0 auto;
120
+ }
121
+ .card-outline.card-primary {
122
+ border-top: 3px solid #007bff;
123
+ border-radius: 8px;
124
+ overflow: hidden;
125
+ }
126
+ .form-control-lg {
127
+ border-radius: 4px;
128
+ transition: all 0.3s ease;
129
+ }
130
+ .form-control-lg:focus {
131
+ border-color: #80bdff;
132
+ box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
133
+ }
134
+ .input-group-text {
135
+ border-top-right-radius: 4px !important;
136
+ border-bottom-right-radius: 4px !important;
137
+ }
138
+ .btn-primary {
139
+ transition: all 0.3s ease;
140
+ }
141
+ .login-box-msg {
142
+ font-size: 1.1rem;
143
+ }
144
+ .is-invalid {
145
+ border-color: #dc3545 !important;
146
+ background-image: url("data:image/svg+xml,%3csvg width= \'12 \' height= \'12 \' fill= \'none \' stroke= \'%23dc3545 \' viewBox= \'0 0 12 12 \'%3e%3ccircle cx= \'6 \' cy= \'6 \' r= \'4.5 \'/%3e%3cpath stroke-linejoin= \'round \' d= \'M5.8 3.6h.4L6 6.5z \'/%3e%3ccircle cx= \'6 \' cy= \'8.2 \' r= \'.6 \' fill= \'%23dc3545 \' stroke= \'none \'/%3e%3c/svg%3e");
147
+ background-repeat: no-repeat;
148
+ background-position: right calc(0.375em + 0.1875rem) center;
149
+ background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
150
+ }
151
+ .invalid-feedback {
152
+ display: none;
153
+ width: 100%;
154
+ margin-top: 0.25rem;
155
+ font-size: 0.875rem;
156
+ color: #dc3545;
157
+ }
158
+ .d-block {
159
+ display: block !important;
160
+ }
161
+ @media (max-width: 576px) {
162
+ .login-box {
163
+ width: 90%;
164
+ margin: 0 auto;
165
+ }
166
+ }
167
+ </style> ' ;
168
+
108
169
// Controllo se è una beta e in caso mostro un warning
109
170
if (Update::isBeta ()) {
110
171
echo '
118
179
// Controllo se è una beta e in caso mostro un warning
119
180
if (Auth::isBrute ()) {
120
181
echo '
121
- <div class="box box -danger" id="brute">
122
- <div class="box -header with-border text-center">
123
- <h3 class="box -title"> ' .tr ('Attenzione ' ).'</h3>
182
+ <div class="card card -danger shadow-lg col-md-6 offset-md-3 mt-5 " id="brute">
183
+ <div class="card -header text-center">
184
+ <h3 class="card -title"><i class="fa fa-exclamation-triangle mr-2"></i > ' .tr ('Attenzione ' ).'</h3>
124
185
</div>
125
- <div class="box-body text-center">
126
- <p> ' .tr ('Sono stati effettuati troppi tentativi di accesso consecutivi! ' ).'</p>
127
- <p> ' .tr ('Tempo rimanente (in secondi) ' ).': <span id="brute-timeout"> ' .(Auth::getBruteTimeout () + 1 ).'</span></p>
186
+ <div class="card-body text-center">
187
+ <p class="lead"> ' .tr ('Sono stati effettuati troppi tentativi di accesso consecutivi! ' ).'</p>
188
+ <div class="alert alert-warning">
189
+ <p> ' .tr ('Tempo rimanente ' ).':</p>
190
+ <h3><span id="brute-timeout" class="badge badge-danger"> ' .(Auth::getBruteTimeout () + 1 ).'</span> ' .tr ('secondi ' ).'</h3>
191
+ </div>
128
192
</div>
129
193
</div>
130
194
@@ -141,8 +205,9 @@ function brute() {
141
205
if(value > 0){
142
206
setTimeout(brute, 1000);
143
207
} else {
144
- $("#brute").fadeOut();
145
- $(".login-box").fadeIn();
208
+ $("#brute").fadeOut(500, function() {
209
+ $(".login-box").fadeIn(500);
210
+ });
146
211
}
147
212
}
148
213
</script> ' ;
@@ -151,48 +216,72 @@ function brute() {
151
216
echo '
152
217
<script>
153
218
$(document).ready(function(){
219
+ // Add shake animation to login box
154
220
$(".login-box").addClass("animated shake");
221
+
222
+ // Add error styling to password field
223
+ $(".password-field").addClass("is-invalid");
224
+
225
+ // Add error message under password field
226
+ $(".password-field-container").append( \'<div class="invalid-feedback d-block"><i class="fa fa-exclamation-circle mr-1"></i> ' .tr ('Credenziali non valide. Riprova. ' ).'</div> \');
227
+
228
+ // Focus on password field
229
+ $("input[name=password]").focus();
230
+
231
+ // Remove error styling when user starts typing in any field
232
+ $("input[name=password], input[name=username]").on("keydown", function() {
233
+ $(".password-field").removeClass("is-invalid");
234
+ $(".invalid-feedback").fadeOut(300);
235
+ });
155
236
});
156
237
</script> ' ;
157
238
}
158
239
159
240
echo '
160
241
<form action="?op=login" method="post" autocomplete="off">
161
242
<div class="login-box card-center-medium">
162
- <div class="card card-outline card-orange ">
163
- <div class="card-header text-center">
164
- <img src=" ' .App::getPaths ()['img ' ].'/logo_completo.png" alt=" ' .tr ('OpenSTAManager, il software gestionale open source per assistenza tecnica e fatturazione elettronica ' ).'" class="img-fluid">
243
+ <div class="card card-outline card-primary shadow-lg ">
244
+ <div class="card-header text-center bg-light py-4 ">
245
+ <img src=" ' .App::getPaths ()['img ' ].'/logo_completo.png" alt=" ' .tr ('OpenSTAManager, il software gestionale open source per assistenza tecnica e fatturazione elettronica ' ).'" class="img-fluid" style="max-width: 85%;" >
165
246
</div>
166
247
167
- <div class="card-body">
168
- <p class="login-box-msg" > ' .tr ('Accedi con le tue credenziali ' ).'</p>
169
- <div class="input-group mb-3 ">
170
- <input type="text" name="username" autocomplete="username" class="form-control" placeholder=" ' .tr ('Nome utente ' ).'" ' ;
248
+ <div class="card-body pt-4 ">
249
+ <p class="login-box-msg text-secondary mb-4"><i class="fa fa-lock mr-2"></i > ' .tr ('Accedi con le tue credenziali ' ).'</p>
250
+ <div class="input-group mb-4 ">
251
+ <input type="text" name="username" autocomplete="username" class="form-control form-control-lg " placeholder=" ' .tr ('Nome utente ' ).'" ' ;
171
252
if (isset ($ username )) {
172
253
echo ' value=" ' .$ username .'" ' ;
173
254
}
174
255
175
256
echo ' required>
176
257
<div class="input-group-append">
177
- <div class="input-group-text">
178
- <i class="fa fa-user"></i>
258
+ <div class="input-group-text bg-light ">
259
+ <i class="fa fa-user text-primary "></i>
179
260
</div>
180
261
</div>
181
262
</div>
182
263
183
- <div class="mb-3 ">
184
- {[ "type": "password", "name": "password", "autocomplete": "current-password", "placeholder": " ' .tr ('Password ' ).'" ]}
264
+ <div class="mb-4 password-field-container ">
265
+ {[ "type": "password", "name": "password", "autocomplete": "current-password", "placeholder": " ' .tr ('Password ' ).'", "class": "form-control-lg password-field" ]}
185
266
</div>
186
267
187
- <button type="submit" class="btn btn-danger btn-block btn-flat"> ' .tr ('Accedi ' ).'</button>
188
- <br>
189
- <p><a href=" ' .base_path ().'/reset.php"> ' .tr ('Password dimenticata? ' ).'</a></p> ' ;
268
+ <button type="submit" class="btn btn-primary btn-block btn-lg shadow-sm" id="login-button">
269
+ <i class="fa fa-sign-in mr-2"></i> ' .tr ('Accedi ' ).'
270
+ </button>
271
+
272
+ <div class="text-center mt-4">
273
+ <a href=" ' .base_path ().'/reset.php" class="text-secondary">
274
+ <i class="fa fa-question-circle mr-1"></i> ' .tr ('Password dimenticata? ' ).'
275
+ </a>
276
+ </div> ' ;
190
277
if ($ microsoft ) {
191
278
echo '
192
- <div class="social-auth-links text-center">
193
- <p>- oppure -</p>
194
-
195
- <a href=" ' .base_path ().'/oauth2_login.php?id= ' .$ microsoft ['id ' ].'" class="btn btn-block btn-social btn-primary btn-flat"><i class="fa fa-windows"></i> ' .tr ('Accedi con Microsoft ' ).'</a>
279
+ <div class="social-auth-links text-center mt-4 pt-3 border-top">
280
+ <p class="text-muted"> ' .tr ('- oppure - ' ).'</p>
281
+
282
+ <a href=" ' .base_path ().'/oauth2_login.php?id= ' .$ microsoft ['id ' ].'" class="btn btn-block btn-social btn-primary btn-flat shadow-sm">
283
+ <i class="fa fa-windows mr-2"></i> ' .tr ('Accedi con Microsoft ' ).'
284
+ </a>
196
285
</div> ' ;
197
286
}
198
287
echo '
@@ -203,17 +292,33 @@ function brute() {
203
292
<!-- /.box -->
204
293
205
294
<script>
206
- $(document).ready( function(){
207
- $("#login").click(function(){
208
- $("#login").text(" ' .tr ('Autenticazione ' ).'...");
209
- });
210
-
211
- if( $("input[name=username]").val() == ""){
295
+ $(document).ready(function(){
296
+ // Focus on first empty field
297
+ if($("input[name=username]").val() == ""){
212
298
$("input[name=username]").focus();
213
- }
214
- else{
299
+ } else {
215
300
$("input[name=password]").focus();
216
301
}
302
+
303
+ // Add hover effect to login button
304
+ $("#login-button").hover(
305
+ function() {
306
+ $(this).removeClass("shadow-sm").addClass("shadow");
307
+ },
308
+ function() {
309
+ $(this).removeClass("shadow").addClass("shadow-sm");
310
+ }
311
+ );
312
+
313
+ // Show loading text on button click
314
+ $("#login-button").click(function(){
315
+ $(this).html( \'<i class="fa fa-circle-o-notch fa-spin mr-2"></i> ' .tr ('Autenticazione ' ).'... \');
316
+ });
317
+
318
+ // Add subtle animation to input fields on focus
319
+ $("input").focus(function(){
320
+ $(this).parent().animate({marginLeft: "5px"}, 200).animate({marginLeft: "0px"}, 200);
321
+ });
217
322
});
218
323
</script> ' ;
219
324
0 commit comments