light-mode fixes, prevent empty search queries from getting sent

This commit is contained in:
2024-06-12 09:39:09 -04:00
parent 31219f6d06
commit e54a60359c
4 changed files with 13 additions and 9 deletions

View File

@@ -9,7 +9,10 @@
const { value } = target as HTMLInputElement;
clearTimeout(timer);
timer = setTimeout(async () => {
// const section = window.location.pathname.split('/')[1];
if (!value) {
searchResults.set([]);
return;
}
const response = await fetch(`/api/search?q=${encodeURIComponent(value)}`);
if (response.ok) {
const data: SearchResult[] = await response.json();

View File

@@ -2,6 +2,7 @@
import { T } from '@threlte/core';
export let size = 100;
export let count = 500;
export let color = localStorage.getItem('theme') === 'forest' ? 'white' : '#a991f7';
const positions = new Float32Array(count * 3);
@@ -26,5 +27,5 @@
}}
/>
</T.BufferGeometry>
<T.PointsMaterial size={0.1} />
<T.PointsMaterial size={0.1} {color} />
</T.Points>