-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.vue
65 lines (57 loc) · 1.31 KB
/
app.vue
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
<script setup>
const state = ref('input')
const files = ref([])
const options = ref({
scale: 4,
auto: true,
threads: 1, // updated to navigator.hardwareConcurrency - 2 inside StepOptions
optimize: true,
outputName: 'images',
})
function next() {
state.value = (() => {
switch (state.value) {
case 'input': return 'options'
case 'options': return 'processing'
case 'processing': return 'complete'
case 'complete':
default:
files.value = []
return 'input'
}
})()
}
</script>
<template>
<div id="app" class="col centerChildren">
<StaticHeader />
<StepInput
v-if="state === 'input'"
v-model:files="files" v-model:outputName="options.outputName" @next="next()"
/>
<StepOptions
v-else-if="state === 'options'"
v-model:options="options" @next="next()"
/>
<StepProcessing
v-else-if="state === 'processing'"
:files="files" :options="options" @next="next()"
/>
<StepComplete
v-else-if="state === 'complete'"
@next="next()"
/>
<div class="spacer" />
<StaticInfo />
<StaticBackground />
<UtilErrors />
</div>
</template>
<style>
#app {
min-height: calc(100vh - 2.5rem);
max-width: calc(100vw - 1rem);
margin-top: 2rem;
margin-bottom: .5rem;
}
</style>