Skip to content

Commit

Permalink
styling in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
codezaur committed Sep 24, 2017
1 parent 8623b5f commit 4dbfd6d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
24 changes: 13 additions & 11 deletions gindex.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
(function (){

var url = "http://undefined2055.eu/GlycemicIndex/foodTables.json";
var request = new XMLHttpRequest();
// var url = "http://undefined2055.eu/GlycemicIndex/foodTables.json";
// var request = new XMLHttpRequest();

request.onload = requestListener();
request.open("GET", url);
request.send(null);
// request.onload = requestListener();
// request.open("GET", url);
// request.send(null);

function requestListener() {
// function requestListener() {

// why doesn't work when this variable is defined outside of showFoods? the same situation with other app...
//var foodTables = JSON.parse(request.responseText);
// temporary solution for testing
// var foodTables = [{name: "Cheese", GI: 0}, {name: "Meats", GI: 0}, {name: "Broccoli", GI: 15},
// {name: "Coconut", GI: 35}, {name: "Bread Montignac", GI: 34}, {name:"Bread ezekiel", GI: 35},
// {name: "Bread white" , GI: 60}, {name: "Bread", GI: 55}];
var foodTables = [{name: "Cheese", GI: 0}, {name: "Meats", GI: 0}, {name: "Celery", GI: 15}, {name: "Broccoli", GI: 15},
{name: "Coconut", GI: 35}, {name: "Bread Montignac", GI: 34}, {name:"Bread ezekiel", GI: 35},
{name: "Celeriac, Knob celery, Turnip rooted celery", GI: 35},
{name: "Celeriac, Knob celery, Turnip rooted celery (cooked)", GI: 85},
{name: "Bread white" , GI: 60}, {name: "Bread", GI: 55}];

function showFoods() {

var foodTables = JSON.parse(request.responseText);
// var foodTables = JSON.parse(request.responseText);
var newInput = document.getElementById("textInput").value.toLowerCase(),
matchingFoods = [],
resultsList = document.getElementById("results");
Expand Down Expand Up @@ -67,5 +69,5 @@ function showFoods() {
}

document.getElementById("textInput").oninput = showFoods;
}
//}
})()
12 changes: 6 additions & 6 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ html, body {
background-color: #009933;
border-radius: 3px;
font-size: 18px;
line-height: 1.3333333;
/* line-height: 1.3333333; */
padding-top: 4px;
padding-bottom: 4px;
margin-top: 1px;
Expand All @@ -16,27 +16,27 @@ html, body {
position: relative; /*new*/
left: 1px; /*new*/
/* width: 100%; */
overflow: auto; /*new*/
/* overflow: auto; */
}
.medium {
background-color: #ff9933;
border-radius: 3px;
font-size: 18px;
line-height: 1.3333333;
/* line-height: 1.3333333; */
padding-top: 4px;
padding-bottom: 4px;
margin-top: 1px;
padding-left: 6px;
padding-right: 6px;
position: relative; /*new*/
left: 1px; /*new*/
/* position: relative;
left: 1px; */
/* width: 100%; */
}
.high {
background-color: #cc0000;
border-radius: 3px;
font-size: 18px;
line-height: 1.3333333;
/* line-height: 1.3333333; */
padding-top: 4px;
padding-bottom: 4px;
margin-top: 1px;
Expand Down

0 comments on commit 4dbfd6d

Please sign in to comment.