TheM1N9 commited on
Commit
6f51f68
·
1 Parent(s): b4093cc

Refactor authentication handling and enhance UI components. Removed authentication check from segment regeneration function. Updated login form to include tabbed interface for login and signup, improved styling with transitions and animations, and added new elements for better user experience.

Browse files
Files changed (3) hide show
  1. app.py +0 -2
  2. static/styles.css +103 -17
  3. templates/index.html +70 -11
app.py CHANGED
@@ -227,8 +227,6 @@ async def regenerate_segment(
227
  tharun_voice_id: str = Form(...),
228
  akshara_voice_id: str = Form(...),
229
  ):
230
- if not authenticated:
231
- raise HTTPException(status_code=401, detail="Authentication required")
232
 
233
  try:
234
  # Select the appropriate voice ID based on speaker
 
227
  tharun_voice_id: str = Form(...),
228
  akshara_voice_id: str = Form(...),
229
  ):
 
 
230
 
231
  try:
232
  # Select the appropriate voice ID based on speaker
static/styles.css CHANGED
@@ -389,12 +389,67 @@ form button[type="submit"] {
389
  backdrop-filter: blur(10px);
390
  width: 100%;
391
  max-width: 400px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  }
393
 
394
  .login-card h2 {
395
  text-align: center;
396
  color: #4caf50;
397
  margin-bottom: 30px;
 
 
 
 
398
  }
399
 
400
  .login-form {
@@ -403,41 +458,72 @@ form button[type="submit"] {
403
  gap: 20px;
404
  }
405
 
406
- .login-form .input-group {
407
- display: flex;
408
- flex-direction: column;
409
- gap: 8px;
410
  }
411
 
412
- .login-form label {
413
- color: #ffffff;
 
 
 
 
414
  }
415
 
416
- .login-form input {
 
417
  padding: 12px;
 
418
  border-radius: 8px;
419
  border: 1px solid #444;
420
  background: #333;
421
  color: white;
422
  transition: all 0.3s ease;
 
 
423
  }
424
 
425
- .login-form input:focus {
426
  border-color: #4caf50;
427
  outline: none;
 
428
  }
429
 
430
- .login-form button {
431
- background: linear-gradient(45deg, #4caf50, #45a049);
432
- color: white;
433
- padding: 15px;
434
- border: none;
435
- border-radius: 8px;
436
- cursor: pointer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  font-size: 1.1em;
438
- transition: transform 0.2s ease;
439
  }
440
 
441
- .login-form button:hover {
 
 
 
 
 
 
 
 
 
 
 
442
  transform: translateY(-2px);
443
  }
 
389
  backdrop-filter: blur(10px);
390
  width: 100%;
391
  max-width: 400px;
392
+ transition: all 0.3s ease;
393
+ }
394
+
395
+ .login-card:hover {
396
+ transform: translateY(-5px);
397
+ box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
398
+ }
399
+
400
+ .auth-tabs {
401
+ display: flex;
402
+ margin-bottom: 30px;
403
+ gap: 10px;
404
+ }
405
+
406
+ .tab-btn {
407
+ flex: 1;
408
+ padding: 15px;
409
+ background: transparent;
410
+ border: none;
411
+ color: #cccccc;
412
+ cursor: pointer;
413
+ font-size: 1.1em;
414
+ transition: all 0.3s ease;
415
+ display: flex;
416
+ align-items: center;
417
+ justify-content: center;
418
+ gap: 8px;
419
+ }
420
+
421
+ .tab-btn:hover {
422
+ color: #4caf50;
423
+ background: rgba(76, 175, 80, 0.1);
424
+ }
425
+
426
+ .tab-btn.active {
427
+ color: #4caf50;
428
+ border-bottom: 2px solid #4caf50;
429
+ }
430
+
431
+ .tab-content {
432
+ display: none;
433
+ animation: fadeIn 0.3s ease;
434
+ }
435
+
436
+ @keyframes fadeIn {
437
+ from { opacity: 0; transform: translateY(10px); }
438
+ to { opacity: 1; transform: translateY(0); }
439
+ }
440
+
441
+ .tab-content.active {
442
+ display: block;
443
  }
444
 
445
  .login-card h2 {
446
  text-align: center;
447
  color: #4caf50;
448
  margin-bottom: 30px;
449
+ display: flex;
450
+ align-items: center;
451
+ justify-content: center;
452
+ gap: 10px;
453
  }
454
 
455
  .login-form {
 
458
  gap: 20px;
459
  }
460
 
461
+ .input-group {
462
+ position: relative;
 
 
463
  }
464
 
465
+ .input-group label {
466
+ display: flex;
467
+ align-items: center;
468
+ gap: 8px;
469
+ margin-bottom: 8px;
470
+ color: #cccccc;
471
  }
472
 
473
+ .input-group input {
474
+ width: 100%;
475
  padding: 12px;
476
+ padding-left: 15px;
477
  border-radius: 8px;
478
  border: 1px solid #444;
479
  background: #333;
480
  color: white;
481
  transition: all 0.3s ease;
482
+ font-size: 1em;
483
+ box-sizing: border-box;
484
  }
485
 
486
+ .input-group input:focus {
487
  border-color: #4caf50;
488
  outline: none;
489
+ box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
490
  }
491
 
492
+ .input-group input::placeholder {
493
+ color: #666;
494
+ }
495
+
496
+ .signup-section {
497
+ text-align: center;
498
+ padding: 30px 0;
499
+ display: flex;
500
+ flex-direction: column;
501
+ align-items: center;
502
+ gap: 20px;
503
+ }
504
+
505
+ .signup-section i.fa-3x {
506
+ color: #4caf50;
507
+ margin-bottom: 10px;
508
+ }
509
+
510
+ .signup-section p {
511
+ margin: 0;
512
+ color: #cccccc;
513
  font-size: 1.1em;
 
514
  }
515
 
516
+ .contact-text span {
517
+ color: #4caf50;
518
+ text-decoration: none;
519
+ display: inline-flex;
520
+ align-items: center;
521
+ gap: 5px;
522
+ transition: all 0.3s ease;
523
+ }
524
+
525
+ .contact-text a:hover {
526
+ color: #45a049;
527
+ text-decoration: none;
528
  transform: translateY(-2px);
529
  }
templates/index.html CHANGED
@@ -12,20 +12,79 @@
12
  {% if not is_authenticated %}
13
  <div class="login-container">
14
  <div class="login-card">
15
- <h2>Login</h2>
16
- <form action="/login" method="POST" class="login-form">
17
- <div class="input-group">
18
- <label for="username">Username</label>
19
- <input type="text" id="username" name="username" required />
20
- </div>
21
- <div class="input-group">
22
- <label for="password">Password</label>
23
- <input type="password" id="password" name="password" required />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  </div>
25
- <button type="submit">Login</button>
26
- </form>
27
  </div>
28
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  {% else %}
30
  <div class="hero">
31
  <h1>NotebookMg</h1>
 
12
  {% if not is_authenticated %}
13
  <div class="login-container">
14
  <div class="login-card">
15
+ <div class="auth-tabs">
16
+ <button class="tab-btn active" onclick="switchTab('login')">
17
+ <i class="fas fa-sign-in-alt"></i> Login
18
+ </button>
19
+ <button class="tab-btn" onclick="switchTab('signup')">
20
+ <i class="fas fa-user-plus"></i> Sign Up
21
+ </button>
22
+ </div>
23
+
24
+ <div id="login-content" class="tab-content active">
25
+ <h2><i class="fas fa-lock"></i> Login</h2>
26
+ <form action="/login" method="POST" class="login-form">
27
+ <div class="input-group">
28
+ <label for="username"><i class="fas fa-user"></i> Username</label>
29
+ <input
30
+ type="text"
31
+ id="username"
32
+ name="username"
33
+ placeholder="Enter your username"
34
+ required
35
+ />
36
+ </div>
37
+ <div class="input-group">
38
+ <label for="password"><i class="fas fa-key"></i> Password</label>
39
+ <input
40
+ type="password"
41
+ id="password"
42
+ name="password"
43
+ placeholder="Enter your password"
44
+ required
45
+ />
46
+ </div>
47
+ <button type="submit">
48
+ <i class="fas fa-sign-in-alt"></i> Login
49
+ </button>
50
+ </form>
51
+ </div>
52
+
53
+ <div id="signup-content" class="tab-content">
54
+ <h2><i class="fas fa-user-plus"></i> Sign Up</h2>
55
+ <div class="signup-section">
56
+ <i class="fas fa-envelope-open-text fa-3x"></i>
57
+ <p>
58
+ Due to skyrocketing API costs, access to NotebookMg is only for
59
+ the chosen ones.
60
+ </p>
61
+ <p class="contact-text">
62
+ To see if you're worthy of entry, hit up
63
+ <span>Ronit</span>
64
+ or
65
+ <span>Manikanta K</span>
66
+ on Slack—they're the gatekeepers 🔮
67
+ </p>
68
  </div>
69
+ </div>
 
70
  </div>
71
  </div>
72
+
73
+ <script>
74
+ function switchTab(tab) {
75
+ // Update tab buttons
76
+ document.querySelectorAll(".tab-btn").forEach((btn) => {
77
+ btn.classList.remove("active");
78
+ });
79
+ event.currentTarget.classList.add("active");
80
+
81
+ // Update content
82
+ document.querySelectorAll(".tab-content").forEach((content) => {
83
+ content.classList.remove("active");
84
+ });
85
+ document.getElementById(`${tab}-content`).classList.add("active");
86
+ }
87
+ </script>
88
  {% else %}
89
  <div class="hero">
90
  <h1>NotebookMg</h1>