Advertisement
Guest User

pdf-calc

a guest
Mar 10th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.74 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4.     <title>Project Diva F Maximum Failure Calculator</title>
  5.     <script type="text/javascript">
  6. function update_stats() {
  7.     var notes = parseInt(document.getElementById('notes').value);
  8.     if (notes <= 0 || isNaN(notes)) {
  9.         return;
  10.     }
  11.     var weight = 89.0 / notes;
  12.    
  13.     var ct = parseInt(document.getElementById('ct').value);
  14.     var tz = parseInt(document.getElementById('tz').value);
  15.    
  16.     var min = 3 - ct - tz;
  17.     var bonus = 5 * ct + 3 * tz;
  18.    
  19.     var quotas = [80, 90, 95];
  20.     for (var i = 0; i < quotas.length; i++) {
  21.         var c = Math.floor(notes - (quotas[i] - bonus) / weight);
  22.         var possible = (c >= min);
  23.         document.getElementById(quotas[i] + '_yes').style.display = (possible ? 'inline' : 'none');
  24.         document.getElementById(quotas[i] + '_no').style.display = (possible ? 'none' : 'inline');
  25.         document.getElementById(quotas[i] + '_c').value = c;
  26.     }
  27. }
  28.     </script>
  29. </head>
  30.  
  31. <body>
  32.  
  33. <h1>Project Diva F Maximum Failure Calculator</h1>
  34.  
  35. <div>By antibolo</div>
  36.  
  37. <hr />
  38.  
  39. <div>
  40.     Considering a Normal/Hard/Extreme song with
  41.     <input id="notes" type="number" min="1" max="9999" size="4" onchange="update_stats()" />
  42.     total notes, and assuming you
  43.     <select id="ct" onchange="update_stats()">
  44.         <option value="1">passed</option>
  45.         <option value="0">failed</option>
  46.     </select>
  47.     the Chance Time and completed
  48.     <select id="tz" onchange="update_stats()">
  49.         <option value="2">both</option>
  50.         <option value="1">one</option>
  51.         <option value="0">neither</option>
  52.     </select>
  53.     of the Technical Zones...
  54. </div>
  55.  
  56. <ul>
  57.     <li>
  58.         You
  59.         <span id="80_yes">can fail up to <input id="80_c" disabled="disabled" size="4"> notes to</span>
  60.         <span id="80_no" style="display: none; color: red; font-weight: bold;">CANNOT</span>
  61.         get a <span style="color: blue; font-weight: bold;">Standard</span>
  62.     </li>
  63.     <li>
  64.         You
  65.         <span id="90_yes">can fail up to <input id="90_c" disabled="disabled" size="4"> notes to</span>
  66.         <span id="90_no" style="display: none; color: red; font-weight: bold;">CANNOT</span>
  67.         get a <span style="color: green; font-weight: bold;">Great</span>
  68.     </li>
  69.     <li>
  70.         You
  71.         <span id="95_yes">can fail up to <input id="95_c" disabled="disabled" size="4"> notes to</span>
  72.         <span id="95_no" style="display: none; color: red; font-weight: bold;">CANNOT</span>
  73.         get an <span style="color: lightblue; font-weight: bold;">Excellent</span>
  74.     </li>
  75. </ul>
  76.  
  77. <hr />
  78. <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons Licence" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
  79.  
  80. </body>
  81. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement