Skip to content

Commit

Permalink
prettier format
Browse files Browse the repository at this point in the history
  • Loading branch information
Der-Penz committed Aug 12, 2023
1 parent 1316b29 commit a7ca68a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ footer a:hover {
}
}

input[type=text]{
input[type='text'] {
border-radius: 0.5em;
margin: 0.5em;
padding: 0.5em;
border-color: #2c3e50;
}
}
25 changes: 15 additions & 10 deletions src/routes/icons/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

<main>
<h1>Available Font-Awesome v4 Icons</h1>
<input type="text" name="search" placeholder="Search Icon" on:input={(e) => debounce(e.currentTarget.value)}>
<input
type="text"
name="search"
placeholder="Search Icon"
on:input={(e) => debounce(e.currentTarget.value)}
/>
<table>
<thead>
<tr>
Expand Down Expand Up @@ -52,15 +57,15 @@
function getIcon(name: string): IconType {
return (icons as Record<string, IconType>)[name];
}
let searchValue = '';
let timer : number;
const debounce = (v : string) => {
clearTimeout(timer);
timer = setTimeout(() => {
searchValue = v;
}, 750);
}
let timer: number;
const debounce = (v: string) => {
clearTimeout(timer);
timer = setTimeout(() => {
searchValue = v;
}, 750);
};
$: filteredIcons = data.filter(icon => icon.iconName.toLowerCase().startsWith(searchValue))
$: filteredIcons = data.filter((icon) => icon.iconName.toLowerCase().startsWith(searchValue));
</script>

0 comments on commit a7ca68a

Please sign in to comment.