You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
7.3 KiB
159 lines
7.3 KiB
3 years ago
|
<!DOCTYPE HTML>
|
||
|
<html>
|
||
|
<head>
|
||
|
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="robots" content="index,follow">
|
||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||
|
<meta name="description" content="A javascript class that animates a numerical value by counting to it.">
|
||
|
|
||
|
<title>CountUp.js</title>
|
||
|
|
||
|
<link rel="stylesheet" type="text/css" href="../inorganik.github.io/assets/css/style.css?v=20140820">
|
||
|
<script src="countUp.js"></script>
|
||
|
<script src="demo.js"></script>
|
||
|
<script>
|
||
|
|
||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||
|
|
||
|
ga('create', 'UA-7742845-9', 'inorganik.github.io');
|
||
|
ga('send', 'pageview');
|
||
|
|
||
|
</script>
|
||
|
</head>
|
||
|
|
||
|
<body ng-app="demoApp">
|
||
|
<a class="forkMe" href="https://github.com/inorganik/CountUp.js"><img src="../assets/img/forkme_custom_indigo.png" alt="Fork me on GitHub"></a>
|
||
|
<div id="wrap">
|
||
|
<header>
|
||
|
<div id="github"><a class="block" href="https://github.com/inorganik"></a></div>
|
||
|
<div class="leaderLine">////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</div>
|
||
|
<div id="logo"><a class="block" href="http://inorganik.github.io"></a></div>
|
||
|
</header>
|
||
|
<section>
|
||
|
<h1>CountUp.js <small id="version" class="lt-gray"></small></h1>
|
||
|
<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>
|
||
|
<p>Install via npm using the package name <code class="indigo large"> countup.js </code> or bower using <code class="indigo large"> countUp.js</code>.</p>
|
||
|
<h3 class="marginTop marginBottom"><a class="lime weight700" href="https://github.com/inorganik/CountUp.js">Download on Github</a></h3>
|
||
|
</section>
|
||
|
<section>
|
||
|
<p style="position:absolute; top:5px; left:0;">Current stars:</p>
|
||
|
<h1 class="jumbo" id="myTargetElement">0</h1>
|
||
|
<!--<h1 class="jumbo" count-up start-val="0" end-val="2536.1" duration="2.5" decimals="1"></h1>-->
|
||
|
</section>
|
||
|
<section id="errorSection" style="background-color:#FFDCDC; display:none" class="col-inner">
|
||
|
<h4 id="error" style="color: red" class="noMargin"></h4>
|
||
|
</section>
|
||
|
<section>
|
||
|
<form>
|
||
|
<h4 class="inlineLeft noMargin weight300">Params:</h4>
|
||
|
<div class="inlineLeft marginLeft marginRight">
|
||
|
<input type="text" value="24.02" id="startVal" style="width:50px" onkeyup="updateCodeVisualizer()">
|
||
|
<label class="inlineLabel">Start</label>
|
||
|
</div>
|
||
|
<input type="button" class="inlineLeft marginRight" value="Swap" onClick="swapValues()" style="width:80px;">
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<input type="text" value="94.62" id="endVal" style="width:50px" onkeyup="updateCodeVisualizer()">
|
||
|
<label class="inlineLabel">End</label>
|
||
|
</div>
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<input type="number" value="2" id="decimals" step="1" style="width:50px" onkeyup="updateCodeVisualizer()" onchange="updateCodeVisualizer()">
|
||
|
<label class="inlineLabel">Decimals</label>
|
||
|
</div>
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<input type="number" value="2.5" id="duration" step=".1" style="width:50px" onkeyup="updateCodeVisualizer()" onchange="updateCodeVisualizer()">
|
||
|
<label class="inlineLabel">Duration</label>
|
||
|
</div>
|
||
|
</form>
|
||
|
</section>
|
||
|
<section>
|
||
|
<form>
|
||
|
<h4 class="inlineLeft noMargin weight300">Options:</h4>
|
||
|
<div class="inlineLeft marginLeft marginRight">
|
||
|
<input type="checkbox" onClick="toggleEasing(this)" checked><label class="inlineLabel">Use easing</label>
|
||
|
</div>
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<input type="checkbox" onClick="toggleGrouping(this)" checked><label class="inlineLabel">Use grouping</label>
|
||
|
</div>
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<input type="text" value="," id="separator" style="width:15px; padding:0 5px;" onkeyup="updateCodeVisualizer()">
|
||
|
<label class="inlineLabel">Separator</label>
|
||
|
</div>
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<input type="text" value="." id="decimal" style="width:15px; padding:0 5px;" onkeyup="updateCodeVisualizer()">
|
||
|
<label class="inlineLabel">Decimal</label>
|
||
|
</div>
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<input type="text" value="" id="prefix" style="width:15px; padding:0 5px;" onkeyup="updateCodeVisualizer()">
|
||
|
<label class="inlineLabel">Prefix</label>
|
||
|
</div>
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<input type="text" value="" id="suffix" style="width:15px; padding:0 5px;" onkeyup="updateCodeVisualizer()">
|
||
|
<label class="inlineLabel">Suffix</label>
|
||
|
</div>
|
||
|
</form>
|
||
|
</section>
|
||
|
<section>
|
||
|
<form>
|
||
|
<h4 class="inlineLeft noMargin weight300">Methods:</h4>
|
||
|
<input type="button" value="Start" onClick="createCountUp()" class="inlineLeft marginLeft marginRight">
|
||
|
<input type="button" value="Pause/Resume" onClick="showCodeAndPauseResume()" class="inlineLeft marginRight">
|
||
|
<input type="button" value="Reset" onClick="showCodeAndReset()" class="inlineLeft marginRight">
|
||
|
<input type="button" value="Update:" onClick="showCodeAndUpdate()" class="inlineLeft" style="margin-right:5px">
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<input type="text" value="6789" id="updateVal" style="width:50px" onkeyup="updateCodeVisualizerForUpdate()">
|
||
|
</div>
|
||
|
<div class="inlineLeft">
|
||
|
<input type="checkbox" onClick="toggleOnComplete(this)"><label class="inlineLabel">Alert on complete</label>
|
||
|
</div>
|
||
|
</form>
|
||
|
</section>
|
||
|
<section id="easingSection">
|
||
|
<form>
|
||
|
<h4 class="inlineLeft noMargin weight300">Custom:</h4>
|
||
|
<div class="inlineLeft marginLeft">
|
||
|
<label class="inlineLabel">Easing: </label>
|
||
|
<select id="easingFnsDropdown" class="marginRight">
|
||
|
<option value="easeOutExpo" selected>easeOutExpo (default, built-in)</option>
|
||
|
<option value="outQuintic">outQuintic</option>
|
||
|
<option value="outCubic">outCubic</option>
|
||
|
</select>
|
||
|
</div>
|
||
|
<div class="inlineLeft marginRight">
|
||
|
<label class="inlineLabel">Numerals: </label>
|
||
|
<select id="numeralsDropdown">
|
||
|
<option value="" selected>Default ("1234")</option>
|
||
|
<option value="ea">Eastern Arabic ("١٢٣٤")</option>
|
||
|
<option value="fa">Farsi ("۱۲۳۴")</option>
|
||
|
</select>
|
||
|
</div>
|
||
|
<div class="inlineLeft">
|
||
|
<input type="button" value="Apply" onClick="createCountUp()">
|
||
|
</div>
|
||
|
</form>
|
||
|
</section>
|
||
|
<section class="marginBottom">
|
||
|
<div class="col full marginBottom marginTop">
|
||
|
<div class="code-contain marginBottom">
|
||
|
<code id="codeVisualizer" class="indigo">var options = {<br>
|
||
|
  useEasing : true, <br>
|
||
|
  easingFn : null, <br>
|
||
|
  useGrouping : true, <br>
|
||
|
  separator : ',', <br>
|
||
|
  decimal : '.' <br>
|
||
|
}<br>
|
||
|
var demo = new CountUp("myTargetElement", 24.02, 94.62, 0, 2, options);<br>
|
||
|
demo.start();
|
||
|
</code>
|
||
|
</div>
|
||
|
</div>
|
||
|
</section>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|