website/src/lib/Form/Meta.svelte

52 lines
1.0 KiB
Svelte
Raw Normal View History

2022-08-18 00:08:27 +05:30
<script lang="ts">
export let inputType: string = "";
2023-01-07 22:59:58 +05:30
export let inputName: string = "";
export let inputPlaceholder: string = "";
2023-01-07 22:59:58 +05:30
export let select: boolean = true;
export let selectType: string = "";
2023-01-07 22:59:58 +05:30
export let input2: boolean = false;
export let input2Type: string = "";
export let input2Name: string = "";
export let input2Placeholder: string = "";
2022-08-18 00:08:27 +05:30
</script>
2022-12-27 20:58:47 +05:30
<div
class="flex items-center flex-row gap-4 children:w-[50%] lt-sm:(flex-col items-start justify-center children:w-[calc(100%-1rem)])"
>
2022-08-31 16:46:12 +05:30
<input
type={inputType}
2023-01-07 22:59:58 +05:30
name={inputName}
2022-08-31 16:46:12 +05:30
class="form-textbox"
placeholder={inputPlaceholder}
required
/>
2023-01-07 22:59:58 +05:30
{#if input2}
<input
type={input2Type}
name={input2Name}
class="form-textbox"
placeholder={input2Placeholder}
required
/>
{/if}
{#if select}
<select
name={selectType}
required
class="form-button"
>
<slot />
</select>
{/if}
2022-08-18 00:08:27 +05:30
</div>
2023-01-07 22:59:58 +05:30
{#if select}
<style>
@media screen and (max-width: 640px) {
div > :nth-child(2) {
width: 100%;
}
2022-08-18 00:08:27 +05:30
}
2023-01-07 22:59:58 +05:30
</style>
{/if}