123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677 |
- /* ------------------------------------------------------------------------------
- *
- * # Progress bars & loaders
- *
- * Demo JS code for components_progress.html page
- *
- * ---------------------------------------------------------------------------- */
- // Setup module
- // ------------------------------
- var Progress = function() {
- //
- // Setup module components
- //
- // Enhanced progress bars
- var _componentProgress = function() {
- if (!$().progressbar) {
- console.warn('Warning - progressbar.min.js is not loaded.');
- return;
- }
- // Basic progress bar
- // ------------------------------
- // Start
- $('#h-default-basic-start').on('click', function() {
- var $pb = $('#h-default-basic .progress-bar');
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar();
- });
- // Reset
- $('#h-default-basic-reset').on('click', function() {
- $('#h-default-basic .progress-bar').attr('data-transitiongoal', 0).progressbar();
- });
- // Progress bar in right direction
- // ------------------------------
- // Start
- $('#h-right-basic-start').on('click', function() {
- var $pb = $('#h-right-basic .progress-bar');
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar();
- });
- // Reset
- $('#h-right-basic-reset').on('click', function() {
- $('#h-right-basic .progress-bar').attr('data-transitiongoal', 0).progressbar();
- });
- // Progress bar with text fill
- // ------------------------------
- // Start
- $('#h-fill-basic-start').on('click', function() {
- var $pb = $('#h-fill-basic .progress-bar');
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar({display_text: 'fill'});
- });
- // Reset
- $('#h-fill-basic-reset').on('click', function() {
- $('#h-fill-basic .progress-bar').attr('data-transitiongoal', 0).progressbar({display_text: 'fill'});
- });
- // Start
- $('#h-fill-basic-right-start').on('click', function() {
- var $pb = $('#h-fill-basic-right .progress-bar');
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar({display_text: 'fill'});
- });
- // Reset
- $('#h-fill-basic-right-reset').on('click', function() {
- $('#h-fill-basic-right .progress-bar').attr('data-transitiongoal', 0).progressbar({display_text: 'fill'});
- });
- // Progress bar with non-percentage text
- // ------------------------------
- // Start
- $('#h-fill-nonpercentage-basic-start').on('click', function() {
- var $pb = $('#h-fill-nonpercentage-basic .progress-bar');
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar({display_text: 'fill', use_percentage: false});
- });
- // Reset
- $('#h-fill-nonpercentage-basic-reset').on('click', function() {
- $('#h-fill-nonpercentage-basic .progress-bar').attr('data-transitiongoal', 0).progressbar({display_text: 'fill', use_percentage: false});
- });
- // Start
- $('#h-fill-nonpercentage-right-basic-start').on('click', function() {
- var $pb = $('#h-fill-nonpercentage-right-basic .progress-bar');
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar({display_text: 'fill', use_percentage: false});
- });
- // Reset
- $('#h-fill-nonpercentage-right-basic-reset').on('click', function() {
- $('#h-fill-nonpercentage-right-basic .progress-bar').attr('data-transitiongoal', 0).progressbar({display_text: 'fill', use_percentage: false});
- });
-
- // Vertical progress bar
- // ------------------------------
- // Start
- $('#v-default-basic-start').on('click', function() {
- $('#v-default-basic .progress-bar').each(function () {
- var $pb = $(this);
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar();
- });
- });
- // Reset
- $('#v-default-basic-reset').on('click', function() {
- $('#v-default-basic .progress-bar').attr('data-transitiongoal', 0).progressbar();
- });
- // Bottom direction
- // ------------------------------
- // Start
- $('#v-bottom-basic-start').on('click', function() {
- $('#v-bottom-basic .progress-bar').each(function () {
- var $pb = $(this);
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar();
- });
- });
- // Reset
- $('#v-bottom-basic-reset').on('click', function() {
- $('#v-bottom-basic .progress-bar').attr('data-transitiongoal', 0).progressbar();
- });
- // Vertical progress bar with text fill
- // ------------------------------
- // Start
- $('#v-fill-basic-start').on('click', function() {
- $('#v-fill-basic .progress-bar').each(function () {
- var $pb = $(this);
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar({display_text: 'fill'});
- });
- });
- // Reset
- $('#v-fill-basic-reset').on('click', function() {
- $('#v-fill-basic .progress-bar').attr('data-transitiongoal', 0).progressbar();
- });
- // Start
- $('#v-fill-bottom-start').on('click', function() {
- $('#v-fill-bottom .progress-bar').each(function () {
- var $pb = $(this);
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar({display_text: 'fill'});
- });
- });
- // Reset
- $('#v-fill-bottom-reset').on('click', function() {
- $('#v-fill-bottom .progress-bar').attr('data-transitiongoal', 0).progressbar();
- });
- // Vertical progress bar with non-percentage text
- // ------------------------------
- // Start
- $('#v-fill-nonpercentage-basic-start').on('click', function() {
- $('#v-fill-nonpercentage-basic .progress-bar').each(function () {
- var $pb = $(this);
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar({display_text: 'fill', use_percentage: false});
- });
- });
- // Reset
- $('#v-fill-nonpercentage-basic-reset').on('click', function() {
- $('#v-fill-nonpercentage-basic .progress-bar').attr('data-transitiongoal', 0).progressbar();
- });
- // Start
- $('#v-fill-nonpercentage-bottom-start').on('click', function() {
- $('#v-fill-nonpercentage-bottom .progress-bar').each(function () {
- var $pb = $(this);
- $pb.attr('data-transitiongoal', $pb.attr('data-transitiongoal-backup'));
- $pb.progressbar({display_text: 'fill', use_percentage: false});
- });
- });
- // Reset
- $('#v-fill-nonpercentage-bottom-reset').on('click', function() {
- $('#v-fill-nonpercentage-bottom .progress-bar').attr('data-transitiongoal', 0).progressbar();
- });
- };
- // BlockUI
- var _componentBlockui = function() {
- if (!$().block) {
- console.warn('Warning - blockui.min.js is not loaded.');
- return;
- }
- // Spinner #1
- // ------------------------------
- // Light
- $('#spinner-light').on('click', function() {
- var light = $(this).closest('.card');
- $(light).block({
- message: '<i class="icon-spinner spinner"></i>',
- overlayCSS: {
- backgroundColor: '#fff',
- opacity: 0.8,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none'
- }
- });
- window.setTimeout(function () {
- $(light).unblock();
- }, 2000);
- });
- // Dark
- $('#spinner-dark').on('click', function() {
- var dark = $(this).closest('.card');
- $(dark).block({
- message: '<i class="icon-spinner spinner"></i>',
- overlayCSS: {
- backgroundColor: '#1B2024',
- opacity: 0.85,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none',
- color: '#fff'
- }
- });
- window.setTimeout(function () {
- $(dark).unblock();
- }, 2000);
- });
- // Spinner #2
- // ------------------------------
- // Light
- $('#spinner-light-2').on('click', function() {
- var light_2 = $(this).closest('.card');
- $(light_2).block({
- message: '<i class="icon-spinner2 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#fff',
- opacity: 0.8,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none'
- }
- });
- window.setTimeout(function () {
- $(light_2).unblock();
- }, 2000);
- });
- // Dark
- $('#spinner-dark-2').on('click', function() {
- var dark_2 = $(this).closest('.card');
- $(dark_2).block({
- message: '<i class="icon-spinner2 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#1B2024',
- opacity: 0.85,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none',
- color: '#fff'
- }
- });
- window.setTimeout(function () {
- $(dark_2).unblock();
- }, 2000);
- });
- // Spinner #3
- // ------------------------------
- // Light
- $('#spinner-light-3').on('click', function() {
- var light_3 = $(this).closest('.card');
- $(light_3).block({
- message: '<i class="icon-spinner3 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#fff',
- opacity: 0.8,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none'
- }
- });
- window.setTimeout(function () {
- $(light_3).unblock();
- }, 2000);
- });
- // Dark
- $('#spinner-dark-3').on('click', function() {
- var dark_3 = $(this).closest('.card');
- $(dark_3).block({
- message: '<i class="icon-spinner3 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#1B2024',
- opacity: 0.85,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none',
- color: '#fff'
- }
- });
- window.setTimeout(function () {
- $(dark_3).unblock();
- }, 2000);
- });
- // Spinner #4
- // ------------------------------
- // Light
- $('#spinner-light-4').on('click', function() {
- var light_4 = $(this).closest('.card');
- $(light_4).block({
- message: '<i class="icon-spinner4 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#fff',
- opacity: 0.8,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none'
- }
- });
- window.setTimeout(function () {
- $(light_4).unblock();
- }, 2000);
- });
- // Dark
- $('#spinner-dark-4').on('click', function() {
- var dark_4 = $(this).closest('.card');
- $(dark_4).block({
- message: '<i class="icon-spinner4 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#1B2024',
- opacity: 0.85,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none',
- color: '#fff'
- }
- });
- window.setTimeout(function () {
- $(dark_4).unblock();
- }, 2000);
- });
- // Spinner #5
- // ------------------------------
- // Light
- $('#spinner-light-5').on('click', function() {
- var light_5 = $(this).closest('.card');
- $(light_5).block({
- message: '<i class="icon-spinner6 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#fff',
- opacity: 0.8,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none'
- }
- });
- window.setTimeout(function () {
- $(light_5).unblock();
- }, 2000);
- });
- // Dark
- $('#spinner-dark-5').on('click', function() {
- var dark_5 = $(this).closest('.card');
- $(dark_5).block({
- message: '<i class="icon-spinner6 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#1B2024',
- opacity: 0.85,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none',
- color: '#fff'
- }
- });
- window.setTimeout(function () {
- $(dark_5).unblock();
- }, 2000);
- });
- // Spinner #6
- // ------------------------------
- // Light
- $('#spinner-light-6').on('click', function() {
- var light_6 = $(this).closest('.card');
- $(light_6).block({
- message: '<i class="icon-spinner9 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#fff',
- opacity: 0.8,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none'
- }
- });
- window.setTimeout(function () {
- $(light_6).unblock();
- }, 2000);
- });
- // Dark
- $('#spinner-dark-6').on('click', function() {
- var dark_6 = $(this).closest('.card');
- $(dark_6).block({
- message: '<i class="icon-spinner9 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#1B2024',
- opacity: 0.85,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none',
- color: '#fff'
- }
- });
- window.setTimeout(function () {
- $(dark_6).unblock();
- }, 2000);
- });
- // Spinner #7
- // ------------------------------
- // Light
- $('#spinner-light-7').on('click', function() {
- var light_7 = $(this).closest('.card');
- $(light_7).block({
- message: '<i class="icon-spinner10 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#fff',
- opacity: 0.8,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none'
- }
- });
- window.setTimeout(function () {
- $(light_7).unblock();
- }, 2000);
- });
- // Dark
- $('#spinner-dark-7').on('click', function() {
- var dark_7 = $(this).closest('.card');
- $(dark_7).block({
- message: '<i class="icon-spinner10 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#1B2024',
- opacity: 0.85,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none',
- color: '#fff'
- }
- });
- window.setTimeout(function () {
- $(dark_7).unblock();
- }, 2000);
- });
- // Spinner #8
- // ------------------------------
- // Light
- $('#spinner-light-8').on('click', function() {
- var light_8 = $(this).closest('.card');
- $(light_8).block({
- message: '<i class="icon-spinner11 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#fff',
- opacity: 0.8,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none'
- }
- });
- window.setTimeout(function () {
- $(light_8).unblock();
- }, 2000);
- });
- // Dark
- $('#spinner-dark-8').on('click', function() {
- var dark_8 = $(this).closest('.card');
- $(dark_8).block({
- message: '<i class="icon-spinner11 spinner"></i>',
- overlayCSS: {
- backgroundColor: '#1B2024',
- opacity: 0.85,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none',
- color: '#fff'
- }
- });
- window.setTimeout(function () {
- $(dark_8).unblock();
- }, 2000);
- });
- // Spinner #9
- // ------------------------------
- // Light
- $('#spinner-light-9').on('click', function() {
- var light_9 = $(this).closest('.card');
- $(light_9).block({
- message: '<i class="icon-sync spinner"></i>',
- overlayCSS: {
- backgroundColor: '#fff',
- opacity: 0.8,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none'
- }
- });
- window.setTimeout(function () {
- $(light_9).unblock();
- }, 2000);
- });
- // Dark
- $('#spinner-dark-9').on('click', function() {
- var dark_9 = $(this).closest('.card');
- $(dark_9).block({
- message: '<i class="icon-sync spinner"></i>',
- overlayCSS: {
- backgroundColor: '#1B2024',
- opacity: 0.85,
- cursor: 'wait'
- },
- css: {
- border: 0,
- padding: 0,
- backgroundColor: 'none',
- color: '#fff'
- }
- });
- window.setTimeout(function () {
- $(dark_9).unblock();
- }, 2000);
- });
- };
- //
- // Return objects assigned to module
- //
- return {
- init: function() {
- _componentProgress();
- _componentBlockui();
- }
- }
- }();
- // Initialize module
- // ------------------------------
- document.addEventListener('DOMContentLoaded', function() {
- Progress.init();
- });
|