(function($) { jQuery.fn.progressBar = function( options ) { //Default values for progress_bar var defaults = { height : "30", backgroundColor : "#E0E0E0", barColor : "#F97352", targetBarColor : "#CCC", percentage : true, shadow : false, border : false, animation : false, animateTarget : false, }; var settings = $.extend( {}, defaults, options ); return this.each( function() { var elem = $( this ); $.fn.replaceProgressBar( elem, settings ); }); }; $.fn.replaceProgressBar = function( item, settings ) { var skill = item.text(); var progress = item.data( 'width' ); var target = item.data ( 'target' ); var bar_classes = ' '; var animation_class = ''; var bar_styles = 'background-color:' + settings.backgroundColor + ';height:' + settings.height + 'px;'; if ( settings.shadow ) { bar_classes += 'shadow'; } if ( settings.border ) { bar_classes += ' border'; } if ( settings.animation ) { animation_class = ' animate'; } var overlay = '
'; // Render the progress bar on the page $( item ).replaceWith( overlay ); }; var animate = function() { var doc_height = $(window).height(); $( '.sonny_progressbar.animate' ).each( function() { var position = $( this ).offset().top; if ( ( $(window).scrollTop() + doc_height - 60 ) > position ) { var progress = $( this ).data( 'width' ) + "%"; $( this ).removeClass( 'animate' ); $( this ).find( '.bar' ).css('opacity', '0.1'); $( this ).find( '.bar' ).animate({ width : progress, opacity : 1 }, 3000 ); } }); }; // Looking for an animation element in the view $(window).scroll(function() { if ( $( '.sonny_progressbar.animate' ).length < 1 ) { return; } // If there is an animate element visible on the page, trigger the animation animate(); }); })(jQuery); /* Dashboard CIrcle Progress Bar Script */ // function makesvg(percentage, inner_text=""){ // // var abs_percentage = Math.abs(percentage).toString(); // var percentage_str = percentage.toString(); // var classes = "" // // if(percentage < 0){ // classes = "danger-stroke circle-chart__circle--negative"; // } else if(percentage > 0 && percentage <= 30){ // classes = "warning-stroke"; // } else{ // classes = "success-stroke"; // } // // var svg = ''; // // return svg // } (function( $ ) { $.fn.circlechart = function() { this.each(function() { var percentage = $(this).data("percentage"); var inner_text = $(this).text(); // $(this).html(makesvg(percentage, inner_text)); }); return this; }; }( jQuery )); /* ----- Job List V3 Page On Click SIdebar ----- */ function openNav() { document.getElementById("mySidenav").style.width = "300px"; document.getElementById("mySidenav").style.marginLeft = "0px"; document.getElementById("main").style.marginLeft = "0"; document.body.style.backgroundColor = "rgba(250,250,250,0.4)"; } function closeNav() { document.getElementById("mySidenav").style.width = "0"; document.getElementById("mySidenav").style.marginLeft= "-30px"; document.getElementById("main").style.marginLeft= "0"; document.body.style.backgroundColor = "white"; }