Skip to content

Commit

Permalink
Merge pull request #113 from hypertun/BranchOfEverything1.5
Browse files Browse the repository at this point in the history
V1.5 Massive update
close #74
  • Loading branch information
hypertun authored Apr 12, 2018
2 parents 32dab43 + f7ae30c commit 72ad094
Show file tree
Hide file tree
Showing 19 changed files with 581 additions and 158 deletions.
1 change: 1 addition & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ endif::[]
* Some parts of this sample application were inspired by the excellent http://code.makery.ch/library/javafx-8-tutorial/[Java FX tutorial] by
_Marco Jakob_.
* Libraries used: https://github.com/TomasMikula/EasyBind[EasyBind], https://github.com/TestFX/TestFX[TextFX], https://bitbucket.org/controlsfx/controlsfx/[ControlsFX], https://github.com/FasterXML/jackson[Jackson], https://github.com/google/guava[Guava], https://github.com/junit-team/junit4[JUnit4]
* PersonCard.css was adapted from https://codepen.io/er40/pen/bdFgx.

== Licence : link:LICENSE[MIT]
149 changes: 149 additions & 0 deletions collated/functional/hypertun-reused.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# hypertun-reused
###### \resources\view\PersonCard.css
``` css
body {
background:#485b6e;
}

.container {
max-width:500px;
margin-left:auto;
margin-right:auto;
margin-top:10%;
}

h1 {
font-family: "Open Sans", sans;
font-weight:300;
text-align:center;
color:rgba(255,255,255,0.6)
}

h2 {
color:#2c3e52;
font-family: "Open Sans", sans;
font-size: 14px;
text-align:center;
font-weight:700;
margin-bottom:50px;

}

.service-details {
width: 600px;
height: 460px;
overflow: hidden;
position: relative;
}

.service-details img {
position: absolute;
top: 0;
left: 0;
height: inherit;
width: auto;
height: 100%;
float: left;
transition: all 0.8s;
-moz-transition: all 0.8s;

}

.service-details:hover img {
/*opacity: 0.4 !important;*/
}

.service-details .service-hover-text h3 {
padding: 0px;
margin: 0px;
font-size: 25px;
font-weight:300;
font-family: "Open Sans";
}

.service-details .service-hover-text h4 {
padding: 0px;
padding-bottom: 13px;
margin: 0px;
font-size: 14px;
letter-spacing: 3px;
width: 90%;
font-family: "Open Sans";
text-transform:uppercase;
border-bottom: 2px solid #000;
}

.service-details .service-hover-text p {
padding-top: 10px;
font-size: 9px;
line-height: 10px;
font-family: "Open Sans";
}


.service-details .service-hover-text{
width: 42%;
height: 89%;
position: absolute;
top: 0%;
left: 50%;
padding: 3% 4%;
background: #D90E0E;
color: rgba(255,255,255,1);
/* display: none;*/
transition: all 0.5s ease-in-out;
-moz-transition: all 0.4s;
}

.service-details:hover .service-hover-text {
display: block !important;
color: rgba(255,255,255,1);
background:rgba(217,14,14,0.85);
left: 0px;
top: 0px;
}


.service-details .service-text {
width: 50%;
height: inherit;
background: #000;
float: left;
position: absolute;
left: 50%;
}

.service-details .service-text p {
padding:100px 0px 0px 20px;
font-size: 24px;
font-family: "Open Sans";
font-weight:700;
color: #fff;
}

.service-details .service-text p span {
font-family: "Open Sans" !important;
}

.service-details .service-text a , .service-white .service-text {
padding: 0px 0px 0px 20px;
font-size: 14px !important;
color:#FF5A22 !important;
font-family: "Open Sans" !important;
text-decoration: none !important;
}

.service-details .service-text {
float: left;
}

.service-white {
background: #eee !important;
width: 50% !important;
height: inherit !important;
}

.service-white p {
color: #000 !important;
}
```
85 changes: 85 additions & 0 deletions collated/functional/hypertun.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,85 @@ public class Gender {
}
}
```
###### \java\seedu\address\model\util\HtmlFormatter.java
``` java
/**
* Change PersonCard to html format
*/
public class HtmlFormatter {

public static String getHtmlFormat(Person person) {

String name = person.getName().toString();
String phone = person.getPhone().toString();
String email = person.getEmail().toString();
String address = person.getAddress().toString();
String height = person.getHeight().toString();
String weight = person.getWeight().toString();
String bmi = person.getBodyMassIndex().toString();
String age = person.getAge().toString();
String activityLevel = person.getActivityLevel().toString();

String gender;

if (person.getGender().toString().equals("m")) {
gender = "Male";
}
else {
gender = "Female";
}

URL personcardcss = MainApp.class.getResource(FXML_FILE_FOLDER + "PersonCard.css");

String bodyhtmlcode = "<div class=\"container\">\n"
+ "<h1>Personal Trainer Pro</h1>\n"
+ "<h2>v1.5</h2>\n"
+ "<div class=\"service-details\">"
+ "<img src=\"https://cdn.pixabay.com/photo/2014/03/24/13/40/dumbbells-293955_960_720.png\""
+ " alt=\"realm\" />\n"
+ "<div class=\"service-hover-text\">\n"
+ "<h3>"
+ gender
+ "</h3>\n"
+ "<h4>BMI :"
+ bmi
+ "</h4>\n"
+ "<p>Phone Number :</p>\n"
+ phone
+ "<p>Address :</p>\n"
+ address
+ "<p>Height :</p>\n"
+ height
+ "<p>Weight :</p>\n"
+ weight
+ "<p>Age :</p>\n"
+ age
+ "<p>Activity Level :</p>\n"
+ activityLevel
+ "</div>\n"
+ "<div class=\"service-white service-text\">\n"
+ "<p>"
+ name
+ "</p>\n"
+ "<a href=\"#\">@"
+ email
+ "</a></div>\n"
+ "</div>\n"
+ "</div>";

String htmlcode = "<html>"
+ "<head>"
+ "<link rel = 'stylesheet' type='text/css' href='" + personcardcss.toExternalForm() + "' />"
+ "</head>"
+ "<body>"
+ bodyhtmlcode
+ "</body>"
+ "</html>";

return htmlcode;
}
}
```
###### \java\seedu\address\ui\BrowserPanel.java
``` java
public static final String CALCULATOR_PREFIX_URL = "http://www.calculator.net/calorie-calculator.html?ctype=metric";
Expand All @@ -195,6 +274,12 @@ public class Gender {

```
###### \java\seedu\address\ui\BrowserPanel.java
``` java
private void loadPersonPage(Person person) {
browser.getEngine().loadContent(HtmlFormatter.getHtmlFormat(person));
}
```
###### \java\seedu\address\ui\BrowserPanel.java
``` java
/**
* Creates calories from given person
Expand Down
3 changes: 1 addition & 2 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,7 @@ See this https://github.com/se-edu/addressbook-level4/pull/599[PR] for the step-
*Feature Contribution*:

* Ivan:
* Minor - Gender Attribute added, this will enable trainers to understand the amount of calories and weight that
contributes to a specific person of a certain gender.
* Minor - Html and css design of the person card so as to improve aesthetics instead of the boring google search page.
* Major - Mainly, a function to estimate the approximate calories needed to reach the goal of the client and
then a page with the exercises the clients can do with links to video they can watch from the application. Secondly,
a function to log the past weights of the clients so that they and the trainers can track their progress.
Expand Down
78 changes: 78 additions & 0 deletions docs/team/Yeo Chong Han.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
= Yeo Chong Han(Ivan) - Project Portfolio
:imagesDir: ../images
:stylesDir: ../stylesheets

== PROJECT: Personal Trainer Pro

---

== Overview

Personal Trainer Pro is a free to use application used for helping personal trainers gauge the improvement of their clients as well as help them improve.
It comes with a highly capable Command Line Interface(CLI) personal organiser and tracker keep together with an easy to use interface. The Graphical User Interface(GUI) is very simplistic but extremely detailed and easy to use to aid trainers in helping their clients.
The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

== Summary of contributions

* *Major enhancement*: added *Calories Calculator*
** What it does: allows the user/trainer to calculate the required calories based on a reliable website to obtain the best amount of calories the clients should have in order to improve, grow or lose weight. It uses all attribute data of the client to find the amount of calories needed.
** Justification: This feature will allow for trainers to quickly and readily answer questions about the client and also choose a perfect workout to suit the needs and wants, be it to gain lose or maintain, of the client.
** Highlights: This feature required additional attributes being added on to the original base and handling of events and creation of specific tests for each attribute before combining everything.
** Credits: Calculator.net was used as the main calculator that was being build around.

**External behaviour
---
[https://github.com/CS2103JAN2018-F12-B2/main/blob/master/docs/UserGuide.adoc#show-calories-a-person-requires-code-calories-code]
---

* *Minor enhancement*: added a html design when selecting the personal card in order to improve aesthetics and remove clutter.

**External behaviour
---
[https://github.com/CS2103JAN2018-F12-B2/main/blob/master/docs/UserGuide.adoc#selecting-a-person-code-select-code]
---

* *Code contributed*: [https://github.com/CS2103JAN2018-F12-B2/main/blob/master/collated/functional/hypertun.md] [https://github.com/CS2103JAN2018-F12-B2/main/blob/master/collated/test/hypertun.md]

* *Future implementation: *Tracking Weight for clients*
**What it does: This will allow for trainers as well as clients to track their progress to reach their goal.
**Justification: As the clients progress using the calories calculator it is important that they track their progress whether to gain weight, lose weight or to maintain weight. It already has a preliminary design as shown below in other contributions.

* *Other contributions*: Tried to implement the weight log attribute but was unsuccessful. [https://github.com/CS2103JAN2018-F12-B2/main/pull/40]

** Project management:
*** Managed releases `v1.0` - `v1.5rc` (6 releases) on GitHub
** Enhancements to existing features:
*** Solved several bugs that was found during preliminary testing (Pull requests https://github.com/CS2103JAN2018-F12-B2/main/pull/102, https://github.com/CS2103JAN2018-F12-B2/main/pull/101, https://github.com/CS2103JAN2018-F12-B2/main/pull/88)
*** Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests https://github.com[#36], https://github.com[#38])
*** Added Command Aliases (https://github.com/CS2103JAN2018-F12-B2/main/pull/4)
*** Added Gender Attribute(https://github.com/CS2103JAN2018-F12-B2/main/pull/22)
** Documentation:
*** Updated Major and Minor Enhancement: https://github.com/CS2103JAN2018-F12-B2/main/pull/23
*** Documentation for attributes: https://github.com/CS2103JAN2018-F12-B2/main/pull/32, https://github.com/CS2103JAN2018-F12-B2/main/pull/28
** Community:
*** Revamped original person card (https://github.com/CS2103JAN2018-F12-B2/main/pull/29)
*** Reverted error coding causing failure to merge due to previous member (https://github.com/CS2103JAN2018-F12-B2/main/pull/12)

== Contributions to the User Guide


|===
|_Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users._
|===

include::https://github.com/CS2103JAN2018-F12-B2/main/blob/master/docs/UserGuide.adoc#show-calories-a-person-requires-code-calories-code

== Contributions to the Developer Guide

|===
|_Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project._
|===

include::https://github.com/CS2103JAN2018-F12-B2/main/blob/master/docs/DeveloperGuide.adoc#314-gender-attribute--current-implementation

include::https://github.com/CS2103JAN2018-F12-B2/main/blob/master/docs/DeveloperGuide.adoc#appendix-b-product-scope

== Other Contributions

Collated the code together. [https://github.com/CS2103JAN2018-F12-B2/main/pull/108]
Loading

0 comments on commit 72ad094

Please sign in to comment.