initial commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
function startNatif(success,message){
|
||||
$('#showAlert').append("<div class='alert alert-"+success+" fade in' id='alert' style='top:6%; left: 77%; width:19%;position: absolute;'><a href='#' class='close' data-dismiss='alert'>×</a>"+message+"</div>");
|
||||
setTimeout("$('.alert').alert('close')", 4000);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,26 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
var show = true;
|
||||
var countbox = "#counts";
|
||||
$(window).on("scroll load resize", function(){
|
||||
|
||||
if(!show) return false;
|
||||
|
||||
var w_top = $(window).scrollTop();
|
||||
var e_top = $(countbox).offset().top;
|
||||
|
||||
var w_height = $(window).height();
|
||||
var d_height = $(document).height();
|
||||
|
||||
var e_height = $(countbox).outerHeight();
|
||||
|
||||
if(w_top + 200 >= e_top || w_height + w_top == d_height || e_height + e_top < w_height){
|
||||
$(".spincrement").spincrement({
|
||||
thousandSeparator: "",
|
||||
duration: 1200
|
||||
});
|
||||
|
||||
show = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+10
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
<script src="https://code.highcharts.com/highcharts.js"></script>
|
||||
<script src="https://code.highcharts.com/modules/exporting.js"></script>
|
||||
|
||||
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
|
||||
Vendored
+9803
File diff suppressed because it is too large
Load Diff
Vendored
+23
File diff suppressed because one or more lines are too long
Vendored
+4
File diff suppressed because one or more lines are too long
Vendored
+18
File diff suppressed because one or more lines are too long
Vendored
+4
File diff suppressed because one or more lines are too long
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* jQuery Spincrement plugin
|
||||
*
|
||||
* Plugin structure based on: http://blog.jeremymartin.name/2008/02/building-your-first-jquery-plugin-that.html
|
||||
* Leveraging of jQuery animate() based on: http://www.bennadel.com/blog/2007-Using-jQuery-s-animate-Method-To-Power-Easing-Based-Iteration.htm
|
||||
* Easing function from jQuery Easing plugin: http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
* Thousands separator code: http://www.webmasterworld.com/forum91/8.htm
|
||||
*
|
||||
* @author John J. Camilleri
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
(function($){
|
||||
|
||||
// Custom easing function
|
||||
$.extend( $.easing, {
|
||||
// This is ripped directly from the jQuery easing plugin (easeOutExpo), from: http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
spincrementEasing: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
}
|
||||
});
|
||||
|
||||
// Spincrement function
|
||||
$.fn.spincrement = function(opts) {
|
||||
|
||||
// Default values
|
||||
var defaults = {
|
||||
from: 0,
|
||||
to: false,
|
||||
decimalPlaces: 0,
|
||||
decimalPoint: '.',
|
||||
thousandSeparator: ',',
|
||||
duration: 1000, // ms; TOTAL length animation
|
||||
leeway: 50, // percent of duraion
|
||||
easing: 'spincrementEasing',
|
||||
fade: true
|
||||
};
|
||||
var options = $.extend(defaults, opts);
|
||||
|
||||
// Function for formatting number
|
||||
var re_thouSep = new RegExp(/^(-?[0-9]+)([0-9]{3})/);
|
||||
function format(num) {
|
||||
num = num.toFixed(options.decimalPlaces); // converts to string!
|
||||
|
||||
// Non "." decimal point
|
||||
if ( (options.decimalPlaces > 0) && (options.decimalPoint != '.') ) {
|
||||
num = num.replace('.', options.decimalPoint);
|
||||
}
|
||||
|
||||
// Thousands separator
|
||||
if (options.thousandSeparator) {
|
||||
while(re_thouSep.test(num)) {
|
||||
num = num.replace(re_thouSep, '$1'+options.thousandSeparator+'$2');
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Apply to each matching item
|
||||
return this.each(function() {
|
||||
|
||||
// Get handle on current obj
|
||||
var obj = $(this);
|
||||
|
||||
// Set params FOR THIS ELEM
|
||||
var from = options.from;
|
||||
var to = (options.to != false) ? options.to : parseFloat(obj.html()); // If no to is set, get value from elem itself
|
||||
//var to = parseFloat(obj.html()); // If no to is set, get value from elem itself
|
||||
var duration = options.duration;
|
||||
if (options.leeway) {
|
||||
// If leeway is set, randomise duration a little
|
||||
duration += Math.round(options.duration * (((Math.random()*2)-1)*(options.leeway)/100));
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
//obj.html(to); return;
|
||||
|
||||
// Start
|
||||
obj.css('counter', from);
|
||||
if (options.fade) obj.css('opacity', 0 );
|
||||
obj.animate(
|
||||
{ counter: to, opacity: 1 },
|
||||
{
|
||||
easing: options.easing,
|
||||
duration: duration,
|
||||
|
||||
// Invoke the callback for each step.
|
||||
step: function(progress) {
|
||||
obj.css('visibility', 'visible'); // Make sure it's visible
|
||||
obj.html(format(progress * to));
|
||||
},
|
||||
complete: function() {
|
||||
// Cleanup
|
||||
obj.css('counter', null);
|
||||
obj.html(format(to));
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user