working on the editor

This commit is contained in:
Yanick Champoux 2023-04-20 09:58:52 -04:00
parent 77846acbd6
commit 35e402b74d
5 changed files with 21 additions and 80 deletions

View File

@ -1,22 +1,25 @@
<div class="field"> <div class="field label small" class:suffix>
{#if label}
<label>{label}</label>
{/if}
<slot> <slot>
<input type="text" {placeholder} bind:value on:change /> <input type="text" bind:value on:change />
</slot> </slot>
{#if label}
<label class:active={!!value}>{label}</label>
{/if}
</div> </div>
<script> <script>
export let label = ""; export let label = "";
export let value = ""; export let value = true;
export let placeholder = label; export let placeholder = label;
export let suffix = false;
</script> </script>
<style> <style>
div { div {
font-family: var(--main-font-family); font-family: var(--main-font-family);
} }
/*
div > :global(*) { div > :global(*) {
margin-left: 1em; margin-left: 1em;
} }
@ -29,4 +32,8 @@
font-family: Dosis; font-family: Dosis;
color: var(--indigo-dye); color: var(--indigo-dye);
} }
*/
.field {
margin-bottom: 0px;
}
</style> </style>

View File

@ -1,12 +1,14 @@
<div class="identification-row"> <div class="identification-row">
<div> <div>
<Field label="ship class" bind:value={shipClass} /> <Field label="ship class" bind:value={shipClass} />
<Field label="ship type"> <Field suffix>
<select bind:value={shipType}> <select bind:value={shipType}>
{#each shipTypes as name (name)} {#each shipTypes as name (name)}
<option>{name}</option> <option>{name}</option>
{/each} {/each}
</select> </select>
<label class="active">ship type</label>
<i>arrow_drop_down</i>
</Field> </Field>
</div> </div>
<ShipCost {...reqs} /> <ShipCost {...reqs} />

View File

@ -1,7 +1,6 @@
<div class="mass"> <div class="mass">
<Field label="ship tonnage"> <Field label="ship tonnage">
<input class="short" bind:value={mass} type="number" min="10" max="300" /> <input bind:value={mass} type="number" min="10" max="300" />
<img class="mass_symbol" src="{base}/mass.svg" alt="mass" />
<div class="note" class:warning={!withinBudget}> <div class="note" class:warning={!withinBudget}>
{#if withinBudget} {#if withinBudget}
@ -54,10 +53,6 @@
grid-column: span 3; grid-column: span 3;
justify-content: space-around; justify-content: space-around;
} }
input {
width: 5em;
display: inline !important;
}
.mass_symbol { .mass_symbol {
width: 0.75em; width: 0.75em;
display: inline-block; display: inline-block;

View File

@ -2,7 +2,7 @@
<div> <div>
<Field label="thrust rating"> <Field label="thrust rating">
<input <input
class="short" class="engine"
type="number" type="number"
bind:value={rating} bind:value={rating}
min="0" min="0"
@ -29,28 +29,11 @@
</script> </script>
<style> <style>
input.engine {
width: 9em;
}
div { div {
display: flex; display: flex;
align-items: end; align-items: end;
} }
label {
font-family: var(--main-font-family);
margin-left: 2em;
}
input[type="number"] {
width: 5em;
}
input {
margin-bottom: 0px !important;
}
input:not([type="checkbox"]) {
border: 0px;
border-bottom: 1px solid var(--indigo-dye);
border-radius: 0px;
height: calc(
1rem * var(--line-height) + var(--form-element-spacing-vertical) * 1
);
padding: 0 0.5rem;
text-align: center;
}
</style> </style>

View File

@ -62,52 +62,6 @@ input.short {
color: rgb(0, 80, 160); color: rgb(0, 80, 160);
} }
label {
display: block;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
padding: 0.4em;
margin: 0 0 0.5em 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 2px;
}
input:disabled {
color: #ccc;
}
input[type="range"] {
height: 0;
}
/* input, */
/* select { */
/* border: 0px; */
/* border-bottom: 1px solid var(--indigo-dye); */
/* } */
input:focus,
select:focus {
border: 1px solid var(--indigo-dye);
}
input:not([type="checkbox"]):not([type="radio"]) {
border: 0px;
border-bottom: 1px solid var(--indigo-dye);
border-radius: 0px;
height: calc(
1rem * var(--line-height) + var(--form-element-spacing-vertical) * 1
);
padding: 0 0.5rem;
text-align: center;
}
h1 { font-size: var(--font-scale-15); } h1 { font-size: var(--font-scale-15); }
h2 { font-size: var(--font-scale-14); } h2 { font-size: var(--font-scale-14); }