mirror of https://github.com/VERT-sh/VERT.git
parent
dbc3774c5b
commit
d63c2e60a7
|
@ -1,5 +1,7 @@
|
|||
# VERT
|
||||
|
||||

|
||||
|
||||
VERT is a file conversion utility for the web that uses WebAssembly to convert files directly on your device instead of on a cloud. Check out the live instance at [vert.sh](https://vert.sh).
|
||||
|
||||
VERT is built with Svelte & TypeScript (using [bun](https://bun.sh)).
|
||||
|
|
|
@ -21,7 +21,12 @@
|
|||
let fileInput = $state<HTMLInputElement>();
|
||||
let dragOver = $state(false);
|
||||
|
||||
let { files = $bindable(), onupload, isMobile, acceptedFormats }: Props = $props();
|
||||
let {
|
||||
files = $bindable(),
|
||||
onupload,
|
||||
isMobile,
|
||||
acceptedFormats,
|
||||
}: Props = $props();
|
||||
|
||||
function upload() {
|
||||
if (!fileInput) return;
|
||||
|
|
|
@ -19,4 +19,4 @@ class Files {
|
|||
|
||||
export const files = new Files();
|
||||
|
||||
export const outputFilenameOption = ['default', 'original'];
|
||||
export const outputFilenameOption = ["default", "original"];
|
||||
|
|
|
@ -86,7 +86,9 @@
|
|||
isMobile={data.isMobile}
|
||||
bind:files={ourFiles}
|
||||
onupload={runUpload}
|
||||
acceptedFormats={[...new Set(converters.flatMap((c) => c.supportedFormats))]}
|
||||
acceptedFormats={[
|
||||
...new Set(converters.flatMap((c) => c.supportedFormats)),
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
});
|
||||
|
||||
// reloads the "output filename" option
|
||||
const savedOption = localStorage.getItem('outputFilename');
|
||||
const savedOption = localStorage.getItem("outputFilename");
|
||||
if (savedOption) {
|
||||
outputFilename = savedOption;
|
||||
}
|
||||
|
@ -134,7 +134,8 @@
|
|||
if (files.files.length === 0) return;
|
||||
if (files.files.length === 1) {
|
||||
// download the image only
|
||||
const filename = outputFilename === "default"
|
||||
const filename =
|
||||
outputFilename === "default"
|
||||
? `VERT-Converted_${date}`
|
||||
: files.files[0].file.name.replace(/\.[^/.]+$/, "");
|
||||
const blob = URL.createObjectURL(
|
||||
|
@ -204,7 +205,10 @@
|
|||
selected={outputFilename}
|
||||
onselect={(o) => {
|
||||
outputFilename = o;
|
||||
localStorage.setItem('outputFilename', o);
|
||||
localStorage.setItem(
|
||||
"outputFilename",
|
||||
o,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue