diff --git a/res/Stairway-js.css b/res/Stairway-js.css index 04bf285..c6740b8 100644 --- a/res/Stairway-js.css +++ b/res/Stairway-js.css @@ -110,10 +110,10 @@ body { border: solid; } -.report { +.report-title { font-weight: bold; } -.report-class { +.report-type { padding: 4px 4px 0px 4px; text-shadow: 0 0 2px #0005; box-shadow: 2px 2px 2px #0004; diff --git a/res/js/main.js b/res/js/main.js index acb7547..7464968 100644 --- a/res/js/main.js +++ b/res/js/main.js @@ -149,6 +149,53 @@ function setUpStrings(){ // Display the grade X badge element (unset its 'none' display value) document.getElementById('badge-' + grade).style['display'] = 'unset'; + // Generate report elements. + + for (let x = 0; x < choices.length; x++) + for (let y = 0; y < choices[x].length; y++){ + let report = quiz.reports[choices[x][y]]; + + let reportEl = document.createElement('div'); + reportEl.className = 'section-report'; + + let title = document.createElement('p'); + title.className = 'report-title'; + + // Create the report type span. + let type = document.createElement('span'); + // Make sure the first letter is uppercase. + let typeName = report.type[0].toUpperCase(); + typeName += report.type.substring(1); + type.innerText = typeName; + type.className = 'report-type report-' + report.type; + title.append(type); + + let titleSpan = document.createElement('span'); + titleSpan.innerText = report.title; + title.appendChild(titleSpan); + reportEl.appendChild(title); + + type.after(' '); // add a whitespace after this span so it doesn't look too close to the report title. + + // For each line break in the report description, + // create a separate paragraph. + let paragraphs = report.description.split('\n'); + for (let z = 0; z < paragraphs.length; z++){ + let p = document.createElement('p'); + p.innerText = paragraphs[z]; + reportEl.appendChild(p); + } + + // Add an advisory paragraph if it exists. + if (report.advisory != null && report.advisory != undefined){ + let p = document.createElement('p'); + p.innerText = report.advisory; + reportEl.appendChild(p); + } + + document.getElementById('reports').appendChild(reportEl); + } + // Hide quiz and then show the results. quizEl.style['display'] = 'none'; document.getElementById('results').style['display'] = 'unset'; diff --git a/session.html b/session.html index 3cc8ba0..7f76065 100644 --- a/session.html +++ b/session.html @@ -42,20 +42,22 @@
And your privacy grade is:
- - Grade EOh no, looks like you got a bad grade! Unfortunately, many popular services do not respect your privacy, and you're likely using some of them.
But you can increase your privacy grade. Do not be discouraged from performing good privacy practices because you can increase it drastically with little to no effort.