Skip to content

Commit

Permalink
Merge pull request #55 from adipai/ui-branch
Browse files Browse the repository at this point in the history
ui improvements
  • Loading branch information
samarthshetty09 authored Oct 18, 2023
2 parents 90416de + 1796d71 commit d55adc9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
23 changes: 20 additions & 3 deletions src/recommenderapp/static/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
$(document).ready(function () {

$(function () {
$("#searchBox").autocomplete({
source: function (request, response) {
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -94,20 +97,34 @@ $(document).ready(function () {
ulList.append(fieldset);
i += 1;
});

// var li = $('<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
Expand Down
7 changes: 6 additions & 1 deletion src/recommenderapp/static/stylesheet.css
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -16,7 +21,7 @@
}

body {
background-image: url("224299.jpg");
background-image: url("image.jpg");
background-size: cover;
color: azure !important;
}
Expand Down
9 changes: 7 additions & 2 deletions src/recommenderapp/templates/landing_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</head>

<body class="landing-page">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark topNavBar fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark topNavBar fixed-top" id="landingTopNav">
<div class="container-fluid">
<a class="navbar-brand" href="#">PopcornPicks🍿</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
Expand All @@ -22,7 +22,7 @@
</div>
</nav>

<div class="container" style="margin-top: 60px;">
<div class="container" style="margin-top: 60px;" id="centralDivLanding">
<div class="heading1"><br><br><br><br>
<h2><center>🎬 PopcornPicks: Pick a Movie! 🎬</center></h2>
<p style="text-align: center; color: azure; font-size: 18px;"><br>
Expand All @@ -39,6 +39,11 @@ <h2><center>🎬 PopcornPicks: Pick a Movie! 🎬</center></h2>
</div>
</div>
</div>
<div class="d-none" id="loaderLanding">
<div class="spinner-border" role="status">
<span class="sr-only"></span>
</div>
</div>

</body>

Expand Down
5 changes: 5 additions & 0 deletions src/recommenderapp/templates/search_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ <h2>Recommended Movies:</h2>
</div>
</div>
</div>
<div class="d-none" id="loader">
<div class="spinner-border" role="status">
<span class="sr-only"></span>
</div>
</div>
<div class="container" style="margin-top: 20px;">
<div class="row">
<div class="col-md-12">
Expand Down

0 comments on commit d55adc9

Please sign in to comment.