Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontEnd/archive/1 colour one cell working/colour.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var A0 = document.getElementById("A0"); // cell A0
A0.style.backgroundColor = "yellow";//
62 changes: 62 additions & 0 deletions frontEnd/archive/1 colour one cell working/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Engagement Indicator</title>
<meta name="generator" content="BBEdit 11.6" />
</head>
<body>
<table width="100px" border="1">
<tr height="10px">
<td id="A0"></td>
<td id="A1"></td>
<td id="A2"></td>
<td id="A3"></td>
<td id="A4"></td>
<td id="A5"></td>
<td id="A6"></td>
<td id="A7"></td>
<td id="A8"></td>
<td id="A9"></td>
</tr>
<tr height="10px">
<td id="B0"></td>
<td id="B1"></td>
<td id="B2"></td>
<td id="B3"></td>
<td id="B4"></td>
<td id="B5"></td>
<td id="B6"></td>
<td id="B7"></td>
<td id="B8"></td>
<td id="B9"></td>
</tr>
<tr height="10px">
<td id="C0"></td>
<td id="C1"></td>
<td id="C2"></td>
<td id="C3"></td>
<td id="C4"></td>
<td id="C5"></td>
<td id="C6"></td>
<td id="C7"></td>
<td id="C8"></td>
<td id="C9"></td>
</tr>
<tr height="10px">
<td id="D0"></td>
<td id="D1"></td>
<td id="D2"></td>
<td id="D3"></td>
<td id="D4"></td>
<td id="D5"></td>
<td id="D6"></td>
<td id="D7"></td>
<td id="D8"></td>
<td id="D9"></td>
</tr>
</table>

<script src="colour.js"></script>
</body>
</html>
41 changes: 41 additions & 0 deletions frontEnd/archive/2 added switch case working/colour.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
A0 = document.getElementById("A0"); // select cell by ID
A1 = document.getElementById("A0"); // select cell by ID

//var score = 1; // engagement score simulation (-2 < score < 2)
// switch case

function switchColour (score){

switch (score) {
case -2:
console.log("score is -2 so colour is red");
A0.style.backgroundColor = "red";// set selected cell's colour
break;

case -1:
console.log("score is -1 so colour is organge");
A0.style.backgroundColor = "#ff6d00";// set selected cell's colour (orange)
break;

case 0:
A0.style.backgroundColor = "yellow";// set selected cell's colour
break;

case 1:
A0.style.backgroundColor = "rgb(190,255,0)";// set selected cell's colour (yellowish-green)
break;

case 2:
A0.style.backgroundColor = "green";// set selected cell's colour
break;

default:
A0.style.backgroundColor = "grey";
break;
};
}

switchColour(2); // specify score

//
//
62 changes: 62 additions & 0 deletions frontEnd/archive/2 added switch case working/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Engagement Indicator</title>
<meta name="generator" content="BBEdit 11.6" />
</head>
<body>
<table width="100px" border="1">
<tr height="10px">
<td id="A0"></td>
<td id="A1"></td>
<td id="A2"></td>
<td id="A3"></td>
<td id="A4"></td>
<td id="A5"></td>
<td id="A6"></td>
<td id="A7"></td>
<td id="A8"></td>
<td id="A9"></td>
</tr>
<tr height="10px">
<td id="B0"></td>
<td id="B1"></td>
<td id="B2"></td>
<td id="B3"></td>
<td id="B4"></td>
<td id="B5"></td>
<td id="B6"></td>
<td id="B7"></td>
<td id="B8"></td>
<td id="B9"></td>
</tr>
<tr height="10px">
<td id="C0"></td>
<td id="C1"></td>
<td id="C2"></td>
<td id="C3"></td>
<td id="C4"></td>
<td id="C5"></td>
<td id="C6"></td>
<td id="C7"></td>
<td id="C8"></td>
<td id="C9"></td>
</tr>
<tr height="10px">
<td id="D0"></td>
<td id="D1"></td>
<td id="D2"></td>
<td id="D3"></td>
<td id="D4"></td>
<td id="D5"></td>
<td id="D6"></td>
<td id="D7"></td>
<td id="D8"></td>
<td id="D9"></td>
</tr>
</table>

<script src="colour.js"></script>
</body>
</html>
53 changes: 53 additions & 0 deletions frontEnd/archive/3 adress any cell working/10x10 table/colour.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
A0 = document.getElementById("A0"); // select cell by ID
A1 = document.getElementById("A1"); // select cell by ID
A2 = document.getElementById("A2"); // select cell by ID
A3 = document.getElementById("A3"); // select cell by ID
A4 = document.getElementById("A4"); // select cell by ID
// function selectCell (cell){
// currentCell = cell;
// currentCell.style.backgroundColor = "red";
// }

// function colourCell (colour,cell){
// currentCell = cell;
// currentCell.style.backgroundColor = colour;// set selected cell's colour (orange)
// }

function switchColour (score, cell){
currentCell = cell; // set current cell
switch (score) {
case -2:
console.log("score is -2 so colour is red");

currentCell.style.backgroundColor = "#dd2c00";// red set selected cell's colour
break;

case -1:
console.log("score is -1 so colour is orange");
currentCell.style.backgroundColor = "#ffa726";// set orange selected cell's colour (orange)
break;

case 0:
currentCell.style.backgroundColor = "#ffeb3b";// yellow set selected cell's colour
break;

case 1:
currentCell.style.backgroundColor = "#b2ff59";// yellow-green set selected cell's colour (yellowish-green)
break;

case 2:
currentCell.style.backgroundColor = "#64dd17";// green set selected cell's colour
break;

default:
currentCell.style.backgroundColor = "grey";
break;
};
}
switchColour(-2, A0); // specify score,cell
switchColour(-1, A1); // specify score,cell
switchColour(-0, A2); // specify score,cell
switchColour(1, A3); // specify score,cell
switchColour(2, A4); // specify score,cell
//
//
136 changes: 136 additions & 0 deletions frontEnd/archive/3 adress any cell working/10x10 table/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Engagement Indicator</title>
<meta name="generator" content="BBEdit 11.6" />
<style>
tr { }
</style>
</head>
<body>
<table width="100px" border="0">
<tr height="10px">
<td id="A0"></td>
<td id="A1"></td>
<td id="A2"></td>
<td id="A3"></td>
<td id="A4"></td>
<td id="A5"></td>
<td id="A6"></td>
<td id="A7"></td>
<td id="A8"></td>
<td id="A9"></td>
</tr>
<tr height="10px">
<td id="B0"></td>
<td id="B1"></td>
<td id="B2"></td>
<td id="B3"></td>
<td id="B4"></td>
<td id="B5"></td>
<td id="B6"></td>
<td id="B7"></td>
<td id="B8"></td>
<td id="B9"></td>
</tr>
<tr height="10px">
<td id="C0"></td>
<td id="C1"></td>
<td id="C2"></td>
<td id="C3"></td>
<td id="C4"></td>
<td id="C5"></td>
<td id="C6"></td>
<td id="C7"></td>
<td id="C8"></td>
<td id="C9"></td>
</tr>
<tr height="10px">
<td id="D0"></td>
<td id="D1"></td>
<td id="D2"></td>
<td id="D3"></td>
<td id="D4"></td>
<td id="D5"></td>
<td id="D6"></td>
<td id="D7"></td>
<td id="D8"></td>
<td id="D9"></td>
</tr>
<tr height="10px">
<td id="E0"></td>
<td id="E1"></td>
<td id="E2"></td>
<td id="E3"></td>
<td id="E4"></td>
<td id="E5"></td>
<td id="E6"></td>
<td id="E7"></td>
<td id="E8"></td>
<td id="E9"></td>
</tr>
<tr height="10px">
<td id="F0"></td>
<td id="F1"></td>
<td id="F2"></td>
<td id="F3"></td>
<td id="F4"></td>
<td id="F5"></td>
<td id="F6"></td>
<td id="F7"></td>
<td id="F8"></td>
<td id="F9"></td>
</tr>
<tr height="10px">
<td id="G0"></td>
<td id="G1"></td>
<td id="G2"></td>
<td id="G3"></td>
<td id="G4"></td>
<td id="G5"></td>
<td id="G6"></td>
<td id="G7"></td>
<td id="G8"></td>
<td id="G9"></td>
</tr>
<tr height="10px">
<td id="H0"></td>
<td id="H1"></td>
<td id="H2"></td>
<td id="H3"></td>
<td id="H4"></td>
<td id="H5"></td>
<td id="H6"></td>
<td id="H7"></td>
<td id="H8"></td>
<td id="H9"></td>
</tr>
<tr height="10px">
<td id="I0"></td>
<td id="I1"></td>
<td id="I2"></td>
<td id="I3"></td>
<td id="I4"></td>
<td id="I5"></td>
<td id="I6"></td>
<td id="I7"></td>
<td id="I8"></td>
<td id="I9"></td>
</tr>
<tr height="10px">
<td id="J0"></td>
<td id="J1"></td>
<td id="J2"></td>
<td id="J3"></td>
<td id="J4"></td>
<td id="J5"></td>
<td id="J6"></td>
<td id="J7"></td>
<td id="J8"></td>
<td id="J9"></td>
</tr>
</table>
<script src="colour.js"></script>
</body>
</html>
Loading