Skip to content

Commit dc361d9

Browse files
committed
added Save button for options popup
Tab group section Indicator for Results section
1 parent a89e24b commit dc361d9

3 files changed

Lines changed: 54 additions & 16 deletions

File tree

src/renderer/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<title>OpenConvert</title>
1111
</head>
1212
<body
13-
class="bg-[#222831] border border-solid border-transparent overflow-y-hidden h-full m-0"
13+
class="bg-[#222831] border border-solid border-transparent h-full m-0 overflow-hidden"
1414
>
1515

1616
<div id="app"></div>

src/renderer/src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import Sidebar from './components/Sidebar.vue'
55
<template>
66
<div class="flex h-screen">
77
<Sidebar class="z-10"/>
8-
<div class="flex-grow flex flex-col p-4 ml-16 h-full overflow-hidden">
8+
<div class="flex-grow flex flex-col p-4 ml-16 h-full">
99
<!-- New space on top with a button -->
1010
<!-- <div class="mb-4 flex justify-between items-center shrink-0">
1111
<h2 class="text-xl font-semibold text-gray-200">File Converter</h2>
1212
</div> -->
1313
<!-- Upload component with flex-grow to take remaining space -->
14-
<div class="flex-grow overflow-auto">
14+
<div class="flex-grow">
1515
<router-view></router-view>
1616
</div>
1717
</div>

src/renderer/src/components/Upload.vue

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ function showUploader() {
162162
// Process files using Sharp
163163
async function processFiles() {
164164
if (files.value.length === 0) return
165-
166165
isProcessing.value = true
167166
processedFiles.value = []
168167
@@ -219,6 +218,19 @@ async function processFiles() {
219218
}
220219
}
221220
221+
// process one
222+
async function processOne(){
223+
if(files.value.length === 0) return;
224+
isProcessing.value = true
225+
processedFiles.value = []
226+
try {
227+
228+
} catch (error) {
229+
230+
}finally{
231+
isProcessing.value = false
232+
}
233+
}
222234
onMounted(() => {
223235
const dropArea = document.querySelector('.drop-area')
224236
const folderIcon = document.querySelector('.folder-icon')
@@ -293,14 +305,14 @@ onMounted(() => {
293305
<!-- File preview section -->
294306
<div v-if="files.length > 0" class="w-full">
295307
<div class="flex justify-between items-center mb-4">
296-
<h3 class="text-lg font-medium text-gray-200">Files ({{ files.length }})</h3>
297-
<div class="flex gap-2">
298-
<button
308+
<button
299309
@click="clickInput"
300310
class="btn btn-sm btn-outline btn-primary"
301311
><img src="../assets/plus.svg" class="w-5 h-5">
302312
Add More Files
303313
</button>
314+
<div class="flex gap-2">
315+
304316
305317
<!-- Process button -->
306318
<button @click="processFiles" class="btn btn-primary btn-outline btn-sm" :disabled="isProcessing">
@@ -311,11 +323,16 @@ onMounted(() => {
311323
</div>
312324
</div>
313325
314-
<!-- File list -->
326+
<!-- Tab group -->
327+
<!-- name of each tab group should be unique -->
328+
<div class="tabs tabs-box">
329+
<input type="radio" name="my_tabs_6" class="tab" aria-label="Files" checked="checked"/>
330+
<div class="tab-content bg-base-100 border-base-300 p-6 max-h-[calc(100vh-9rem)] overflow-y-auto">
331+
<!-- File list -->
315332
<div
316333
v-for="(preview, index) in previewUrls"
317334
:key="index"
318-
class="bg-gray-700 rounded-lg p-4 flex relative m-4 items-center gap-4"
335+
class=" p-4 flex relative m-4 items-center gap-4 border-5 border-midnight rounded-lg hover:border-indigo-500"
319336
>
320337
<!-- Image preview -->
321338
<div class="flex-shrink-0">
@@ -351,7 +368,7 @@ onMounted(() => {
351368
<dialog :id="`image_preview_${index}`" class="modal">
352369
<div class="modal-box max-w-5xl bg-gray-800 p-0">
353370
<form method="dialog">
354-
<button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2 text-white"></button>
371+
<button class="btn btn-sm btn-circle absolute right-2 top-2 text-white"></button>
355372
</form>
356373
<figure>
357374
<img
@@ -444,6 +461,13 @@ onMounted(() => {
444461
<option value="png">PNG</option>
445462
<option value="jpeg">JPEG</option>
446463
<option value="avif">AVIF</option>
464+
<option value="gif">GIF</option>
465+
<option value="jp2">JP2</option>
466+
<option value="tiff">TIFF</option>
467+
<option value="heif">HEIF</option>
468+
<option value="jxl">JXL</option>
469+
<option value="tile">Tile</option>
470+
<option value="raw">Raw (base64)</option>
447471
</select>
448472
</div>
449473
@@ -505,8 +529,15 @@ onMounted(() => {
505529
</label>
506530
</div>
507531
508-
<!-- Reset button -->
509-
<div class="flex justify-end">
532+
<!-- Reset,Save buttons -->
533+
<div class="flex justify-end space-x-3">
534+
<button
535+
:onclick="`document.getElementById('close-modal${index}').click()`"
536+
class="btn btn-xs btn-outline btn-success"
537+
:disabled="!preview.url"
538+
>
539+
Save
540+
</button>
510541
<button
511542
@click="
512543
fileOptions[index] = {
@@ -517,7 +548,7 @@ onMounted(() => {
517548
format: getTargetFormat(preview.type)
518549
}
519550
"
520-
class="btn btn-xs btn-outline"
551+
class="btn btn-xs btn-outline btn-warning"
521552
:disabled="!preview.url"
522553
>
523554
Reset
@@ -526,7 +557,7 @@ onMounted(() => {
526557
</div>
527558
</div>
528559
<form method="dialog" class="modal-backdrop">
529-
<button>close</button>
560+
<button :id="`close-modal${index}`">close</button>
530561
</form>
531562
</dialog>
532563
@@ -571,9 +602,14 @@ onMounted(() => {
571602
</div>
572603
</div>
573604
</div>
574-
605+
</div>
575606
576-
<!-- Results summary -->
607+
<input type="radio" name="my_tabs_6" class="tab" aria-label="Completed" />
608+
<div class="indicator">
609+
<span class="indicator-item badge badge-secondary">{{files.length}}</span>
610+
</div>
611+
<div class="tab-content bg-base-100 border-base-300 p-6 max-h-[calc(100vh-9rem)]">
612+
<!-- Results summary -->
577613
<div v-if="processedFiles.length > 0" class="mt-6 bg-gray-800 rounded-lg p-4">
578614
<h3 class="text-lg font-medium text-gray-200 mb-3">Results</h3>
579615
<ul class="space-y-2">
@@ -592,5 +628,7 @@ onMounted(() => {
592628
</ul>
593629
</div>
594630
</div>
631+
</div>
632+
</div>
595633
</div>
596634
</template>

0 commit comments

Comments
 (0)