From 1796d716e7d1318e8f7aef31c8640d2df2185b1b Mon Sep 17 00:00:00 2001 From: huygensCortex <51647351+huygensCortex@users.noreply.github.com> Date: Tue, 17 Oct 2023 23:40:46 -0400 Subject: [PATCH] ui improvements --- src/recommenderapp/static/script.js | 23 ++++++++++++++++--- src/recommenderapp/static/stylesheet.css | 7 +++++- .../templates/landing_page.html | 9 ++++++-- src/recommenderapp/templates/search_page.html | 5 ++++ 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/recommenderapp/static/script.js b/src/recommenderapp/static/script.js index 315efe88a..abc129e14 100644 --- a/src/recommenderapp/static/script.js +++ b/src/recommenderapp/static/script.js @@ -1,4 +1,5 @@ $(document).ready(function () { + $(function () { $("#searchBox").autocomplete({ source: function (request, response) { @@ -41,6 +42,8 @@ $(document).ready(function () { }); $("#predict").click(function () { + $("#loader").attr("class", "d-flex justify-content-center"); + var movie_list = []; $("#selectedMovies li").each(function () { @@ -94,20 +97,34 @@ $(document).ready(function () { ulList.append(fieldset); i += 1; }); - - // var li = $('
  • ').text() + $("#loader").attr("class", "d-none"); console.log("->", response["recommendations"]); }, error: function (error) { console.log("ERROR ->" + error); + $("#loader").attr("class", "d-none"); }, }); }); + window.addEventListener("popstate", function (event) { + // Check if the user is navigating back + if (event.state && event.state.page === "redirect") { + // Redirect the user to a specific URL + window.location.href = "/"; + location.reload(); + } + }); + // Function to handle Get Started button click function getStarted() { // Navigate to the search page - window.location.href = "/search_page"; // Replace with the actual URL of your search page + $("#loaderLanding").attr("class", "d-flex justify-content-center"); + $("#centralDivLanding").hide(); + $('#landingTopNav').hide(); + setTimeout(function() { + window.location.href = "/search_page"; // Replace with the actual URL of your search page + }, 2000); } // Bind the getStarted function to the Get Started button click diff --git a/src/recommenderapp/static/stylesheet.css b/src/recommenderapp/static/stylesheet.css index 921a6be0b..0bace0fdb 100644 --- a/src/recommenderapp/static/stylesheet.css +++ b/src/recommenderapp/static/stylesheet.css @@ -1,9 +1,14 @@ + .landing-page { background-image: url("image.jpg"); background-size: cover; color: azure !important; } +.table { + color: white !important; +} + .highlighted-section { background-color: black; color: white; @@ -16,7 +21,7 @@ } body { - background-image: url("224299.jpg"); + background-image: url("image.jpg"); background-size: cover; color: azure !important; } diff --git a/src/recommenderapp/templates/landing_page.html b/src/recommenderapp/templates/landing_page.html index 8c7da925c..6a85b5d48 100644 --- a/src/recommenderapp/templates/landing_page.html +++ b/src/recommenderapp/templates/landing_page.html @@ -13,7 +13,7 @@ -