From 1f59d8808fb135d2380d2eb3de3450bdb535aead Mon Sep 17 00:00:00 2001 From: Preston Date: Fri, 27 Oct 2023 11:11:10 -0700 Subject: [PATCH] Update script.js --- script.js | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/script.js b/script.js index 30e70b6..a5ba8ee 100644 --- a/script.js +++ b/script.js @@ -5,28 +5,6 @@ const searchInput = document.getElementById("search-input"); const searchForm = document.getElementById("search-form"); const searchResults = document.getElementById("search-results"); -function animateToTopCenter() { - container.style.justifyContent = "flex-start"; - title.style.fontSize = "30px"; - subtitle.style.fontSize = "14px"; - searchInput.style.fontSize = "14px"; -} - -function animateToMiddleCenter() { - container.style.justifyContent = "center"; - title.style.fontSize = "40px"; - subtitle.style.fontSize = "18px"; - searchInput.style.fontSize = "16px"; -} - -searchInput.addEventListener("input", function() { - if (searchInput.value.trim() !== "") { - animateToTopCenter(); - } else { - animateToMiddleCenter(); - } -}); - async function performSearch(query) { searchResults.textContent = "Searching..."; @@ -45,6 +23,7 @@ async function performSearch(query) { return `
+ Result Icon ${result.Text}

${result.FirstURL}

@@ -60,6 +39,14 @@ async function performSearch(query) { } } +searchInput.addEventListener("input", function() { + if (searchInput.value.trim() !== "") { + animateToTopCenter(); + } else { + animateToMiddleCenter(); + } +}); + searchForm.addEventListener("submit", async function(event) { event.preventDefault(); const query = searchInput.value;