Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

fix: clean up/use FancyInput everywhere

Mayad54094722f51
diff --git a/src/lib/components/functional/FancyInput.svelte b/src/lib/components/functional/FancyInput.svelte
index c1b6740..179f8af 100644
--- a/src/lib/components/functional/FancyInput.svelte
+++ b/src/lib/components/functional/FancyInput.svelte
@@ -1,40 +1,28 @@
<script lang="ts">
- type Props = {
- class?: string;
- placeholder?: string;
- value?: string;
- disabled?: boolean;
+ import type { HTMLInputAttributes } from "svelte/elements";
+
+ interface Props extends HTMLInputAttributes {
extension?: string;
prefix?: string;
- type?: string;
- min?: number;
- max?: number;
- };
+ }
let {
class: className,
- placeholder = "",
value = $bindable(),
disabled = false,
extension,
prefix,
- type = "text",
- min = 0,
- max = 100,
+ ...rest
}: Props = $props();
</script>
<div class="relative flex w-full {className}">
<input
- {type}
- {min}
- {max}
+ {...rest}
bind:value
- {placeholder}
- {disabled}
class="w-full p-3 rounded-lg bg-panel border-2 border-button
- {prefix ? 'pl-[2rem]' : 'pl-3'}
- {extension ? 'pr-[4rem]' : 'pr-3'}
+ {prefix ? 'pl-[2rem]' : 'pl-3'}
+ {extension ? 'pr-[4rem]' : 'pr-3'}
{disabled && 'opacity-50 cursor-not-allowed'}"
/>
{#if prefix}
diff --git a/src/lib/components/functional/FormatDropdown.svelte b/src/lib/components/functional/FormatDropdown.svelte
index 321abab..e1198a4 100644
--- a/src/lib/components/functional/FormatDropdown.svelte
+++ b/src/lib/components/functional/FormatDropdown.svelte
@@ -10,6 +10,7 @@
import { VertFile } from "$lib/types";
import Modal from "./Modal.svelte";
import Dropdown from "./Dropdown.svelte";
+ import FancyInput from "./FancyInput.svelte";
type Props = {
categories: Categories;
@@ -406,7 +407,7 @@
<div class="flex flex-col gap-2">
<p class="text-sm font-bold">Resolution</p>
- <input
+ <FancyInput
type="text"
placeholder="1920x1080 or smth"
class="rounded-lg bg-button text-foreground p-3"
@@ -415,7 +416,7 @@
<div class="flex flex-col gap-2">
<p class="text-sm font-bold">Frame Rate (FPS)</p>
- <input
+ <FancyInput
type="number"
placeholder="30"
class="rounded-lg bg-button text-foreground p-3"
@@ -498,7 +499,7 @@
<!-- search box -->
<div class="p-3 w-full">
<div class="relative">
- <input
+ <FancyInput
type="text"
placeholder={m["convert.dropdown.placeholder"]()}
class="flex-grow w-full !pl-11 !pr-3 rounded-lg bg-panel text-foreground"
diff --git a/src/lib/sections/settings/Vertd.svelte b/src/lib/sections/settings/Vertd.svelte
index de116a2..e1a6c46 100644
--- a/src/lib/sections/settings/Vertd.svelte
+++ b/src/lib/sections/settings/Vertd.svelte
@@ -9,6 +9,7 @@
import { m } from "$lib/paraglide/messages";
import { link, sanitize } from "$lib/store/index.svelte";
import { VertdInstance, type VertdInner } from "./vertdSettings.svelte";
+ import FancyInput from "$lib/components/functional/FancyInput.svelte";
let vertdCommit = $state<string | null>(null);
let abortController: AbortController | null = null;
@@ -132,7 +133,7 @@
settingsStyle
/>
{#if VertdInstance.instance.innerData().type === "custom"}
- <input
+ <FancyInput
type="text"
placeholder={m["settings.vertd.url_placeholder"]()}
bind:value={settings.vertdURL}