diff --git a/amazon.png b/amazon.png new file mode 100644 index 0000000..1352945 Binary files /dev/null and b/amazon.png differ diff --git a/amazon2.png b/amazon2.png new file mode 100644 index 0000000..8efa0e5 Binary files /dev/null and b/amazon2.png differ diff --git a/drive.png b/drive.png new file mode 100644 index 0000000..d90b41e Binary files /dev/null and b/drive.png differ diff --git a/index.css b/index.css index 09dae3a..d4be26d 100644 --- a/index.css +++ b/index.css @@ -10,12 +10,15 @@ body { box-sizing: border-box; font-family: 'Comfortaa', cursive; margin: 0; + background-color: #FFDEE9; + background-color: #FFDEE9; + background-image: linear-gradient(0deg, #FFDEE9 33%, #B5FFFC 100%); } .container { display: flex; flex-direction: column; max-width: min(100vw, 80rem); - /* Hint */ + align-items: center; } .container > * { margin: 0.5rem; @@ -48,7 +51,7 @@ body { position: absolute; font-size: 1.25rem; transform-origin: left; - background-color: white; + background-color: rgba(255, 255, 255, 0.514); padding: 0 0.5rem; z-index: -1; margin-left: 1.5rem; @@ -80,7 +83,7 @@ body { align-items: center; align-self: flex-end; color: white; - background-color: #3F51B5; + background-color: rgba(216, 46, 46, 0.313); border-radius: 0.25rem; border: none; padding: 0.5rem 0.75rem; diff --git a/index.html b/index.html index 2d93f25..9d3ba2a 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@
diff --git a/index.js b/index.js
index ba99abc..179f57b 100644
--- a/index.js
+++ b/index.js
@@ -3,13 +3,23 @@ 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(' ');
+
switch(search_engine){
case 'google':
case 'youtube':
- case 'docs': break;
+ case 'drive':
+ case 'sheets':
+ case 'slides':
+ case 'docs':
+ case 'wikipedia':
+ case 'playstore':
+ case 'amazon':
+ break;
default: search_engine = 'google';
- search_query = input;
+ search_query = 'google ' + input;
}
+ let search = search_query.split(' ').splice(1).join(' ');
+
if(search_engine !== current_search) {
current_search = search_engine;
const image = document.querySelector('.search_icon');
@@ -26,17 +36,59 @@ 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 = 'slides2.png';
+ image.alt = 'Google Slides icon';
+ break;
+ case 'sheets':
+ image.src = 'sheets.png';
+ image.alt = 'Google Sheets icon';
+ break;
+ case 'wikipedia':
+ image.src = 'wikipedia.png';
+ image.alt = 'Wikipedia icon';
+ break;
+ case 'playstore':
+ image.src = 'playstore3.png';
+ image.alt = 'Playstore icon';
+ break;
+ case 'amazon':
+ image.src = 'amazon2.png';
+ image.alt = 'Amazon icon';
+ break;
}
}
if(e.key === 'Enter')
switch(search_engine) {
case 'docs':
- window.location = `https://docs.google.com/document/?q=${search_query}`;
+ window.location = `https://docs.google.com/document/?q=${search}`;
break;
case 'youtube':
- window.location = `https://www.youtube.com/results?search_query=${search_query}`;
+ window.location = `https://www.youtube.com/results?search_query=${search}`;
+ break;
+ case 'drive':
+ window.location = `https://drive.google.com/drive/search?q=${search}`;
+ break;
+ case 'slides':
+ window.location = `https://docs.google.com/presentation/?q=${search}`;
+ break;
+ case 'sheets':
+ window.location = `https://docs.google.com/spreadsheets/?q=${search}`;
+ break;
+ case 'wikipedia':
+ window.location = `https://en.wikipedia.org/wiki/Special:Search?search=${search}`;
+ break;
+ case 'playstore':
+ window.location = `https://play.google.com/store/search?q=${search}`;
+ break;
+ case 'amazon':
+ window.location = `https://www.amazon.in/s?k=${search}`;
break;
default:
- window.location = `https://www.google.com/search?q=${search_query}`;
+ window.location = `https://www.google.com/search?q=${search}`;
}
});
\ No newline at end of file
diff --git a/playStore.png b/playStore.png
new file mode 100644
index 0000000..ca3bfe9
Binary files /dev/null and b/playStore.png differ
diff --git a/playstore2.jpg b/playstore2.jpg
new file mode 100644
index 0000000..5bb1d7a
Binary files /dev/null and b/playstore2.jpg differ
diff --git a/playstore3.png b/playstore3.png
new file mode 100644
index 0000000..e5c9515
Binary files /dev/null and b/playstore3.png differ
diff --git a/sheets.png b/sheets.png
new file mode 100644
index 0000000..9a25288
Binary files /dev/null and b/sheets.png differ
diff --git a/sheets2.png b/sheets2.png
new file mode 100644
index 0000000..4694bd8
Binary files /dev/null and b/sheets2.png differ
diff --git a/slides.png b/slides.png
new file mode 100644
index 0000000..6900cba
Binary files /dev/null and b/slides.png differ
diff --git a/slides2.png b/slides2.png
new file mode 100644
index 0000000..4cebb64
Binary files /dev/null and b/slides2.png differ
diff --git a/wikipedia.png b/wikipedia.png
new file mode 100644
index 0000000..09105fd
Binary files /dev/null and b/wikipedia.png differ