From 1d14d4b6eb66087de48fd12ddafcc2318afc0c90 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Sun, 30 May 2021 02:42:35 -0300 Subject: [PATCH] Move results to session HTML page --- res/js/main.js | 12 +++++++---- res/privacy-rating.css | 4 ++++ session.html | 48 ++++++++++++++++++++++++++++++++++++------ 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/res/js/main.js b/res/js/main.js index ccaa342..2e5c7b8 100644 --- a/res/js/main.js +++ b/res/js/main.js @@ -25,6 +25,8 @@ * by luca0N! */ +let quizEl; + // Attach setUpStrings() to onReady() in order to execute the main code as soon as possible. This overwrites onReady(). onReady = setUpStrings; @@ -50,7 +52,7 @@ function setUpStrings(){ quizAuthor.style['display'] = 'unset'; let contents = quiz.contents; - let elQuiz = document.getElementById('quiz'); // quiz div element. + quizEl = document.getElementById('quiz'); // quiz div element. for (let x = 0; x < contents.length; x++){ //console.log(contents[x].title); @@ -100,15 +102,17 @@ function setUpStrings(){ } else console.warn('Warning: unknown type "' + contents[x].type + '" for question #' + (x + 1)); - elQuiz.appendChild(itemDiv); + quizEl.appendChild(itemDiv); } // Add the finish button. let finish = document.createElement('button'); finish.innerText = 'Finish!'; finish.onclick = function(){ - document.location = 'final.html'; + // Hide quiz and then show the results. + quizEl.style['display'] = 'none'; + document.getElementById('results').style['display'] = 'unset'; } - elQuiz.appendChild(finish); + quizEl.appendChild(finish); warning.style['display'] = 'none'; }); } diff --git a/res/privacy-rating.css b/res/privacy-rating.css index 954b885..eace6e7 100644 --- a/res/privacy-rating.css +++ b/res/privacy-rating.css @@ -25,6 +25,10 @@ body { margin-right: 15%; } +#results { + display: none; +} + .warning { color: white; background-color: orange; diff --git a/session.html b/session.html index 38f8828..1d2ed49 100644 --- a/session.html +++ b/session.html @@ -29,7 +29,7 @@ - + @@ -38,21 +38,55 @@

It looks like your browser is configured to block JavaScript. We're sorry, but this page requires JavaScript in order to function.

Loading quiz...

-

Quiz Title

-

Published by Author

+

Unknown quiz

+

Unknown author

+
+

And your privacy grade is:

+ + Grade E
+ -
+

+

Oh 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.

+

Your Privacy Report

+ The good, bad and ugly +
+

Good This is a good report

+

This is the report description.

+
+ +
+

Warning This is a warning report

+

This is the report description.

+

Advisory: this is the report advisory.

+
+
+

Bad This is a bad report

+

This is the report description.

+

Advisory: this is the report advisory.

+
+
+

Critical This is a critical report

+

This is the report description.

+

Advisory: this is the report advisory.

+
+
+ -->