light-mode fixes, prevent empty search queries from getting sent
This commit is contained in:
@@ -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();
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user