From 4d0a0d34ee9e59daf87c5ded3081ab966d4bae25 Mon Sep 17 00:00:00 2001 From: mnfmnfm Date: Wed, 29 Aug 2018 13:47:28 -0700 Subject: [PATCH 1/4] feedback on homepage --- index.html | 1 + js/home.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/index.html b/index.html index 9c1e22f..3e57f64 100644 --- a/index.html +++ b/index.html @@ -35,6 +35,7 @@

Which 201 staff member

are you most like?

+
diff --git a/js/home.js b/js/home.js index 5cbb2a5..72277aa 100644 --- a/js/home.js +++ b/js/home.js @@ -17,6 +17,7 @@ var text = [ ]; // Answers constructor +// Nitpick: in general, you should use singular words (i.e. Answer) for constructors, not plurals. function Answers(descriptor, path, staff) { this.descriptor = descriptor; this.path = path; @@ -120,6 +121,47 @@ question9.qAnswersArr.push(answer36); // Render function: puts things on the page function render() { + // the fact that you use the i variable from the outer function hurts very much. + // My recommendation would be that you do something using template literals instead of using + // HTML that's already built into your HTML page. + // Something like... +// var html = `
+//
+//

${this.question}

+//
+ +//
+// + +// +//
+ +//
+// + +// +//
+//
`; +// var wrapperElt = document.createElement('div'); +// wrapperElt.innerHTML = html; +// formElt.appendChild(wrapperElt); + var question = document.getElementsByTagName('h2')[i]; question.textContent = this.text; var michelleImg = document.getElementsByClassName('michelleImg')[i]; @@ -160,6 +202,8 @@ function Staff(name, img, bio) { var staffArr = []; // Create staff objects for each staff member +// I might think about creating this info on the results page, and just saving the name of the staff member in local storage. +// Also, you don't need the variables for each of these! Can just be 4 lines that start "new Staff..." var michelle = new Staff('Michelle', 'img/michelle/michelle-portrait.png', 'You are a coding rockstar that is here to school us all!'); var justin = new Staff('Justin', 'img/justin/justin-flexing.gif', 'You march to the beat of your own drum, always with a smile on your face.'); var joanna = new Staff('Joanna', 'img/joanna/joanna-profile.png', 'You are a social butterfly that can find a friend anywhere!'); From 641aae3bcba89405d668c8baef144302503b05c3 Mon Sep 17 00:00:00 2001 From: mnfmnfm Date: Wed, 29 Aug 2018 13:55:44 -0700 Subject: [PATCH 2/4] results page feedback --- js/results.js | 1 + results.html | 1 + 2 files changed, 2 insertions(+) diff --git a/js/results.js b/js/results.js index d4c6953..4591ee0 100644 --- a/js/results.js +++ b/js/results.js @@ -22,6 +22,7 @@ function removeQuizResult(event) { // Adds quiz results to the page function renderResult() { + // You already run this line on page load: no need to load from localStorage twice! newResult = JSON.parse(localStorage.getItem('staffWinner')); for(var i = 0; i < newResult.length; i++) { // Create div for results diff --git a/results.html b/results.html index 204efea..62da21e 100644 --- a/results.html +++ b/results.html @@ -40,6 +40,7 @@
+ \ No newline at end of file From 78e16347d531204a065d3dcc7e6ad4cdaa1f341c Mon Sep 17 00:00:00 2001 From: mnfmnfm Date: Wed, 29 Aug 2018 13:57:20 -0700 Subject: [PATCH 3/4] about us page feedback --- about-us.html | 1 + 1 file changed, 1 insertion(+) diff --git a/about-us.html b/about-us.html index 57f0c3a..2e3b7cf 100644 --- a/about-us.html +++ b/about-us.html @@ -28,6 +28,7 @@
+