Advertisement
Guest User

Untitled

a guest
Apr 4th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.   var id_preset, id_presets, isInArray, konamiCode, loadPreset;
  3.  
  4.   window.loadGUI = function() {
  5.     var f, ff, fm, fmm, gui_f, initPage, resizeGUI;
  6.     window.p = {};
  7.     p.exportConfig = function(type) {
  8.       var data, data_css, pJS_GUI_Export, pJS_GUI_tmp, ratio;
  9.       pJS_GUI_Export = {};
  10.       pJS_GUI_tmp = window.pJS_GUI;
  11.       Object.deepExtend(pJS_GUI_Export, pJS_GUI_tmp);
  12.       ratio = pJS_GUI_tmp.canvas.pxratio;
  13.       pJS_GUI_Export.particles.size.value = pJS_GUI_tmp.particles.size.value / ratio;
  14.       pJS_GUI_Export.particles.size.anim.speed = pJS_GUI_tmp.particles.size.anim.speed / ratio;
  15.       pJS_GUI_Export.particles.move.speed = pJS_GUI_tmp.particles.move.speed / ratio;
  16.       pJS_GUI_Export.particles.line_linked.distance = pJS_GUI_tmp.particles.line_linked.distance / ratio;
  17.       pJS_GUI_Export.interactivity.modes.grab.distance = pJS_GUI_tmp.interactivity.modes.grab.distance / ratio;
  18.       pJS_GUI_Export.interactivity.modes.bubble.distance = pJS_GUI_tmp.interactivity.modes.bubble.distance / ratio;
  19.       pJS_GUI_Export.particles.line_linked.width = pJS_GUI_tmp.particles.line_linked.width / ratio;
  20.       pJS_GUI_Export.interactivity.modes.bubble.size = pJS_GUI_tmp.interactivity.modes.bubble.size / ratio;
  21.       pJS_GUI_Export.interactivity.modes.repulse.distance = pJS_GUI_tmp.interactivity.modes.repulse.distance / ratio;
  22.       data_css = pJS_GUI_Export.config_demo;
  23.       delete pJS_GUI_Export.config_demo;
  24.       delete pJS_GUI_Export.canvas;
  25.       delete pJS_GUI_Export.fn;
  26.       delete pJS_GUI_Export.tmp;
  27.       delete pJS_GUI_Export.particles.array;
  28.       delete pJS_GUI_Export.interactivity.el;
  29.       delete pJS_GUI_Export.interactivity.mouse;
  30.       delete pJS_GUI_Export.interactivity.status;
  31.       delete pJS_GUI_Export.particles.color.rgb;
  32.       delete pJS_GUI_Export.particles.line_linked.color_rgb_line;
  33.       if (type === 'json') {
  34.         return console.save(pJS_GUI_Export, 'particlesjs-config.json');
  35.       } else {
  36.         data = {
  37.           js: pJS_GUI_Export,
  38.           css: data_css
  39.         };
  40.         return data;
  41.       }
  42.     };
  43.     p.exportConfigJSON = function() {
  44.       return p.exportConfig('json');
  45.     };
  46.     p.update = function() {
  47.       return pJS_GUI.fn.particlesRefresh();
  48.     };
  49.     window.gui = new dat.GUI({
  50.       autoPlace: true,
  51.       closed: true,
  52.       width: 340
  53.     });
  54.     window.pJS_GUI = window.pJSDom[0].pJS;
  55.     window.page_settings = {
  56.       hide_card: false,
  57.       background_color: '#111',
  58.       background_image: 'http://globe-views.com/dcim/dreams/image/image-03.jpg'
  59.     };
  60.     gui_f = {
  61.       particles: gui.addFolder('particles'),
  62.       interactivity: gui.addFolder('interactivity'),
  63.       pagecss: gui.addFolder('page background (css)')
  64.     };
  65.     f = {
  66.       particles: {
  67.         number: gui_f.particles.addFolder('number'),
  68.         color: gui_f.particles.addFolder('color'),
  69.         shape: gui_f.particles.addFolder('shape'),
  70.         size: gui_f.particles.addFolder('size'),
  71.         opacity: gui_f.particles.addFolder('opacity'),
  72.         line_linked: gui_f.particles.addFolder('line_linked'),
  73.         move: gui_f.particles.addFolder('move')
  74.       },
  75.       interactivity: {
  76.         events_onhover: gui_f.interactivity.addFolder('onhover'),
  77.         events_onclick: gui_f.interactivity.addFolder('onclick'),
  78.         modes: gui_f.interactivity.addFolder('modes')
  79.       }
  80.     };
  81.     ff = {
  82.       shape_stroke: f.particles.shape.addFolder('stroke'),
  83.       shape_polygon: f.particles.shape.addFolder('polygon'),
  84.       shape_image: f.particles.shape.addFolder('image'),
  85.       size_anim: f.particles.size.addFolder('anim'),
  86.       opacity_anim: f.particles.opacity.addFolder('anim')
  87.     };
  88.     fm = {
  89.       grab: f.interactivity.modes.addFolder('grab'),
  90.       bubble: f.interactivity.modes.addFolder('bubble'),
  91.       repulse: f.interactivity.modes.addFolder('repulse'),
  92.       push: f.interactivity.modes.addFolder('push'),
  93.       remove: f.interactivity.modes.addFolder('remove')
  94.     };
  95.     fmm = {
  96.       grab_linelinked: fm.grab.addFolder('line_linked')
  97.     };
  98.     gui.add(pJS_GUI, 'retina_detect').name('retina_detect').onChange(function(value) {
  99.       pJS_GUI.retina_detect = value;
  100.       return p.update();
  101.     });
  102.     f.particles.number.add(pJS_GUI.particles.number, 'value', 0, 600).name('value').step(1).onChange(function(value) {
  103.       pJS_GUI.particles.number.value = value;
  104.       return p.update();
  105.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement