fix: clean up/use FancyInput everywhere

forgor
This commit is contained in:
Maya 2026-02-13 09:04:40 +03:00
parent 30bbb764ae
commit d54094722f
No known key found for this signature in database
3 changed files with 14 additions and 24 deletions

View File

@ -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}

View File

@ -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"

View File

@ -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}