All files / src/lib/tools summary.js

0% Statements 0/5
100% Branches 0/0
0% Functions 0/2
0% Lines 0/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                                     
/**
 * @module
 * @param {{}} scores Score information to be styled.
 * @return {string} Styled HTML content of level summary
 */
export function levelSummary(scores) {
  let strSummary = '';
  const length = Object.keys(scores).length;
 
  Object.keys(scores).forEach((key, i) => {
    strSummary += `<p style="font-size: ${8 - (length - i) * 2}vh;
    opacity:${(1 / (length - i)).toFixed(2)}">
    <span>${key.slice(1)}</span>
    <span>${scores[key][0].strDiff}</span>
    </p>`;
  });
  return strSummary;
}