-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocessing.html
171 lines (132 loc) · 5.92 KB
/
processing.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!-- FindMyBorough V1. Frontend Coded by Alex Choi-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="generator" content="Hugo 0.84.0">
<title>FindMyBorough! - Processing...</title>
<link rel="canonical" href="https://getbootstrap.com/docs/5.0/examples/navbar-fixed/">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="img/icon.ico">
<!-- Bootstrap core CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<!-- Custom styles for this template -->
<link href="style.css" rel="stylesheet">
<!-- PyScript -->
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
<py-config>
packages = ["numpy", "pandas"]
</py-config>
<script>
// get the budget from the browser storage
var budget = sessionStorage.getItem("budget");
console.log(budget)
// get the ranking from the browser storage
var bedrooms = sessionStorage.getItem("bedrooms");
console.log(bedrooms)
// get the bedrooms from the browser storage
var pref_list = sessionStorage.getItem("pref_list");
console.log(pref_list)
</script>
<script>
// error handling for missing JS variables
// if the budget cannot be found locally in the browser then the user will be redirected to the budget page
if(budget == null){
alert('You did not set a budget yet, you must do that first! You will now be redirected to the budget page where you can set a budget.');
window.location.href = "budget.html";
}
// if the bedrooms cannot be found locally in the browser then the user will be redirected to the budget page
if(bedrooms == null){
alert('You did not specify the number of bedrooms, you must do that first! You will now be redirected to the budget page where you can set the bedrooms.');
window.location.href = "budget.html";
}
// if a negative budget is entered, redirect
if(budget < 0){
alert('You can\'t have a negative budget, please enter a budget greater than 0');
window.location.href = "budget.html";
}
// if the budget is not numeric then redirect back to the budget page
if(typeof budget != numeric) {
alert('Your entered budget is not numeric, please enter your budget again!');
window.location.href = "budget.html";
}
</script>
<py-script>
from js import budget
from js import bedrooms
from js import pref_list
</py-script>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-light fixed-top" id="navbar">
<div class="container-fluid">
<a class="navbar-brand" href="index.html"><img class="logo-main" src="img/logo.png" /></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
<center>
<main>
<div class="position-relative overflow-hidden text-center banner-sub">
<div class="col-md-5 mx-auto my-5">
<h1 class="display-16 fw-normal borough-result">Processing</h1>
</div>
<div class="product-device shadow-sm d-none d-md-block"></div>
<div class="product-device product-device-2 shadow-sm d-none d-md-block"></div>
</div>
<div class="position-relative overflow-hidden p-3 p-md-5 text-center bg-light results-text" id="jumbotron-inputs" style="background-image: url(img/greenwich.jpg);">
<div class="mx-auto my-5">
<!-- TEXT GOES HERE -->
<h1 class="display-5 fw-normal borough-result">Loading your suggestion now!</h1>
<p class="lead fw-normal">
</p>
<img src="img/loading.gif" />
<!-- Algorithm Python -->
<script src="algorithm/redirect.js"></script>
<py-script src="algorithm/algorithm.py"></py-script>
<script src="algorithm/redirect.js"></script>
<!-- END INPUT -->
</div>
<div class="product-device shadow-sm d-none d-md-block"></div>
<div class="product-device product-device-2 shadow-sm d-none d-md-block"></div>
</div>
</main>
</center>
<footer class="container py-5">
<div class="row">
<div class="col-12 col-md">
<img src="img/logo.png" class="footer-logo"/>
<small class="d-block mb-3 text-muted">© 2022</small>
</div>
<div class="col-6 col-md">
<h5>Info</h5>
<ul class="list-unstyled text-small">
<li><a class="link-secondary" href="budget.html">Find your borough</a></li>
<li><a class="link-secondary" href="advertise.html">Advertise with us</a></li>
<li><a class="link-secondary" href="team.html">Team</a></li>
</ul>
</div>
<div class="col-6 col-md">
<h5>Resources</h5>
<ul class="list-unstyled text-small">
<li><a class="link-secondary" href="attributions.html">Attributions</a></li>
</ul>
</div>
</div>
</footer>
<script src="../assets/dist/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">
var borough_2 = PyScript.globals.get('borough_2')
sessionStorage.setItem("borough_2", borough_2);
console.log(borough_3);
var borough_3 = PyScript.globals.get('borough_3')
sessionStorage.setItem("borough_3", borough_3);
console.log(borough_3);
</script>
</body>
</html>