Abram Kash 6 vuotta sitten
vanhempi
commit
06bed4bd61
3 muutettua tiedostoa jossa 16 lisäystä ja 13 poistoa
  1. 1 1
      quiz.js
  2. 8 8
      results.js
  3. 7 4
      style.css

+ 1 - 1
quiz.js

@@ -2010,7 +2010,7 @@ function calc_score(score, max_value) {
 }
 
 function rot13(s) {
-  return s.replace(/[A-Za-z]/g, function (c) {
+  return s.replace(/[A-Za-z]/g, function(c) {
     return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charAt(
            "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm".indexOf(c)
     );

+ 8 - 8
results.js

@@ -37,11 +37,11 @@ function shareLink() {
 }
 
 function rot13(s) {
-  return s.replace(/[A-Za-z]/g, function (c) {
+  return s.replace(/[A-Za-z]/g, function(c) {
     return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charAt(
            "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm".indexOf(c)
     );
-  } );
+  });
 }
 
 function getQueryVariable(variable) {
@@ -70,7 +70,7 @@ function setAxisValue(name, value) {
   axis.style.width = (100 * value).toFixed(1) + "%";
 
   text.innerHTML = (100 * value).toFixed(0) + "%";
-  if (text.offsetWidth > (axis.offsetWidth - 5)) text.style.display = "none";
+  if (text.offsetWidth > axis.offsetWidth - 5) text.style.display = "none";
   else text.style.display = "";
 }
 
@@ -827,12 +827,12 @@ for (var b in images) {
   images[b].onload = onImageLoaded;
 }
 
-function download_image(){
-  var canvas = document.getElementById('generatedResults');
-  var link = document.createElement('a');
+function download_image() {
+  var canvas = document.getElementById("generatedResults");
+  var link = document.createElement("a");
   link.href = canvas.toDataURL();
-  link.download = `PolitiScales_Results_${+ new Date()}.png`;
+  link.download = `PolitiScales_Results_${+new Date()}.png`;
   document.body.appendChild(link);
   link.click();
   document.body.removeChild(link);
-}
+}

+ 7 - 4
style.css

@@ -1,4 +1,5 @@
-html, body {
+html,
+body {
   height: 100%;
 }
 
@@ -317,8 +318,10 @@ h3 {
 }
 .scale .axis .axis-bar {
   display: flex;
-  box-shadow: 0vmin 0vmin 0.4vmin #222;
+  box-shadow: 0vmin 1px 0.4vmin #aaa;
   height: 5vmin;
+  background-color: #f3f3f3;
+  color: #888;
 }
 .scale .axis .axis-bar .axis-left,
 .scale .axis .axis-bar .axis-center,
@@ -330,7 +333,7 @@ h3 {
 .scale .axis .axis-bar .axis-right span {
   padding: 0 1.1vmin;
   color: white;
-  text-shadow: 1px 1px 1px rgba(0,0,0,0.5)
+  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
 }
 .scale .axis .axis-bar .axis-left span,
 .scale .axis .axis-bar .axis-center span,
@@ -342,4 +345,4 @@ h3 {
 .scale .axis .axis-bar .axis-center {
   text-align: center;
   flex-grow: 1;
-}
+}