Some CSS cleanup

This commit is contained in:
Robin van der Linde 2024-04-25 21:52:48 +02:00
parent f49c64a201
commit 187149b5b3
Signed by untrusted user: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D
4 changed files with 31 additions and 16 deletions

View file

@ -781,10 +781,6 @@ video {
float: left; float: left;
} }
.m-8 {
margin: 2rem;
}
.m-4 { .m-4 {
margin: 1rem; margin: 1rem;
} }
@ -797,6 +793,10 @@ video {
margin: 0px; margin: 0px;
} }
.m-8 {
margin: 2rem;
}
.m-2 { .m-2 {
margin: 0.5rem; margin: 0.5rem;
} }
@ -900,10 +900,6 @@ video {
margin-right: 4rem; margin-right: 4rem;
} }
.mb-4 {
margin-bottom: 1rem;
}
.mt-4 { .mt-4 {
margin-top: 1rem; margin-top: 1rem;
} }
@ -936,6 +932,10 @@ video {
margin-right: 0.25rem; margin-right: 0.25rem;
} }
.mb-4 {
margin-bottom: 1rem;
}
.ml-1 { .ml-1 {
margin-left: 0.25rem; margin-left: 0.25rem;
} }
@ -1163,6 +1163,10 @@ video {
height: 20rem; height: 20rem;
} }
.h-36 {
height: 9rem;
}
.h-56 { .h-56 {
height: 14rem; height: 14rem;
} }
@ -1580,6 +1584,10 @@ video {
overflow: hidden; overflow: hidden;
} }
.overflow-scroll {
overflow: scroll;
}
.overflow-x-auto { .overflow-x-auto {
overflow-x: auto; overflow-x: auto;
} }

View file

@ -100,7 +100,7 @@
<input <input
autofocus autofocus
bind:value={$themeSearchText} bind:value={$themeSearchText}
class="mr-4 w-full" class="mr-4 w-full outline-none"
id="theme-search" id="theme-search"
type="search" type="search"
use:placeholder={tr.searchForATheme} use:placeholder={tr.searchForATheme}

View file

@ -113,7 +113,7 @@
{:else} {:else}
<input <input
type="search" type="search"
class="w-full" class="w-full outline-none"
bind:this={inputElement} bind:this={inputElement}
on:keypress={(keypr) => { on:keypress={(keypr) => {
feedback = undefined feedback = undefined

View file

@ -5,6 +5,8 @@
import * as nsiFeatures from "../../../../node_modules/name-suggestion-index/dist/featureCollection.json" import * as nsiFeatures from "../../../../node_modules/name-suggestion-index/dist/featureCollection.json"
import { LocationConflation } from "@rapideditor/location-conflation" import { LocationConflation } from "@rapideditor/location-conflation"
import * as turf from "@turf/turf" import * as turf from "@turf/turf"
import { SearchIcon } from "@rgossiaux/svelte-heroicons/solid"
import { twMerge } from "tailwind-merge"
const nsiFile: NSIFile = nsi const nsiFile: NSIFile = nsi
const loco = new LocationConflation(nsiFeatures) const loco = new LocationConflation(nsiFeatures)
@ -22,8 +24,6 @@
let maintag = helperArgs[0].toString() let maintag = helperArgs[0].toString()
let tag = key let tag = key
let selectedItem: NSIItem
const path = `${tag}s/${maintag.split("=")[0]}/${maintag.split("=")[1]}` const path = `${tag}s/${maintag.split("=")[0]}/${maintag.split("=")[1]}`
// Check if the path exists in the NSI file // Check if the path exists in the NSI file
@ -34,6 +34,8 @@
let items = nsiFile.nsi[path].items let items = nsiFile.nsi[path].items
let selectedItem: NSIItem = items.find((item) => item.tags[tag] === value.data)
// Get the coordinates if the feature is a point, otherwise use the center // Get the coordinates if the feature is a point, otherwise use the center
let lon: number let lon: number
let lat: number let lat: number
@ -62,7 +64,6 @@
} }
return true return true
}) })
.slice(0, 25)
/** /**
* Some interfaces for the NSI files * Some interfaces for the NSI files
@ -121,11 +122,17 @@
</script> </script>
<div> <div>
<input type="text" placeholder="Filter entries" bind:value={filter} /> <div class="normal-background my-2 flex w-5/6 justify-between rounded-full pl-2">
<div class="flex h-32 w-full flex-wrap overflow-hidden"> <input type="text" placeholder="Filter entries" bind:value={filter} class="outline-none" />
<SearchIcon aria-hidden="true" class="h-6 w-6 self-end" />
</div>
<div class="flex h-36 w-full flex-wrap overflow-scroll">
{#each filteredItems as item} {#each filteredItems as item}
<div <div
class="m-1 h-fit rounded-full border border-black p-4 text-center" class={twMerge(
"m-1 h-fit rounded-full border-2 border-black p-4 text-center",
selectedItem === item ? "interactive" : "bg-white"
)}
on:click={() => { on:click={() => {
select(item) select(item)
}} }}