index.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="robots" content="index,follow">
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  8. <meta name="description" content="A javascript class that animates a numerical value by counting to it.">
  9. <title>CountUp.js</title>
  10. <link rel="stylesheet" type="text/css" href="../inorganik.github.io/assets/css/style.css?v=20140820">
  11. <script src="countUp.js"></script>
  12. <script src="demo.js"></script>
  13. <script>
  14. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  15. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  16. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  17. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  18. ga('create', 'UA-7742845-9', 'inorganik.github.io');
  19. ga('send', 'pageview');
  20. </script>
  21. </head>
  22. <body ng-app="demoApp">
  23. <a class="forkMe" href="https://github.com/inorganik/CountUp.js"><img src="../assets/img/forkme_custom_indigo.png" alt="Fork me on GitHub"></a>
  24. <div id="wrap">
  25. <header>
  26. <div id="github"><a class="block" href="https://github.com/inorganik"></a></div>
  27. <div class="leaderLine">////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</div>
  28. <div id="logo"><a class="block" href="http://inorganik.github.io"></a></div>
  29. </header>
  30. <section>
  31. <h1>CountUp.js &nbsp;<small id="version" class="lt-gray"></small></h1>
  32. <p>CountUp.js is a dependency-free, lightweight JavaScript "class" that can be used to quickly create animations that display numerical data in a more interesting way.</p>
  33. <p>Install via npm using the package name <code class="indigo large">&nbsp;countup.js&nbsp;</code> or bower using <code class="indigo large">&nbsp;countUp.js</code>.</p>
  34. <h3 class="marginTop marginBottom"><a class="lime weight700" href="https://github.com/inorganik/CountUp.js">Download on Github</a></h3>
  35. </section>
  36. <section>
  37. <p style="position:absolute; top:5px; left:0;">Current stars:</p>
  38. <h1 class="jumbo" id="myTargetElement">0</h1>
  39. <!--<h1 class="jumbo" count-up start-val="0" end-val="2536.1" duration="2.5" decimals="1"></h1>-->
  40. </section>
  41. <section id="errorSection" style="background-color:#FFDCDC; display:none" class="col-inner">
  42. <h4 id="error" style="color: red" class="noMargin"></h4>
  43. </section>
  44. <section>
  45. <form>
  46. <h4 class="inlineLeft noMargin weight300">Params:</h4>
  47. <div class="inlineLeft marginLeft marginRight">
  48. <input type="text" value="24.02" id="startVal" style="width:50px" onkeyup="updateCodeVisualizer()">
  49. <label class="inlineLabel">Start</label>
  50. </div>
  51. <input type="button" class="inlineLeft marginRight" value="Swap" onClick="swapValues()" style="width:80px;">
  52. <div class="inlineLeft marginRight">
  53. <input type="text" value="94.62" id="endVal" style="width:50px" onkeyup="updateCodeVisualizer()">
  54. <label class="inlineLabel">End</label>
  55. </div>
  56. <div class="inlineLeft marginRight">
  57. <input type="number" value="2" id="decimals" step="1" style="width:50px" onkeyup="updateCodeVisualizer()" onchange="updateCodeVisualizer()">
  58. <label class="inlineLabel">Decimals</label>
  59. </div>
  60. <div class="inlineLeft marginRight">
  61. <input type="number" value="2.5" id="duration" step=".1" style="width:50px" onkeyup="updateCodeVisualizer()" onchange="updateCodeVisualizer()">
  62. <label class="inlineLabel">Duration</label>
  63. </div>
  64. </form>
  65. </section>
  66. <section>
  67. <form>
  68. <h4 class="inlineLeft noMargin weight300">Options:</h4>
  69. <div class="inlineLeft marginLeft marginRight">
  70. <input type="checkbox" onClick="toggleEasing(this)" checked><label class="inlineLabel">Use easing</label>
  71. </div>
  72. <div class="inlineLeft marginRight">
  73. <input type="checkbox" onClick="toggleGrouping(this)" checked><label class="inlineLabel">Use grouping</label>
  74. </div>
  75. <div class="inlineLeft marginRight">
  76. <input type="text" value="," id="separator" style="width:15px; padding:0 5px;" onkeyup="updateCodeVisualizer()">
  77. <label class="inlineLabel">Separator</label>
  78. </div>
  79. <div class="inlineLeft marginRight">
  80. <input type="text" value="." id="decimal" style="width:15px; padding:0 5px;" onkeyup="updateCodeVisualizer()">
  81. <label class="inlineLabel">Decimal</label>
  82. </div>
  83. <div class="inlineLeft marginRight">
  84. <input type="text" value="" id="prefix" style="width:15px; padding:0 5px;" onkeyup="updateCodeVisualizer()">
  85. <label class="inlineLabel">Prefix</label>
  86. </div>
  87. <div class="inlineLeft marginRight">
  88. <input type="text" value="" id="suffix" style="width:15px; padding:0 5px;" onkeyup="updateCodeVisualizer()">
  89. <label class="inlineLabel">Suffix</label>
  90. </div>
  91. </form>
  92. </section>
  93. <section>
  94. <form>
  95. <h4 class="inlineLeft noMargin weight300">Methods:</h4>
  96. <input type="button" value="Start" onClick="createCountUp()" class="inlineLeft marginLeft marginRight">
  97. <input type="button" value="Pause/Resume" onClick="showCodeAndPauseResume()" class="inlineLeft marginRight">
  98. <input type="button" value="Reset" onClick="showCodeAndReset()" class="inlineLeft marginRight">
  99. <input type="button" value="Update:" onClick="showCodeAndUpdate()" class="inlineLeft" style="margin-right:5px">
  100. <div class="inlineLeft marginRight">
  101. <input type="text" value="6789" id="updateVal" style="width:50px" onkeyup="updateCodeVisualizerForUpdate()">
  102. </div>
  103. <div class="inlineLeft">
  104. <input type="checkbox" onClick="toggleOnComplete(this)"><label class="inlineLabel">Alert on complete</label>
  105. </div>
  106. </form>
  107. </section>
  108. <section id="easingSection">
  109. <form>
  110. <h4 class="inlineLeft noMargin weight300">Custom:</h4>
  111. <div class="inlineLeft marginLeft">
  112. <label class="inlineLabel">Easing: &nbsp;</label>
  113. <select id="easingFnsDropdown" class="marginRight">
  114. <option value="easeOutExpo" selected>easeOutExpo (default, built-in)</option>
  115. <option value="outQuintic">outQuintic</option>
  116. <option value="outCubic">outCubic</option>
  117. </select>
  118. </div>
  119. <div class="inlineLeft marginRight">
  120. <label class="inlineLabel">Numerals: &nbsp;</label>
  121. <select id="numeralsDropdown">
  122. <option value="" selected>Default ("1234")</option>
  123. <option value="ea">Eastern Arabic ("١٢٣٤")</option>
  124. <option value="fa">Farsi ("۱۲۳۴")</option>
  125. </select>
  126. </div>
  127. <div class="inlineLeft">
  128. <input type="button" value="Apply" onClick="createCountUp()">
  129. </div>
  130. </form>
  131. </section>
  132. <section class="marginBottom">
  133. <div class="col full marginBottom marginTop">
  134. <div class="code-contain marginBottom">
  135. <code id="codeVisualizer" class="indigo">var options = {<br>
  136. &emsp;&emsp;useEasing : true, <br>
  137. &emsp;&emsp;easingFn : null, <br>
  138. &emsp;&emsp;useGrouping : true, <br>
  139. &emsp;&emsp;separator : ',', <br>
  140. &emsp;&emsp;decimal : '.' <br>
  141. }<br>
  142. var demo = new CountUp("myTargetElement", 24.02, 94.62, 0, 2, options);<br>
  143. demo.start();
  144. </code>
  145. </div>
  146. </div>
  147. </section>
  148. </div>
  149. </body>
  150. </html>