WebashalarForML commited on
Commit
8318d64
·
verified ·
1 Parent(s): e9fde59

Update templates/create_db.html

Browse files
Files changed (1) hide show
  1. templates/create_db.html +25 -43
templates/create_db.html CHANGED
@@ -61,6 +61,10 @@
61
  .btn-primary {
62
  background-color: #4c4cff;
63
  border-color: #4c4cff;
 
 
 
 
64
  }
65
 
66
  .btn-primary:hover {
@@ -68,33 +72,20 @@
68
  border-color: #3838e8;
69
  }
70
 
71
- /* Custom scrollbar */
72
- .card::-webkit-scrollbar {
73
- width: 8px;
74
- }
75
-
76
- .card::-webkit-scrollbar-thumb {
77
- background-color: #444;
78
- border-radius: 4px;
79
- }
80
-
81
- /* Loader styling */
82
- #loader {
83
  display: none; /* Hidden by default */
84
- position: fixed;
85
- top: 50%;
86
- left: 50%;
87
- transform: translate(-50%, -50%);
88
- z-index: 9999;
89
- }
90
-
91
- .spinner {
92
- width: 50px;
93
- height: 50px;
94
- border: 5px solid #f3f3f3;
95
- border-top: 5px solid #3498db;
96
  border-radius: 50%;
97
  animation: spin 1s linear infinite;
 
 
 
 
 
98
  }
99
 
100
  @keyframes spin {
@@ -106,24 +97,11 @@
106
  }
107
  }
108
 
109
- .loading-overlay {
110
- position: fixed;
111
- top: 0;
112
- left: 0;
113
- width: 100%;
114
- height: 100%;
115
- background: rgba(255, 255, 255, 0.8);
116
- z-index: 9998;
117
- display: none; /* Hidden by default */
118
  }
119
  </style>
120
 
121
- <!-- Loader HTML -->
122
- <div id="loader" class="loading-overlay">
123
- <div class="spinner"></div>
124
- </div>
125
-
126
- <!-- Main Content -->
127
  <div class="container mt-5">
128
  <div class="card shadow">
129
  <div class="card-header">
@@ -146,7 +124,10 @@
146
 
147
  <!-- Submit Button -->
148
  <div class="mt-4 text-center">
149
- <button type="submit" class="btn btn-primary px-5">Create</button>
 
 
 
150
  </div>
151
  </form>
152
  </div>
@@ -154,12 +135,13 @@
154
  </div>
155
 
156
  <script>
157
- // Show loader on form submission
158
  const form = document.getElementById('db-form');
159
- const loader = document.getElementById('loader');
160
 
161
  form.addEventListener('submit', function (event) {
162
- loader.style.display = 'flex'; // Show loader
 
163
  });
164
  </script>
165
 
 
61
  .btn-primary {
62
  background-color: #4c4cff;
63
  border-color: #4c4cff;
64
+ display: flex;
65
+ justify-content: center;
66
+ align-items: center;
67
+ position: relative;
68
  }
69
 
70
  .btn-primary:hover {
 
72
  border-color: #3838e8;
73
  }
74
 
75
+ /* Loader on the button */
76
+ .button-spinner {
 
 
 
 
 
 
 
 
 
 
77
  display: none; /* Hidden by default */
78
+ width: 20px;
79
+ height: 20px;
80
+ border: 3px solid #f3f3f3;
81
+ border-top: 3px solid #ffffff;
 
 
 
 
 
 
 
 
82
  border-radius: 50%;
83
  animation: spin 1s linear infinite;
84
+ margin-left: 10px; /* Space between button text and loader */
85
+ }
86
+
87
+ .btn-loading .button-spinner {
88
+ display: inline-block; /* Show spinner when loading */
89
  }
90
 
91
  @keyframes spin {
 
97
  }
98
  }
99
 
100
+ .btn-loading .btn-text {
101
+ opacity: 0.5; /* Dim button text when loading */
 
 
 
 
 
 
 
102
  }
103
  </style>
104
 
 
 
 
 
 
 
105
  <div class="container mt-5">
106
  <div class="card shadow">
107
  <div class="card-header">
 
124
 
125
  <!-- Submit Button -->
126
  <div class="mt-4 text-center">
127
+ <button type="submit" class="btn btn-primary px-5">
128
+ <span class="btn-text">Create</span>
129
+ <div class="button-spinner"></div>
130
+ </button>
131
  </div>
132
  </form>
133
  </div>
 
135
  </div>
136
 
137
  <script>
138
+ // Show loader on button click
139
  const form = document.getElementById('db-form');
140
+ const submitButton = document.querySelector('.btn-primary');
141
 
142
  form.addEventListener('submit', function (event) {
143
+ submitButton.classList.add('btn-loading'); // Add loading class
144
+ submitButton.disabled = true; // Disable button to prevent multiple clicks
145
  });
146
  </script>
147