diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index cb04852..e61cad5 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,10 +1,10 @@ ## Checklist ### Required changes: -- [ ] Center the description (Line 17 in HTML file) using a single change in CSS -- [ ] Fix JS so that when the search is executed, the search engine is not present in query -- [ ] Add Google Drive, Google Slides and Google Sheets as a provider +- ✓ Center the description (Line 17 in HTML file) using a single change in CSS +- ✓ Fix JS so that when the search is executed, the search engine is not present in query +- ✓ Add Google Drive, Google Slides and Google Sheets as a provider ### Optional changes: -- [ ] Add other search providers (GitHub, Spotify, etc) -- [ ] Additional CSS styling (as you like) \ No newline at end of file +- ✓ Add other search providers (GitHub, Spotify, etc) +- ✓ Additional CSS styling (as you like) diff --git a/README.md b/README.md index 97ffa26..41dbf9d 100644 --- a/README.md +++ b/README.md @@ -5,5 +5,16 @@ Supported providers (first_word): - Google (google) (Default) - YouTube (youtube) - Google Docs (docs) +- Google drive +- Google slides +- Google sheets +- Spotify +- github +- wattpad +- goodreads +- animixplay +- stackoverflow -[Icons created by freepik on Flaticon](https://www.flaticon.com/authors/freepik) \ No newline at end of file +https://github.com/toasted-breads-2/multisearch + +[Icons created by freepik on Flaticon](https://www.flaticon.com/authors/freepik) diff --git a/Wattpad.png b/Wattpad.png new file mode 100644 index 0000000..db7b70c Binary files /dev/null and b/Wattpad.png differ diff --git a/animixplay.png b/animixplay.png new file mode 100644 index 0000000..17e58f2 Binary files /dev/null and b/animixplay.png differ diff --git a/docs.png b/docs.png index c3c99a5..f85b081 100644 Binary files a/docs.png and b/docs.png differ diff --git a/drive.png b/drive.png new file mode 100644 index 0000000..a5f09e4 Binary files /dev/null and b/drive.png differ diff --git a/github.png b/github.png new file mode 100644 index 0000000..32644d8 Binary files /dev/null and b/github.png differ diff --git a/goodreads.png b/goodreads.png new file mode 100644 index 0000000..e07f1a2 Binary files /dev/null and b/goodreads.png differ diff --git a/index.css b/index.css index 09dae3a..d001ac4 100644 --- a/index.css +++ b/index.css @@ -1,6 +1,7 @@ html, body { height: 100vh; width: 100vw; + background-color:rgb(200, 182, 182); } body { display: flex; @@ -24,6 +25,8 @@ body { font-size: 5rem; margin: 1.5rem; font-weight: 500; + font-family: 'MomsTypewriterRegular',monospace; + } @media screen and (max-width:540px) { .heading { @@ -31,10 +34,11 @@ body { } } .description { + text-align: center; font-style: oblique; } .search_wrapper { - border: 0.125rem solid rgb(23, 23, 23); + border: 0.125rem solid dotted #575a6b; height: 3rem; padding: 0.25rem 0.75rem; box-sizing: border-box; @@ -88,4 +92,4 @@ body { .search_icon { width: 1.5rem; height: 1.5rem; -} \ No newline at end of file +} diff --git a/index.js b/index.js index ba99abc..51cbfec 100644 --- a/index.js +++ b/index.js @@ -2,11 +2,22 @@ let current_search = 'google' document.querySelector('.search_input').addEventListener('keyup', e => { const input = e.target.value; let search_engine = input.split(' ')[0].toLowerCase(); - let search_query = input.split(' ').splice(0).join(' '); + let search_query = input.split(' ').splice(1); switch(search_engine){ case 'google': case 'youtube': - case 'docs': break; + case 'docs': + case 'drive': + case 'slides': + case 'sheets': + case 'Spotify': + case 'GitHub': + case 'Wattpad': + case 'goodreads': + case 'animixplay': + case 'stackoverflow': + + break; default: search_engine = 'google'; search_query = input; } @@ -26,7 +37,43 @@ document.querySelector('.search_input').addEventListener('keyup', e => { image.src = 'docs.png'; image.alt = 'Google Docs icon'; break; - } + case 'drive': + image.src = 'drive.png'; + image.alt = 'Google drive icon'; + break; + case 'slides': + image.src = 'slides.png'; + image.alt = 'Google slides icon'; + break; + case 'sheets': + image.src = 'sheets.png'; + image.alt = 'Google sheets icon'; + break; + case 'Spotify': + image.src = 'spotify.png'; + image.alt = 'spotify icon'; + break; + case 'GitHub': + image.src = 'github.png'; + image.alt = 'github icon'; + break; + case 'Wattpad': + image.src = 'Wattpad.png'; + image.alt = 'Wattpad icon'; + break; + case 'goodreads': + image.src = 'goodreads.png'; + image.alt = 'goodreads icon'; + break; + case 'animixplay': + image.src = 'animixplay.png'; + image.alt = 'animixplay icon'; + break; + case 'stackoverflow': + image.src = 'stackoverflow.png'; + image.alt = 'stackoverflow icon'; + break; + } } if(e.key === 'Enter') switch(search_engine) { @@ -36,7 +83,34 @@ document.querySelector('.search_input').addEventListener('keyup', e => { case 'youtube': window.location = `https://www.youtube.com/results?search_query=${search_query}`; break; - default: + case 'drive': + window.location = `https://drive.google.com/drive/search?q=${search_query}`; + break; + case 'slides': + window.location = `https://docs.google.com/presentation/u/0/?tgif=d&q=${search_query}`; + break; + case 'sheets': + window.location = `https://docs.google.com/spreadsheets/u/0/?tgif=d&q=${search_query}`; + break; + case 'Spotify': + window.location = `https://open.spotify.com/search/${search_query}`; + break; + case 'GitHub': + window.location = `https://github.com/search?q=${search_query}`; + break; + case 'Wattpad': + window.location = `https://www.wattpad.com/search/${search_query}`; + break; + case 'goodreads': + window.location = `https://www.goodreads.com/search?utf8=%E2%9C%93&query=${search_query}`; + break; + case 'animixplay': + window.location = `https://animixplay.to/?q=${search_query}`; + break; + case 'stackoverflow': + window.location = `https://stackoverflow.com/search?q=${search_query}`; + break; + default: window.location = `https://www.google.com/search?q=${search_query}`; } -}); \ No newline at end of file +}); diff --git a/sheets.png b/sheets.png new file mode 100644 index 0000000..1ff3504 Binary files /dev/null and b/sheets.png differ diff --git a/slides.png b/slides.png new file mode 100644 index 0000000..70372dd Binary files /dev/null and b/slides.png differ diff --git a/spotify.png b/spotify.png new file mode 100644 index 0000000..f32a084 Binary files /dev/null and b/spotify.png differ diff --git a/stackoverflow.png b/stackoverflow.png new file mode 100644 index 0000000..9598ec6 Binary files /dev/null and b/stackoverflow.png differ