Skip to content

Commit

Permalink
feat: add help section and amend README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoskript committed Dec 27, 2023
1 parent 24e5847 commit 9c98726
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# jp-onomatopoeia

Compiled dataset of Japanese onomatopoeia and sound effects.
[Japanese Onomatopoeia Search](https://nsk.sh/tools/jp-onomatopoeia/)

Compiled dataset and search tool for Japanese onomatopoeia and sound effects.

## Preview

![](media/preview.png)

## Data sources

- [nihongoresources.com](https://github.com/Pomax/nihongoresources.com)
- [Japanese Manga SFX spreadsheet](https://docs.google.com/spreadsheets/d/1iXFIVmSzukN1PYD1JakdqMmrNNlc7TtkutDKevuKM0c/edit)
- [The Jaded Network](http://thejadednetwork.com/sfx/) (included in the Japanese Manga SFX spreadsheet)
Binary file added media/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta
name="description"
property="og:description"
content="Use this tool to search for Japanese onomatopoeia and sound effects."
content="Use this tool to quickly search for meanings of Japanese onomatopoeia and manga sound effects."
/>
<link
rel="stylesheet"
Expand Down
26 changes: 25 additions & 1 deletion public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const TermSearchForm = ({ query, updateQuery }) => {
type="text"
value=${string}
class="term-search-input"
placeholder="Romaji / Hiragana / Katakana"
placeholder="Romaji · ひらがな · カタカナ"
oninput=${(e) => setString(e.target.value)}
autocomplete="off"
autocapitalize="none"
Expand Down Expand Up @@ -141,6 +141,29 @@ const SearchResults = ({ query }) => {
`;
};

const Help = () => {
return html`
<details>
<summary>Help</summary>
<div className="help-content">
<p>
This tool lets you easily search for definitions of manga sound
effects and onomatopoeia. Type a sound effect in the search box, and
press${" "}
<b>Search</b> to find definitions for that sound effect. You can
search using romaji, hiragana, or katakana.
</p>
<p>
Results where your search term appears at the start of a sound effect
will appear under <b>Exact matches</b>. Results where your search term
appears in the middle of a sound effect will appear under${" "}
<b>Similar matches</b>.
</p>
</div>
</details>
`;
};

function usePageQuery() {
const read = () => new URL(window.location).searchParams;
const [query, setQuery] = useState(read());
Expand All @@ -164,6 +187,7 @@ const Page = () => {
return html`
<div>
<${TermSearchForm} query=${query} updateQuery=${updateQuery} />
<${Help} />
<${SearchResults} query=${query} />
</div>
`;
Expand Down
10 changes: 10 additions & 0 deletions public/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
color: dimgray;
}

.help-content {
border: 0.2rem darkgray solid;
margin: 1rem 0 1.5rem;
padding: 1rem 1.5rem;
}

.help-content p:last-child {
margin-bottom: 0;
}

footer {
text-align: center;
padding-bottom: 2rem;
Expand Down

0 comments on commit 9c98726

Please sign in to comment.