diff --git a/application.py b/application.py index 7b082485..c61bda2b 100644 --- a/application.py +++ b/application.py @@ -8,10 +8,12 @@ # from apps import App from flask import json # from utilities import Utilities -from flask import render_template, session, url_for, flash, redirect, request, Flask +from flask import render_template, session, url_for, flash, redirect, request, Flask, jsonify from flask_mail import Mail from flask_pymongo import PyMongo from tabulate import tabulate +from email.mime.multipart import MIMEMultipart +from email.mime.text import MIMEText from forms import HistoryForm, RegistrationForm, LoginForm, CalorieForm, UserProfileForm, EnrollForm, WorkoutForm import openai import os @@ -499,35 +501,104 @@ def refresh(): @app.route("/send_email", methods=['GET', 'POST']) def send_email(): - # ############################ - # send_email() function shares Calorie History with friend's email - # route "/send_email" will redirect to send_email() function which redirects to friends.html page. - # Input: Email - # Output: Calorie History Received on specified email - # ########################## + ''' + send_email() function shares Calorie History with friend's email + route "/send_email" will redirect to send_email() function which redirects to friends.html page. + Input: Email + Output: Latest Week Calorie History received on specified email + ''' # ##########################''' email = session.get('email') - data = list( - mongo.db.calories.find({'email': email}, - {'date', 'email', 'calories'})) + data = list(mongo.db.calories.find({'email': email}, {'date', 'email', 'calories'})) + workout_data = list(mongo.db.workout.find({'email': email}, {'date', 'email', 'burnout'})) + print(data, workout_data) + + one_week_ago = datetime.now() - timedelta(days=7) + + filtered_data = [a for a in data if datetime.strptime(a['date'], '%Y-%m-%d') >= one_week_ago] + filtered_workout_data = [a for a in workout_data if datetime.strptime(a['date'], '%Y-%m-%d') >= one_week_ago] + table = [['Date', 'Email ID', 'Calories']] - for a in data: + + for a in filtered_data: tmp = [a['date'], a['email'], a['calories']] table.append(tmp) + for a in filtered_workout_data: + tmp = [a['date'], a['email'], int(a['burnout'])*(-1)] + table.append(tmp) friend_email = str(request.form.get('share')).strip() friend_email = str(friend_email).split(',') server = smtplib.SMTP_SSL("smtp.gmail.com", 465) + #Storing sender's email address and password sender_email = "calorieapp508@gmail.com" sender_password = c.email_password + sharing_email = table[1][1] + + positive_calories = [row for row in table[1:] if int(row[2]) > 0] + negative_calories = [row for row in table[1:] if int(row[2]) < 0] + + net_calories = sum(int(row[2]) for row in table[1:]) + + html_table = """ + + + +

Your friend with email {} wants to share their past week's calorie history with you!

+ + +

Calories Gained

+ + + + + + {} +
DateCalories
+ + +

Calories Lost

+ + + + + + {} +
DateCalories
+ + +

Net Calories: {}

+ + + """ + + positive_rows = "" + for row in positive_calories: + positive_rows += "" + for item in [row[0]] + [row[2]]: + positive_rows += "{}".format(item) + positive_rows += "" + + negative_rows = "" + for row in negative_calories: + negative_rows += "" + for item in [row[0]] + [row[2]]: + negative_rows += "{}".format(item) + negative_rows += "" + + formatted_html = html_table.format(sharing_email, positive_rows, negative_rows, net_calories) #Logging in with sender details server.login(sender_email, sender_password) - message = 'Subject: Calorie History\n\n Your Friend wants to share their calorie history with you!\n {}'.format( - tabulate(table)) + message = MIMEMultipart() + message["Subject"] = "Calorie History" + message["From"] = sender_email + + html_content = MIMEText(formatted_html, "html") + message.attach(html_content) for e in friend_email: print(e) - server.sendmail(sender_email, e, message) + server.sendmail(sender_email, e, message.as_string()) server.quit() @@ -901,6 +972,43 @@ def hrx(): return redirect(url_for('dashboard')) return render_template('hrx.html', title='HRX', form=form) +@app.route('/get_countries', methods=['GET']) +def get_countries(): + ''' + Populate countries in the bmi_cal.html dropdown from mongodb + ''' + countries = [country['country_name'] for country in mongo.db.obesity.find({}, {'country_name': 1, '_id': 0})] + return jsonify({'countries': countries}) + +@app.route('/get_average_bmi', methods=['GET']) +def get_average_bmi(): + ''' + Fetch the average bmi values from database + ''' + country = request.args.get('country') + gender = request.args.get('gender') + + bmi_data_for_country = list(mongo.db.obesity.find({'country_name': country})) + + # Get the keys for both sexes, male, and female + gender_keys = ['both_sexes', 'male', 'female'] + + # Dictionary to store average BMI values + average_bmi_data = {} + + # Calculate average BMI for both sexes + both_sexes_data = [entry[key] for entry in bmi_data_for_country for key in gender_keys if key in entry] + total_both_sexes = sum(both_sexes_data) + average_bmi_data['both_sexes'] = total_both_sexes / len(both_sexes_data) + + # Calculate average BMI for the selected gender + if gender in gender_keys: + selected_gender_data = [entry[gender] for entry in bmi_data_for_country if gender in entry] + total_selected_gender = sum(selected_gender_data) + average_bmi_data[gender] = total_selected_gender / len(selected_gender_data) + else: + return jsonify({'error': 'Invalid gender parameter'}), 400 + return jsonify(average_bmi_data) # @app.route("/ajaxdashboard", methods=['POST']) # def ajaxdashboard(): @@ -925,4 +1033,4 @@ def hrx(): # 'ContentType': 'application/json'} if __name__ == '__main__': - app.run(debug=True) + app.run(debug=True) \ No newline at end of file diff --git a/insert_food_bmi_data.py b/insert_food_bmi_data.py new file mode 100644 index 00000000..50355f42 --- /dev/null +++ b/insert_food_bmi_data.py @@ -0,0 +1,38 @@ +from apps import App +import pandas as pd + +app = App() +mongo = app.mongo + +# Clear existing data in the 'food' and 'obesity' collections +mongo.db.food.delete_many({}) +mongo.db.obesity.delete_many({}) + +# Food Data +f = open('food_data/calories.csv', 'r', encoding="ISO-8859-1") +l = f.readlines() + +for i in range(1, len(l)): + l[i] = l[i][1:len(l[i]) - 2] + +for i in range(1, len(l)): + temp = l[i].split(",") + mongo.db.food.insert_one({'food': temp[0], 'calories': temp[1]}) + +# BMI data +df = pd.read_csv('model/WHO_obesityByCountry_2016.csv') + +for index, row in df.iterrows(): + country_name = row['Country'] + both_sexes = row['Both.sexes'] + male = row['Male'] + female = row['Female'] + + mongo.db.obesity.insert_one({ + 'country_name': country_name, + 'both_sexes': both_sexes, + 'male': male, + 'female': female + }) + +print("Data inserted into MongoDB.") \ No newline at end of file diff --git a/insert_food_data.py b/insert_food_data.py deleted file mode 100644 index e9a60b0d..00000000 --- a/insert_food_data.py +++ /dev/null @@ -1,14 +0,0 @@ -from apps import App - -app = App() -mongo = app.mongo - -f = open('food_data/calories.csv', 'r', encoding="ISO-8859-1") -l = f.readlines() - -for i in range(1, len(l)): - l[i] = l[i][1:len(l[i]) - 2] - -for i in range(1, len(l)): - temp = l[i].split(",") - mongo.db.food.insert_one({'food': temp[0], 'calories': temp[1]}) diff --git a/model/WHO_obesityByCountry_2016.csv b/model/WHO_obesityByCountry_2016.csv new file mode 100644 index 00000000..be61c5fe --- /dev/null +++ b/model/WHO_obesityByCountry_2016.csv @@ -0,0 +1,196 @@ +Country,Both.sexes,Male,Female +Afghanistan,4.5,2.7,6.2 +Albania,22.3,21.9,22.8 +Algeria,26.6,19.4,34 +Andorra,28,27.9,28.1 +Angola,6.8,3.5,10 +Antigua and Barbuda,19.1,11.7,26.3 +Argentina,28.5,27.4,29.6 +Armenia,20.9,17.2,24.5 +Australia,30.4,30.7,30.1 +Austria,21.9,23.4,20.6 +Azerbaijan,19.9,15.7,23.9 +Bahamas,32.1,24.8,39 +Bahrain,28.7,24.9,36.1 +Bangladesh,3.4,2.2,4.6 +Barbados,24.8,15.6,33.8 +Belarus,26.6,23.5,29.1 +Belgium,24.5,25.1,23.9 +Belize,22.4,15.4,29.4 +Benin,8.2,4.2,12.2 +Bhutan,5.8,4.5,7.4 +Bolivia (Plurinational State of),18.7,13.4,23.9 +Bosnia and Herzegovina,19.4,18.1,20.6 +Botswana,16.1,7,25.5 +Brazil,22.3,18.5,25.9 +Brunei Darussalam,14.7,13,16.4 +Bulgaria,27.4,27.5,27.4 +Burkina Faso,4.5,2.2,6.8 +Burundi,4.4,1.8,7 +Cabo Verde,10.6,6.3,14.9 +Cambodia,3.5,2.5,4.5 +Cameroon,9.5,5.2,13.9 +Canada,31.3,31.2,31.5 +Central African Republic,6.3,3.2,9.3 +Chad,4.8,2.6,7 +Chile,28.8,25.5,32.1 +China,6.6,6.2,7.1 +Colombia,22.1,17.3,26.7 +Comoros,6.9,3,10.8 +Congo,8.4,4.9,11.8 +Cook Islands,55.3,52,58.6 +Costa Rica,25.7,21,30.4 +Côte d'Ivoire,9,5.2,13.1 +Croatia,27.1,26,28.2 +Cuba,26.7,20.4,33 +Cyprus,22.6,22.4,22.8 +Czechia,28.5,28.5,28.6 +Democratic People's Republic of Korea,7.1,6.4,7.8 +Democratic Republic of the Congo,5.6,3.1,8 +Denmark,21.3,23.7,18.9 +Djibouti,12.2,7.9,16.5 +Dominica,28.2,20,36 +Dominican Republic,26.9,20.4,33.2 +Ecuador,19.3,14.4,24.1 +Egypt,31.1,22,40 +El Salvador,22.7,17.1,27.4 +Equatorial Guinea,7.4,3.6,11.4 +Eritrea,4.1,1.8,6.3 +Estonia,23.8,21.9,25.3 +Eswatini,13.5,4.4,22.2 +Ethiopia,3.6,1.6,5.6 +Fiji,30,24.9,35.3 +Finland,24.9,25.7,24.2 +France,23.2,23.5,23 +Gabon,13.4,8.6,18.2 +Gambia,8.7,4.8,12.4 +Georgia,23.3,20,26 +Germany,25.7,26.6,24.9 +Ghana,9.7,4.1,15 +Greece,27.4,26,28.7 +Grenada,20.2,12.6,27.6 +Guatemala,18.8,13.1,23.8 +Guinea,6.6,3.3,9.9 +Guinea-Bissau,8.2,4.5,11.8 +Guyana,19.2,12.2,26.1 +Haiti,20.5,16.4,24.3 +Honduras,19.4,14.1,24.5 +Hungary,28.6,29.9,27.5 +Iceland,23.1,25.3,20.9 +India,3.8,2.7,4.9 +Indonesia,6.9,4.9,9 +Iran (Islamic Republic of),25.5,19.1,31.8 +Iraq,27.4,21,33.8 +Ireland,26.9,26.5,27.3 +Israel,26.7,26.1,27.2 +Italy,22.9,22.5,23.3 +Jamaica,24.4,15,33.2 +Japan,4.4,4.6,4.1 +Jordan,33.4,26.6,40.4 +Kazakhstan,21.3,18.8,23.4 +Kenya,6,2.5,9.4 +Kiribati,45.6,41.2,50 +Kuwait,37,33,43.9 +Kyrgyzstan,15.4,13.1,17.5 +Lao People's Democratic Republic,4.5,3.2,5.7 +Latvia,25.7,22.9,28 +Lebanon,31.3,27.4,35.3 +Lesotho,13.5,3.7,22.8 +Liberia,8.6,4.9,12.3 +Libya,31.8,24.5,38.7 +Lithuania,28.4,25.3,30.9 +Luxembourg,24.2,26,22.4 +Madagascar,4.5,2.6,6.3 +Malawi,4.7,1.9,7.5 +Malaysia,15.3,12.9,17.6 +Maldives,7.9,5.4,10.3 +Mali,7.1,3.9,10.4 +Malta,31,30.9,31.2 +Marshall Islands,52.4,47.9,56.9 +Mauritania,11.3,6,16.6 +Mauritius,11.5,5.9,16.8 +Mexico,28.4,23.7,32.6 +Micronesia (Federated States of),41.6,36.1,47.3 +Monaco,NA,NA,NA +Mongolia,19.6,16.7,22.4 +Montenegro,24.9,24.5,25.2 +Morocco,25.6,19,31.9 +Mozambique,6,2.8,8.9 +Myanmar,5.7,4,7.3 +Namibia,15,6.5,22.7 +Nauru,60.7,58.5,63 +Nepal,3.8,2.5,4.8 +Netherlands,23.1,22.7,23.4 +New Zealand,32,31,32.9 +Nicaragua,21.8,16.5,26.8 +Niger,4.7,2.3,7.2 +Nigeria,7.8,4.1,11.5 +Niue,49.3,44.2,54.5 +Norway,25,25.1,24.8 +Oman,22.9,19.5,30.8 +Pakistan,7.8,5.5,10.1 +Palau,54.9,51.3,58.4 +Panama,22.5,17.6,27.5 +Papua New Guinea,19.4,15.2,23.7 +Paraguay,19,16.1,21.9 +Peru,19.1,14.7,23.5 +Philippines,6,5,7 +Poland,25.6,25.4,25.7 +Portugal,23.2,22.1,24.2 +Qatar,33.9,31.9,41.8 +Republic of Korea,4.9,4.6,5.3 +Republic of Moldova,20.1,16.9,23 +Romania,24.5,24.9,24.2 +Russian Federation,25.7,19.4,30.8 +Rwanda,4.8,1.6,7.7 +Saint Kitts and Nevis,23.1,15.4,30.5 +Saint Lucia,19.8,12,27.2 +Saint Vincent and the Grenadines,23.8,16.7,31 +Samoa,45.5,38.2,53.2 +San Marino,NA,NA,NA +Sao Tome and Principe,10.6,6.3,14.8 +Saudi Arabia,35,31,41.2 +Senegal,7.4,3.3,11 +Serbia,23.5,22.5,24.5 +Seychelles,14.6,8.1,21.4 +Sierra Leone,7.5,3.4,11.6 +Singapore,6.6,6.2,7 +Slovakia,22.4,22.5,22.3 +Slovenia,22.5,21.4,23.6 +Solomon Islands,20.5,16.3,24.7 +Somalia,6.9,3.4,10.3 +South Africa,27,14.5,38.5 +South Sudan,NA,NA,NA +Spain,27.1,27.1,27.2 +Sri Lanka,5.4,3,7.7 +Sudan,NA,NA,NA +Sudan (former),7.4,3.4,10.7 +Suriname,26.5,19,33.9 +Sweden,22.1,24.2,20 +Switzerland,21.2,23.7,18.8 +Syrian Arab Republic,25.8,19.3,32.4 +Tajikistan,12.6,10.4,14.6 +Thailand,10.8,7.5,13.8 +Republic of North Macedonia,23.9,23.8,23.9 +Timor-Leste,2.9,2.1,3.8 +Togo,7.1,3.4,10.7 +Tonga,45.9,39,52.6 +Trinidad and Tobago,19.7,11.4,27.7 +Tunisia,27.3,19.3,34.9 +Turkey,32.2,24.2,39.7 +Turkmenistan,17.5,15,19.9 +Tuvalu,51,46.4,55.6 +Uganda,4.1,1.5,6.8 +Ukraine,26.1,23.2,28.4 +United Arab Emirates,29.9,26.7,38.8 +United Kingdom of Great Britain and Northern Ireland,29.5,28.6,30.4 +United Republic of Tanzania,7.1,3.4,10.7 +United States of America,37.3,36.5,38.2 +Uruguay,28.9,25.3,32.1 +Uzbekistan,15.3,12.9,17.7 +Vanuatu,23.5,18.8,28.1 +Venezuela (Bolivarian Republic of),25.2,22.1,28.3 +Viet Nam,2.1,1.6,2.6 +Yemen,14.1,9.9,18.2 +Zambia,6.5,3,10 +Zimbabwe,12.3,3.7,20.5 diff --git a/static/main.css b/static/main.css index 93d669b7..9238440b 100644 --- a/static/main.css +++ b/static/main.css @@ -52,18 +52,19 @@ padding: 10px 30px; border: 1px solid #dddddd; border-radius: 3px; - width: 50%; - margin: auto; - border-radius: 1%; - box-shadow: 10px 10px 5px lightblue; + margin-top: 40px; + margin-bottom: 20px; + width: 55%; + align-self: center; + box-shadow: 0px 0px 95px -30px rgba(0, 0, 0, 0.15); } - - .sign-in-div { + .content-section-container { + margin-top: -1.5rem; display: flex; align-items: center; justify-content: center; - height: 105vh; + } .account-img { @@ -124,7 +125,6 @@ details[open] summary { margin-bottom: .5em; } - .site-section { text-align: center; @@ -142,6 +142,15 @@ text-align: center; } + h1 { + text-align: center; + } + + img { + text-align: center; + padding: 0 350px; + } + .carousel-fade .carousel-item, .carousel-item img { max-height: 90vh; } @@ -161,345 +170,640 @@ justify-content: center; } + body { + display: flex; + align-items: center; + justify-content: center; + min-height: 100vh; + } + + .content { + padding: 0 30px; + } + + .input { + background: #fff; + box-shadow: 0px 0px 95px -30px rgba(0, 0, 0, 0.15); + border-radius: 12px; + padding: 7px 0; + margin-bottom: 20px; + text-align: center; + } + + .input label { + display: block; + font-size: 18px; + font-weight: 600; + color: #000; + margin-bottom: 7px; + } + + .input input { + outline: none; + border: none; + border-bottom: 1px solid #4f7df9; + width: 35%; + text-align: center; + font-size: 18px; + font-family: "Nunito", sans-serif; + } + + .inputW { + background: #fff; + box-shadow: 0px 0px 95px -30px rgba(0, 0, 0, 0.15); + border-radius: 12px; + padding: 10px 0; + margin-bottom: 20px; + } + + .inputW label { + display: block; + font-size: 18px; + font-weight: 600; + color: #000; + text-align: center; + margin-bottom: 20px; + } + + .inputW input { + outline: none; + border: none; + border-bottom: 1px solid #4f7df9; + width: 90%; + text-align: center; + font-size: 18px; + font-family: "Nunito", sans-serif; + } + + .inputH { + background: #fff; + box-shadow: 0px 0px 95px -30px rgba(0, 0, 0, 0.15); + border-radius: 12px; + padding: 10px 0; + margin-bottom: 20px; + margin-right: 20px; + } + + .inputH label { + display: block; + font-size: 18px; + font-weight: 600; + text-align: center; + color: #000; + margin-bottom: 20px; + } + + .inputH input { + outline: none; + border: none; + border-bottom: 1px solid #4f7df9; + width: 90%; + text-align: center; + font-size: 18px; + font-family: "Nunito", sans-serif; + } + + button.calculate { + cursor: pointer; + font-family: "Nunito", sans-serif; + color: #fff; + background: rgb(97, 138, 254, 1); + font-size: 16px; + border-radius: 7px; + padding: 12px 0; + width: 100%; + outline: none; + border: none; + transition: all 0.5s; + } + + button.calculate:hover { + background: #0044ff; + } + + .result { + padding: 10px 20px; + text-align: center; + } + + .result p { + font-weight: 600; + font-size: 20px; + color: #000; + margin-bottom: 15px; + align-items: center; + align-self: center; + align-content: center; + text-align: center; + } + + .result #resultValue { + font-size: 25px; + font-weight: 900; + color: #4f7df9; + background-color: #eaeaea; + display: inline-block; + padding: 7px 20px; + border-radius: 55px; + margin-bottom: 25px; + text-align: center; + } + + #comment { + color: #4f7df9; + font-weight: 800; + } + + .comment { + display: none; + border: dashed 1px; + border-radius: 7px; + padding: 5px; + } + + .footer { + display: flex; + justify-content: start; + align-items: center; + padding: 10px 15px; + } + + .footer-text { + text-decoration: none; + color: rgba(40, 40, 40, 0.8); + font-family: 'Poppins', sans-serif; + font-weight: 200; + font-size: 14px; + transition: all 0.5; + } + + .footer-text:hover { + color: rgba(40, 40, 40, 1); + } + + .gender { + display: flex; + align-items: center; + align-content: center; + background: #fff; + box-shadow: 0px 0px 95px -30px rgba(0, 0, 0, 0.15); + border-radius: 12px; + margin-bottom: 1rem; + } + + .gender .container { + display: block; + position: relative; + padding-left: 35px; + margin-top: 2rem; + cursor: pointer; + font-size: 18px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + + .gender .container input { + position: absolute; + opacity: 0; + cursor: pointer; + } + + .checkmark { + position: absolute; + top: 0; + left: 0; + height: 25px; + width: 25px; + background-color: #eee; + border-radius: 50%; + } + + .gender .container:hover input ~ .checkmark { + background-color: #ccc; + } + + .gender .container input:checked ~ .checkmark { + background-color: #2196F3; + } + + .checkmark:after { + content: ""; + position: absolute; + display: none; + } + + .gender .container input:checked ~ .checkmark:after { + display: block; + } + + .gender .container .checkmark:after { + top: 9px; + left: 9px; + width: 8px; + height: 8px; + border-radius: 50%; + background: white; + } + + .containerHW { + display: flex; + justify-content: space-around; + align-items: center; + } + + .modal { + display: none; + position: fixed; + z-index: 1; + padding-top: 100px; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgb(0, 0, 0); + background-color: rgba(0, 0, 0, 0.4); + padding-top: 300px; + } + + .modal-content { + background-color: #fefefe; + margin: auto; + padding: 20px; + border: 1px solid #888; + width: 600px; + border-radius: 10px; + box-shadow: #393c76 -1px 2px 2px 1px; + } + + #modalText { + padding-top: 8px; + padding-right: 5px; + font-size: 18px; + font-family: 'Poppins', sans-serif; + color: rgb(24, 23, 23); + } + + .modal-wrong { + border: 2px solid red; + } + + .modal-correct { + border: 2px solid green; + } + + .close { + color: #aaaaaa; + float: right; + font-size: 28px; + font-weight: bold; + cursor: pointer; + transition: all 0.3s; + } + + .close:hover { + color: #d41111; + } + #textInput { + border: 2px solid black; + border-bottom: 3px solid aqua; + } - #textInput { - border: 2px solid black; - border-bottom: 3px solid aqua; - } - - .userText { - color: white; - font-family: monospace; - font-size: 17px; - text-align: right; - line-height: 30px; - } + .userText { + color: white; + font-family: monospace; + font-size: 17px; + text-align: right; + line-height: 30px; + } - .userText span { - background-color: #009688; - padding: 10px; - border-radius: 10px; - } + .userText span { + background-color: #009688; + padding: 10px; + border-radius: 10px; + } - .botText { - color: white; - font-family: monospace; - font-size: 17px; - text-align: left; - line-height: 30px; - } + .botText { + color: white; + font-family: monospace; + font-size: 17px; + text-align: left; + line-height: 30px; + } - .botText span { - background-color: #ae312f; - padding: 5px; - border-radius: 10px; - } + .botText span { + background-color: #ae312f; + padding: 5px; + border-radius: 10px; + } - .chat_window { - position: relative; - width: calc(100% - 20px); - max-width: 800px; - height: 500px; - border-radius: 10px; - background-color: #fff; - left: 50%; - margin-top: 20rem; - transform: translateX(-50%) translateY(-50%); - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); - background-color: #fff; - overflow: hidden; - } + .chat_window { + position: relative; + width: calc(100% - 20px); + max-width: 800px; + height: 500px; + border-radius: 10px; + background-color: #fff; + left: 50%; + margin-top: 20rem; + transform: translateX(-50%) translateY(-50%); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); + background-color: #fff; + overflow: hidden; + } - .top_menu { - background-color: #fff; - width: 100%; - padding: 20px 0 15px; - box-shadow: 0 1px 30px rgba(0, 0, 0, 0.1); - } + .top_menu { + background-color: #fff; + width: 100%; + padding: 20px 0 15px; + box-shadow: 0 1px 30px rgba(0, 0, 0, 0.1); + } - .top_menu .buttons { - margin: 3px 0 0 20px; - position: absolute; - } + .top_menu .buttons { + margin: 3px 0 0 20px; + position: absolute; + } - .top_menu .buttons .button { - width: 16px; - height: 16px; - border-radius: 50%; - display: inline-block; - margin-right: 10px; - position: relative; - } + .top_menu .buttons .button { + width: 16px; + height: 16px; + border-radius: 50%; + display: inline-block; + margin-right: 10px; + position: relative; + } - .top_menu .buttons .button.close { - background-color: #f5886e; - } + .top_menu .buttons .button.close { + background-color: #f5886e; + } - .top_menu .buttons .button.minimize { - background-color: #fdbf68; - } + .top_menu .buttons .button.minimize { + background-color: #fdbf68; + } - .top_menu .buttons .button.maximize { - background-color: #a3d063; - } + .top_menu .buttons .button.maximize { + background-color: #a3d063; + } - .top_menu .title { - text-align: center; - color: #bcbdc0; - font-size: 20px; - } + .top_menu .title { + text-align: center; + color: #bcbdc0; + font-size: 20px; + } - .messages { - position: relative; - list-style: none; - padding: 20px 10px 0 10px; - margin: 0; - height: 347px; - overflow: scroll; - } + .messages { + position: relative; + list-style: none; + padding: 20px 10px 0 10px; + margin: 0; + height: 347px; + overflow: scroll; + } - .messages .message { - clear: both; - overflow: hidden; - margin-bottom: 20px; - transition: all 0.5s linear; - opacity: 0; - } + .messages .message { + clear: both; + overflow: hidden; + margin-bottom: 20px; + transition: all 0.5s linear; + opacity: 0; + } - .messages .message.left .avatar { - background-color: #f5886e; - float: left; - } + .messages .message.left .avatar { + background-color: #f5886e; + float: left; + } - .messages .message.left .text_wrapper { - background-color: #ffe6cb; - margin-left: 20px; - } + .messages .message.left .text_wrapper { + background-color: #ffe6cb; + margin-left: 20px; + } - .messages .message.left .text_wrapper::after, - .messages .message.left .text_wrapper::before { - right: 100%; - border-right-color: #ffe6cb; - } + .messages .message.left .text_wrapper::after, + .messages .message.left .text_wrapper::before { + right: 100%; + border-right-color: #ffe6cb; + } - .messages .message.left .text { - color: #c48843; - } + .messages .message.left .text { + color: #c48843; + } - .messages .message.left .avatar { - float: left; - width: 50px; - height: 50px; - background-image: url("https://pas-wordpress-media.s3.amazonaws.com/wp-content/uploads/2013/08/Customer-service-woman-on-headset-gives-OK-1024x770.jpg"); - background-size: cover; - border-radius: 50%; - margin-right: 10px; - } + .messages .message.left .avatar { + float: left; + width: 50px; + height: 50px; + background-image: url("https://pas-wordpress-media.s3.amazonaws.com/wp-content/uploads/2013/08/Customer-service-woman-on-headset-gives-OK-1024x770.jpg"); + background-size: cover; + border-radius: 50%; + margin-right: 10px; + } - .messages .message.right .text_wrapper { - background-color: #c7eafc; - margin-right: 20px; - float: right; - } + .messages .message.right .text_wrapper { + background-color: #c7eafc; + margin-right: 20px; + float: right; + } - .messages .message.right .text_wrapper::after, - .messages .message.right .text_wrapper::before { - left: 100%; - border-left-color: #c7eafc; - } + .messages .message.right .text_wrapper::after, + .messages .message.right .text_wrapper::before { + left: 100%; + border-left-color: #c7eafc; + } - .messages .message.right .text { - color: #45829b; - } + .messages .message.right .text { + color: #45829b; + } - .messages .message.appeared { - opacity: 1; - } + .messages .message.appeared { + opacity: 1; + } - .messages .message .avatar { - width: 60px; - height: 60px; - border-radius: 50%; - display: inline-block; - } + .messages .message .avatar { + width: 60px; + height: 60px; + border-radius: 50%; + display: inline-block; + } - .messages .message .text_wrapper { - display: inline-block; - padding: 20px; - border-radius: 6px; - width: calc(100% - 85px); - min-width: 100px; - position: relative; - } + .messages .message .text_wrapper { + display: inline-block; + padding: 20px; + border-radius: 6px; + width: calc(100% - 85px); + min-width: 100px; + position: relative; + } - .messages .message .text_wrapper::after, - .messages .message .text_wrapper:before { - top: 18px; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; - } + .messages .message .text_wrapper::after, + .messages .message .text_wrapper:before { + top: 18px; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + } - .messages .message .text_wrapper::after { - border-width: 13px; - margin-top: 0px; - } + .messages .message .text_wrapper::after { + border-width: 13px; + margin-top: 0px; + } - .messages .message .text_wrapper::before { - border-width: 15px; - margin-top: -2px; - } + .messages .message .text_wrapper::before { + border-width: 15px; + margin-top: -2px; + } - .messages .message .text_wrapper .text { - font-size: 18px; - font-weight: 300; - } + .messages .message .text_wrapper .text { + font-size: 18px; + font-weight: 300; + } - .bottom_wrapper { - position: relative; - width: 100%; - background-color: #fff; - padding: 20px 20px; - position: absolute; - bottom: 0; - } + .bottom_wrapper { + position: relative; + width: 100%; + background-color: #fff; + padding: 20px 20px; + position: absolute; + bottom: 0; + } - .bottom_wrapper .message_input_wrapper { - display: inline-block; - height: 50px; - border-radius: 25px; - border: 1px solid #bcbdc0; - width: calc(100% - 160px); - position: relative; - padding: 0 20px; - } + .bottom_wrapper .message_input_wrapper { + display: inline-block; + height: 50px; + border-radius: 25px; + border: 1px solid #bcbdc0; + width: calc(100% - 160px); + position: relative; + padding: 0 20px; + } - .bottom_wrapper .message_input_wrapper .message_input { - border: none; - height: 100%; - box-sizing: border-box; - width: calc(100% - 40px); - position: absolute; - outline-width: 0; - color: gray; - } + .bottom_wrapper .message_input_wrapper .message_input { + border: none; + height: 100%; + box-sizing: border-box; + width: calc(100% - 40px); + position: absolute; + outline-width: 0; + color: gray; + } - .bottom_wrapper .send_message { - width: 140px; - height: 50px; - display: inline-block; - border-radius: 50px; - background-color: #a3d063; - border: 2px solid #a3d063; - color: #fff; - cursor: pointer; - transition: all 0.2s linear; - text-align: center; - float: right; - } + .bottom_wrapper .send_message { + width: 140px; + height: 50px; + display: inline-block; + border-radius: 50px; + background-color: #a3d063; + border: 2px solid #a3d063; + color: #fff; + cursor: pointer; + transition: all 0.2s linear; + text-align: center; + float: right; + } - .bottom_wrapper .send_message:hover { - color: #a3d063; - background-color: #fff; - } + .bottom_wrapper .send_message:hover { + color: #a3d063; + background-color: #fff; + } - .bottom_wrapper .send_message .text { - font-size: 18px; - font-weight: 300; - display: inline-block; - line-height: 48px; - } + .bottom_wrapper .send_message .text { + font-size: 18px; + font-weight: 300; + display: inline-block; + line-height: 48px; + } - .message_template { - display: none; - } + .message_template { + display: none; + } - .footer #button { - width: 55px; - height: 55px; - border: #4e919c 12px solid; - border-radius: 35px; - margin: 0 auto; - position: relative; - -webkit-transition: all 1s ease; - -moz-transition: all 1s ease; - -o-transition: all 1s ease; - -ms-transition: all 1s ease; - transition: all 1s ease; - } + .footer #button { + width: 55px; + height: 55px; + border: #4e919c 12px solid; + border-radius: 35px; + margin: 0 auto; + position: relative; + -webkit-transition: all 1s ease; + -moz-transition: all 1s ease; + -o-transition: all 1s ease; + -ms-transition: all 1s ease; + transition: all 1s ease; + } - .footer #button:hover { - width: 55px; - height: 55px; - border: #3A3A3A 12px solid; - -webkit-transition: all 1s ease; - -moz-transition: all 1s ease; - -o-transition: all 1s ease; - -ms-transition: all 1s ease; - transition: all 1s ease; - position: relative; - } + .footer #button:hover { + width: 55px; + height: 55px; + border: #3A3A3A 12px solid; + -webkit-transition: all 1s ease; + -moz-transition: all 1s ease; + -o-transition: all 1s ease; + -ms-transition: all 1s ease; + transition: all 1s ease; + position: relative; + } - .footer { - bottom: 0; - left: 0; - position: fixed; - width: 100%; - height: 2em; - overflow: hidden; - margin: 0 auto; - -webkit-transition: all 1s ease; - -moz-transition: all 1s ease; - -o-transition: all 1s ease; - -ms-transition: all 1s ease; - transition: all 1s ease; - z-index: 999; - } + .footer { + bottom: 0; + left: 0; + position: fixed; + width: 100%; + height: 2em; + overflow: hidden; + margin: 0 auto; + -webkit-transition: all 1s ease; + -moz-transition: all 1s ease; + -o-transition: all 1s ease; + -ms-transition: all 1s ease; + transition: all 1s ease; + z-index: 999; + } - .footer:hover { - -webkit-transition: all 1s ease; - -moz-transition: all 1s ease; - -o-transition: all 1s ease; - -ms-transition: all 1s ease; - transition: all 1s ease; - height: 10em; - } + .footer:hover { + -webkit-transition: all 1s ease; + -moz-transition: all 1s ease; + -o-transition: all 1s ease; + -ms-transition: all 1s ease; + transition: all 1s ease; + height: 10em; + } - .footer #container { - margin-top: 5px; - width: 100%; - height: 100%; - position: relative; - top: 0; - left: 0; - background: #4e919c; - } + .footer #container { + margin-top: 5px; + width: 100%; + height: 100%; + position: relative; + top: 0; + left: 0; + background: #4e919c; + } - .footer #cont { - position: relative; - top: -45px; - right: 190px; - width: 150px; - height: auto; - margin: 0 auto; - } + .footer #cont { + position: relative; + top: -45px; + right: 190px; + width: 150px; + height: auto; + margin: 0 auto; + } - .footer_center { - width: 500px; - float: left; - text-align: center; - } + .footer_center { + width: 500px; + float: left; + text-align: center; + } - .footer h3 { - font-family: 'Arial'; - font-size: 20px; - font-weight: 100; - margin-top: 70px; - margin-left: 10px; - } + .footer h3 { + font-family: 'Arial'; + font-size: 20px; + font-weight: 100; + margin-top: 70px; + margin-left: 10px; + } \ No newline at end of file diff --git a/templates/bmi_cal.html b/templates/bmi_cal.html index 070a4107..12f727bc 100644 --- a/templates/bmi_cal.html +++ b/templates/bmi_cal.html @@ -29,12 +29,12 @@

BMI Calculator

@@ -62,6 +62,21 @@

BMI Calculator

You fall into the category of

+ +
+ + +
+ + + @@ -77,7 +92,77 @@

BMI Calculator

+ + {% endblock content %}