aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/css/style.css2
-rw-r--r--app/scripts/search.js12
2 files changed, 8 insertions, 6 deletions
diff --git a/app/css/style.css b/app/css/style.css
index 3031eb2..d9ff071 100644
--- a/app/css/style.css
+++ b/app/css/style.css
@@ -26,7 +26,7 @@ body {
.search {
background: transparent;
- font-size: 24px;
+ font-size: 3rem;
border: none;
color: #ffffff;
outline: none;
diff --git a/app/scripts/search.js b/app/scripts/search.js
index 0b1f70f..d9fdc71 100644
--- a/app/scripts/search.js
+++ b/app/scripts/search.js
@@ -2,9 +2,11 @@ const searchBox = document.getElementById('searchBox');
const natural = require('natural');
const wordnet = new natural.WordNet();
-searchBox.addEventListener('keyup', () => {
- const word = searchBox.value;
- wordnet.lookup(word, details => {
- console.log(details);
- });
+searchBox.addEventListener('keypress', (e) => {
+ if (e.keyCode === 13) {
+ const word = searchBox.value;
+ wordnet.lookup(word, details => {
+ console.log(details);
+ });
+ }
});