Vanderson da Silva Quintino commited on
Commit
d6db4e5
·
1 Parent(s): 552abe3

feat: add password protection

Browse files
src/ClipForge.Api/wwwroot/index.html CHANGED
@@ -107,10 +107,28 @@
107
  }
108
  .btn-download:hover { opacity: 0.8; }
109
  .empty { text-align: center; color: #555; padding: 20px; }
 
 
 
 
110
  </style>
111
  </head>
112
  <body>
113
- <div class="container">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  <h1>🎬 ClipForge</h1>
115
  <p class="subtitle">Gerador automático de vídeos virais com IA</p>
116
 
@@ -148,6 +166,25 @@
148
  <script>
149
  const API = window.location.origin;
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  async function generate() {
152
  const niche = document.getElementById('niche').value.trim();
153
  if (!niche) { alert('Digite um tema!'); return; }
@@ -209,8 +246,6 @@
209
  document.getElementById('videosList').innerHTML = '<div class="empty">Erro ao carregar vídeos</div>';
210
  }
211
  }
212
-
213
- loadVideos();
214
  </script>
215
  </body>
216
  </html>
 
107
  }
108
  .btn-download:hover { opacity: 0.8; }
109
  .empty { text-align: center; color: #555; padding: 20px; }
110
+ .hidden { display: none; }
111
+ .login-card { text-align: center; margin-top: 20vh; }
112
+ .login-card h1 { margin-bottom: 20px; }
113
+ .login-error { color: #f87171; margin-top: 10px; display: none; }
114
  </style>
115
  </head>
116
  <body>
117
+ <!-- LOGIN SCREEN -->
118
+ <div class="container" id="loginScreen">
119
+ <div class="card login-card">
120
+ <h1>🔒 ClipForge</h1>
121
+ <p class="subtitle">Digite a senha para acessar</p>
122
+ <div class="form-group">
123
+ <input type="password" id="passwordInput" placeholder="Senha" onkeypress="if(event.key==='Enter')login()" />
124
+ </div>
125
+ <button class="btn btn-primary" onclick="login()">Entrar</button>
126
+ <p class="login-error" id="loginError">Senha incorreta</p>
127
+ </div>
128
+ </div>
129
+
130
+ <!-- MAIN APP -->
131
+ <div class="container hidden" id="mainApp">
132
  <h1>🎬 ClipForge</h1>
133
  <p class="subtitle">Gerador automático de vídeos virais com IA</p>
134
 
 
166
  <script>
167
  const API = window.location.origin;
168
 
169
+ async function login() {
170
+ const pass = document.getElementById('passwordInput').value;
171
+ if (pass === atob('Q2xpcEZvcmdlQDIwMjUh')) {
172
+ sessionStorage.setItem('auth', '1');
173
+ document.getElementById('loginScreen').classList.add('hidden');
174
+ document.getElementById('mainApp').classList.remove('hidden');
175
+ loadVideos();
176
+ } else {
177
+ document.getElementById('loginError').style.display = 'block';
178
+ }
179
+ }
180
+
181
+ // Check if already logged in
182
+ if (sessionStorage.getItem('auth') === '1') {
183
+ document.getElementById('loginScreen').classList.add('hidden');
184
+ document.getElementById('mainApp').classList.remove('hidden');
185
+ loadVideos();
186
+ }
187
+
188
  async function generate() {
189
  const niche = document.getElementById('niche').value.trim();
190
  if (!niche) { alert('Digite um tema!'); return; }
 
246
  document.getElementById('videosList').innerHTML = '<div class="empty">Erro ao carregar vídeos</div>';
247
  }
248
  }
 
 
249
  </script>
250
  </body>
251
  </html>