Add smooth scroll to top of results

This commit is contained in:
luca0N! 2021-05-30 22:06:26 -03:00
parent d488a6f275
commit f4f24c4d0d
Signed by: luca0N
GPG Key ID: 2E7B4655CF16D7D6
3 changed files with 8 additions and 1 deletions

View File

@ -20,6 +20,10 @@
* E-mail contact: <luca0n@luca0n.com>. * E-mail contact: <luca0n@luca0n.com>.
*/ */
html {
scroll-behavior: smooth;
}
body { body {
margin-left: 15%; margin-left: 15%;
margin-right: 15%; margin-right: 15%;

View File

@ -199,6 +199,9 @@ function setUpStrings(){
// Hide quiz and then show the results. // Hide quiz and then show the results.
quizEl.style['display'] = 'none'; quizEl.style['display'] = 'none';
document.getElementById('results').style['display'] = 'unset'; document.getElementById('results').style['display'] = 'unset';
// Jump to the top of the results.
document.location = '#results';
} }
quizEl.appendChild(finish); quizEl.appendChild(finish);
warning.style['display'] = 'none'; warning.style['display'] = 'none';

View File

@ -41,7 +41,7 @@
<h2 id="quiz-title">Unknown quiz</h2> <h2 id="quiz-title">Unknown quiz</h2>
<p id="quiz-author">Unknown author</p> <p id="quiz-author">Unknown author</p>
<div id="results"> <div id="results">
<center><p>And your privacy grade is:</p> <center><p>Your privacy grade is:</p>
<span id="badge-s" class="badge grade-s">Grade S</span> <span id="badge-s" class="badge grade-s">Grade S</span>
<span id="badge-a" class="badge grade-a">Grade A</span> <span id="badge-a" class="badge grade-a">Grade A</span>
<span id="badge-b" class="badge grade-b">Grade B</span> <span id="badge-b" class="badge grade-b">Grade B</span>