File size: 19,804 Bytes
eefe2da
 
3045880
eefe2da
 
 
 
 
 
 
 
 
 
3045880
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
eefe2da
 
 
 
 
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
 
3045880
 
 
 
 
 
eefe2da
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
3045880
 
 
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
 
 
 
 
 
 
 
 
eefe2da
 
 
 
 
 
 
3045880
 
eefe2da
 
 
3045880
 
eefe2da
3045880
 
 
 
eefe2da
 
 
 
 
 
 
 
3045880
 
 
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
 
 
 
 
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
 
 
3045880
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
eefe2da
 
 
 
 
 
3045880
 
 
 
 
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
3045880
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
3045880
 
 
 
 
eefe2da
 
 
 
 
 
 
 
3045880
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
eefe2da
 
 
 
 
 
3045880
 
 
 
 
 
 
 
 
 
 
 
 
eefe2da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3045880
 
eefe2da
3045880
 
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<!DOCTYPE html>
<html lang="es">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Fish Audio - Voice Vault</title>
  <link rel="icon" type="image/png" href="images/icon48.png">
  <link rel="stylesheet" href="src/styles/main.css">
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
</head>

<body>
  <div class="app-container">
    <!-- Header -->
    <header class="app-header">
      <div class="brand">
        <h1 class="brand-title">Fish Audio</h1>
        <span class="brand-tag">Voice Vault</span>
      </div>

      <div class="header-actions">

        <!-- Organizer / Folder Map Button -->
        <button class="btn open-tab-btn" id="treeViewBtn" title="Mapa de Carpetas (Organizador)">
          <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
            stroke-linecap="round" stroke-linejoin="round">
            <path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
            <path d="M8 11h8"></path>
            <path d="M8 15h5"></path>
          </svg>
        </button>

        <!-- Tool / Settings Config Button -->
        <button class="btn open-tab-btn" id="settingsBtn" title="Configuración de Opciones">
          <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"
            stroke-linecap="round" stroke-linejoin="round">
            <path
              d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z">
            </path>
          </svg>
        </button>

        <!-- Open in Full Tab Button -->
        <button class="btn open-tab-btn" id="openTabBtn" title="Abrir en pestaña completa">
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"
            stroke-linecap="round" stroke-linejoin="round">
            <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
            <polyline points="15 3 21 3 21 9"></polyline>
            <line x1="10" y1="14" x2="21" y2="3"></line>
          </svg>
        </button>

        <!-- Add Voice Modal Button -->
        <button class="btn add-modal-btn" id="openModalBtn" title="Agregar Nueva Voz">
          <svg width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4"
            stroke-linecap="round" stroke-linejoin="round">
            <line x1="12" y1="3" x2="12" y2="21"></line>
            <line x1="3" y1="12" x2="21" y2="12"></line>
          </svg>
        </button>
      </div>
    </header>

    <!-- Main Content -->
    <main class="main-content">
      <div class="app-layout">
        <!-- Left Sidebar Folders Panel (Desktop View) -->
        <aside class="sidebar-folders" id="sidebarFolders">
          <div class="sidebar-header">
            <span class="sidebar-title">Carpetas</span>
            <button class="sidebar-add-btn" id="sidebarOpenFolderModalBtn" title="Crear nueva carpeta">
              <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
                <line x1="12" y1="5" x2="12" y2="19"></line>
                <line x1="5" y1="12" x2="19" y2="12"></line>
              </svg>
              Nueva
            </button>
          </div>
          <div class="sidebar-folder-list" id="sidebarFolderList">
            <!-- Dynamically populated sidebar folder items -->
          </div>
        </aside>

        <!-- Main Workspace Area -->
        <div class="main-area">
          <!-- Search and Count Bar -->
          <div class="filter-bar">
            <input type="text" id="searchInput" class="search-input" placeholder="Buscar por título de voz...">
            <button class="btn sort-btn" id="sortOrderBtn" title="Orden: Más reciente a más antiguo">
              <svg id="sortIconDesc" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor"
                stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
                <line x1="12" y1="5" x2="12" y2="19"></line>
                <polyline points="19 12 12 19 5 12"></polyline>
              </svg>
              <svg id="sortIconAsc" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor"
                stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" style="display: none;">
                <line x1="12" y1="19" x2="12" y2="5"></line>
                <polyline points="5 12 12 5 19 12"></polyline>
              </svg>
            </button>
            <span class="total-count" id="totalCount">0 voces</span>
          </div>


          <!-- Folders Bar -->
          <div class="folder-section">
            <button class="folder-scroll-btn left" id="scrollFoldersLeft"
              title="Desplazar a la izquierda">&lsaquo;</button>
            <div class="folder-tabs-wrapper" id="folderTabsWrapper">
              <!-- Folder chips will be dynamically rendered here -->
            </div>
            <button class="folder-scroll-btn right" id="scrollFoldersRight"
              title="Desplazar a la derecha">&rsaquo;</button>
            <button class="add-folder-chip" id="openFolderModalBtn" title="Crear nueva carpeta">
              <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
                <line x1="12" y1="5" x2="12" y2="19"></line>
                <line x1="5" y1="12" x2="19" y2="12"></line>
              </svg>
              Nueva Carpeta
            </button>
          </div>

          <!-- Active Folder Actions Bar -->
          <div class="folder-header-actions" id="folderHeaderActions" style="display: none;">
            <span class="active-folder-title" id="activeFolderNameEl">Voces Bíblicas</span>
            <div class="folder-btn-group">
              <button class="btn btn-secondary btn-sm" id="editFolderBtn"
                title="Renombrar esta carpeta">Renombrar</button>
              <button class="btn btn-secondary btn-sm danger" id="deleteFolderBtn"
                title="Eliminar esta carpeta">Eliminar Carpeta</button>
            </div>
          </div>

          <!-- Voices Cards List -->
          <div class="voices-list" id="voicesList"></div>

          <!-- Empty State -->
          <div class="empty-box" id="emptyState" style="display: none;">
            No hay voces registradas en esta carpeta. Presiona el botón <strong>+</strong> arriba para agregar una voz.
          </div>
        </div>
      </div>
    </main>

    <!-- Footer -->
    <footer class="app-footer">
      <p>Fish Audio Vault &bull; Control Personalizado de Voces</p>
    </footer>
  </div>

  <!-- Add / Edit Voice Modal Dialog -->
  <div class="modal-overlay" id="addModal" style="display: none;">
    <div class="modal-content">
      <div class="modal-header">
        <h3 id="modalTitle">Agregar Nueva Voz</h3>
        <button class="modal-close-btn" id="closeModalBtn" title="Cerrar">
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"
            stroke-linecap="round" stroke-linejoin="round">
            <line x1="18" y1="6" x2="6" y2="18"></line>
            <line x1="6" y1="6" x2="18" y2="18"></line>
          </svg>
        </button>
      </div>
      <form id="modalAddForm" class="modal-form">
        <div class="modal-body-grid">
          <!-- Left Column: Cover Image Upload -->
          <div class="modal-left-col">
            <label class="form-label-title">Portada (1:1 Cuadrada)</label>
            <div class="image-uploader-box" id="imageDropZone">
              <div class="crop-preview-wrapper" id="cropWrapper">
                <canvas id="cropCanvas" width="140" height="140" style="display: none;"></canvas>
                <div class="image-placeholder" id="imagePlaceholder">
                  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                    <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                    <circle cx="8.5" cy="8.5" r="1.5"></circle>
                    <polyline points="21 15 16 10 5 21"></polyline>
                  </svg>
                  <span>Sube o pega<br><strong>Ctrl + V</strong></span>
                </div>
              </div>
              <div class="image-actions">
                <label for="modalFileInput" class="btn btn-secondary btn-sm">Subir Imagen</label>
                <input type="file" id="modalFileInput" accept="image/*" style="display: none;">
                <button type="button" class="btn btn-secondary btn-sm danger" id="removeImgBtn"
                  style="display: none;">Quitar</button>
              </div>
            </div>
          </div>

          <!-- Right Column: Text & Select Inputs -->
          <div class="modal-right-col">
            <div class="form-group">
              <label for="modalTitleInput">Título de la Voz</label>
              <input type="text" id="modalTitleInput" class="form-control" placeholder="Ej: Maestro Sabio" required>
            </div>

            <div class="form-group">
              <label for="modalUrlInput">Enlace / URL de Fish Audio</label>
              <input type="url" id="modalUrlInput" class="form-control" placeholder="https://fish.audio/es/m/..."
                required>
            </div>

            <div class="form-group">
              <label for="modalFolderSelect">Carpeta</label>
              <select id="modalFolderSelect" class="form-control select-control"></select>
            </div>

            <div class="form-group">
              <label for="modalNotesInput">Notas / Observaciones</label>
              <textarea id="modalNotesInput" class="form-control textarea-control" rows="3"
                placeholder="Escribe notas, observaciones, guiones o indicaciones de la voz..."></textarea>
            </div>
          </div>
        </div>

        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" id="cancelModalBtn">Cancelar</button>
          <button type="submit" class="btn btn-primary" id="saveVoiceBtn">Guardar Voz</button>
        </div>
      </form>
    </div>
  </div>

  <!-- Create Folder Modal Dialog -->
  <div class="modal-overlay" id="createFolderModal" style="display: none;">
    <div class="modal-content modal-sm">
      <div class="modal-header">
        <h3>Crear Nueva Carpeta</h3>
        <button class="modal-close-btn" id="closeFolderModalBtn" title="Cerrar">
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"
            stroke-linecap="round" stroke-linejoin="round">
            <line x1="18" y1="6" x2="6" y2="18"></line>
            <line x1="6" y1="6" x2="18" y2="18"></line>
          </svg>
        </button>
      </div>
      <form id="createFolderForm" class="modal-form">
        <div class="form-group">
          <label for="newFolderNameInput">Nombre de la Carpeta</label>
          <input type="text" id="newFolderNameInput" class="form-control" placeholder="Ej: Voces de Anime" required>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" id="cancelFolderModalBtn">Cancelar</button>
          <button type="submit" class="btn btn-primary">Crear Carpeta</button>
        </div>
      </form>
    </div>
  </div>

  <!-- Edit Folder Modal Dialog -->
  <div class="modal-overlay" id="editFolderModal" style="display: none;">
    <div class="modal-content modal-sm">
      <div class="modal-header">
        <h3>Renombrar Carpeta</h3>
        <button class="modal-close-btn" id="closeEditFolderModalBtn" title="Cerrar">
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"
            stroke-linecap="round" stroke-linejoin="round">
            <line x1="18" y1="6" x2="6" y2="18"></line>
            <line x1="6" y1="6" x2="18" y2="18"></line>
          </svg>
        </button>
      </div>
      <form id="editFolderForm" class="modal-form">
        <div class="form-group">
          <label for="editFolderNameInput">Nuevo Nombre de la Carpeta</label>
          <input type="text" id="editFolderNameInput" class="form-control" placeholder="Ej: Voces Bíblicas" required>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" id="cancelEditFolderModalBtn">Cancelar</button>
          <button type="submit" class="btn btn-primary">Guardar Cambios</button>
        </div>
      </form>
    </div>
  </div>

  <!-- Folder Tree View / Map Modal Dialog -->
  <div class="modal-overlay" id="treeViewModal" style="display: none;">
    <div class="modal-content modal-lg">
      <div class="modal-header">
        <h3>Mapa de Carpetas y Voces</h3>
        <button class="modal-close-btn" id="closeTreeViewModalBtn" title="Cerrar">
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"
            stroke-linecap="round" stroke-linejoin="round">
            <line x1="18" y1="6" x2="6" y2="18"></line>
            <line x1="6" y1="6" x2="18" y2="18"></line>
          </svg>
        </button>
      </div>
      <div class="tree-modal-body">
        <div class="tree-controls">
          <input type="text" id="treeSearchInput" class="search-input"
            placeholder="Buscar voces o carpetas en el mapa...">
          <div class="tree-btn-group">
            <button type="button" class="btn btn-secondary btn-sm" id="expandAllTreeBtn">Expandir Todo</button>
            <button type="button" class="btn btn-secondary btn-sm" id="collapseAllTreeBtn">Colapsar Todo</button>
          </div>
        </div>
        <div class="tree-container" id="treeContainer">
          <!-- Dynamically populated tree -->
        </div>
      </div>
    </div>
  </div>

  <!-- Confirm Action / Delete Modal Dialog -->
  <div class="modal-overlay" id="confirmModal" style="display: none;">
    <div class="modal-content modal-sm">
      <div class="modal-header">
        <h3 id="confirmModalTitle">Confirmar Acción</h3>
        <button class="modal-close-btn" id="closeConfirmModalBtn" title="Cerrar">
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"
            stroke-linecap="round" stroke-linejoin="round">
            <line x1="18" y1="6" x2="6" y2="18"></line>
            <line x1="6" y1="6" x2="18" y2="18"></line>
          </svg>
        </button>
      </div>
      <div class="modal-body-confirm">
        <p id="confirmModalText">¿Estás seguro de continuar?</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" id="cancelConfirmBtn">Cancelar</button>
        <button type="button" class="btn btn-danger-action" id="acceptConfirmBtn">Eliminar</button>
      </div>
    </div>
  </div>

  <!-- Settings / Tools Modal Dialog -->
  <div class="modal-overlay" id="settingsModal" style="display: none;">
    <div class="modal-content settings-modal-card">
      <div class="modal-header">
        <div class="modal-title-group">
          <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#60a5fa" stroke-width="2.2"
            stroke-linecap="round" stroke-linejoin="round">
            <path
              d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z">
            </path>
          </svg>
          <h3>Configuración de Opciones</h3>
        </div>
        <button class="modal-close-btn" id="closeSettingsModalBtn" title="Cerrar">
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"
            stroke-linecap="round" stroke-linejoin="round">
            <line x1="18" y1="6" x2="6" y2="18"></line>
            <line x1="6" y1="6" x2="18" y2="18"></line>
          </svg>
        </button>
      </div>

      <div class="settings-modal-body">
        <!-- Toggle 1: Quick Folder Selector Badge -->
        <div class="setting-row">
          <div class="setting-text">
            <span class="setting-title-text">Selector Rápido de Carpeta en Tarjetas</span>
            <p class="setting-desc-text">Muestra un menú desplegable en cada tarjeta de voz para cambiar de carpeta
              rápidamente.</p>
          </div>
          <label class="toggle-switch">
            <input type="checkbox" id="toggleQuickFolderBadge">
            <span class="toggle-slider"></span>
          </label>
        </div>

        <!-- Toggle 2: Show Folders Section -->
        <div class="setting-row">
          <div class="setting-text">
            <span class="setting-title-text">Ver Barra y Pestañas de Carpetas</span>
            <p class="setting-desc-text">Muestra la barra lateral y carrusel superior de carpetas.</p>
          </div>
          <label class="toggle-switch">
            <input type="checkbox" id="toggleSidebarFolders" checked>
            <span class="toggle-slider"></span>
          </label>
        </div>

        <!-- Toggle 3: Multi-Select Mode -->
        <div class="setting-row">
          <div class="setting-text">
            <span class="setting-title-text">Selector Múltiple de Voces</span>
            <p class="setting-desc-text">Permite seleccionar varias voces al mismo tiempo para moverlas juntas a una
              carpeta.</p>
          </div>
          <label class="toggle-switch">
            <input type="checkbox" id="toggleMultiSelectMode">
            <span class="toggle-slider"></span>
          </label>
        </div>

        <!-- Toggle 4: Show Voice Notes -->
        <div class="setting-row">
          <div class="setting-text">
            <span class="setting-title-text">Mostrar Notas en Tarjetas</span>
            <p class="setting-desc-text">Muestra u oculta el recuadro de notas y observaciones en las tarjetas de voz.
            </p>
          </div>
          <label class="toggle-switch">
            <input type="checkbox" id="toggleShowVoiceNotes" checked>
            <span class="toggle-slider"></span>
          </label>
        </div>
      </div>

      <div class="modal-footer" style="justify-content: flex-end; padding-top: 1rem;">
        <button type="button" class="btn btn-primary" id="saveSettingsBtn">Guardar Cambios</button>
      </div>
    </div>
  </div>

  <!-- Floating Batch Action Bar for Multi-Select Move -->
  <div class="batch-action-bar" id="batchActionBar" style="display: none;">
    <div class="batch-info">
      <span class="batch-count" id="batchCountText">0 seleccionadas</span>
      <button class="batch-select-all-btn" id="selectAllBatchBtn">Seleccionar Todas</button>
    </div>
    <div class="batch-controls">
      <span class="batch-label">Mover a:</span>
      <select class="batch-folder-select" id="batchFolderSelect">
        <!-- Dynamically populated with folders -->
      </select>
      <button class="btn btn-primary batch-apply-btn" id="applyBatchMoveBtn">
        Mover Voces
      </button>
      <button class="btn batch-cancel-btn" id="closeBatchBarBtn" title="Cerrar Selector">
        &times;
      </button>
    </div>
  </div>

  <script type="module" src="src/js/app.js?v=1.1.2"></script>

</body>

</html>