Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- var id_preset, id_presets, isInArray, konamiCode, loadPreset;
- window.loadGUI = function() {
- var f, ff, fm, fmm, gui_f, initPage, resizeGUI;
- window.p = {};
- p.exportConfig = function(type) {
- var data, data_css, pJS_GUI_Export, pJS_GUI_tmp, ratio;
- pJS_GUI_Export = {};
- pJS_GUI_tmp = window.pJS_GUI;
- Object.deepExtend(pJS_GUI_Export, pJS_GUI_tmp);
- ratio = pJS_GUI_tmp.canvas.pxratio;
- pJS_GUI_Export.particles.size.value = pJS_GUI_tmp.particles.size.value / ratio;
- pJS_GUI_Export.particles.size.anim.speed = pJS_GUI_tmp.particles.size.anim.speed / ratio;
- pJS_GUI_Export.particles.move.speed = pJS_GUI_tmp.particles.move.speed / ratio;
- pJS_GUI_Export.particles.line_linked.distance = pJS_GUI_tmp.particles.line_linked.distance / ratio;
- pJS_GUI_Export.interactivity.modes.grab.distance = pJS_GUI_tmp.interactivity.modes.grab.distance / ratio;
- pJS_GUI_Export.interactivity.modes.bubble.distance = pJS_GUI_tmp.interactivity.modes.bubble.distance / ratio;
- pJS_GUI_Export.particles.line_linked.width = pJS_GUI_tmp.particles.line_linked.width / ratio;
- pJS_GUI_Export.interactivity.modes.bubble.size = pJS_GUI_tmp.interactivity.modes.bubble.size / ratio;
- pJS_GUI_Export.interactivity.modes.repulse.distance = pJS_GUI_tmp.interactivity.modes.repulse.distance / ratio;
- data_css = pJS_GUI_Export.config_demo;
- delete pJS_GUI_Export.config_demo;
- delete pJS_GUI_Export.canvas;
- delete pJS_GUI_Export.fn;
- delete pJS_GUI_Export.tmp;
- delete pJS_GUI_Export.particles.array;
- delete pJS_GUI_Export.interactivity.el;
- delete pJS_GUI_Export.interactivity.mouse;
- delete pJS_GUI_Export.interactivity.status;
- delete pJS_GUI_Export.particles.color.rgb;
- delete pJS_GUI_Export.particles.line_linked.color_rgb_line;
- if (type === 'json') {
- return console.save(pJS_GUI_Export, 'particlesjs-config.json');
- } else {
- data = {
- js: pJS_GUI_Export,
- css: data_css
- };
- return data;
- }
- };
- p.exportConfigJSON = function() {
- return p.exportConfig('json');
- };
- p.update = function() {
- return pJS_GUI.fn.particlesRefresh();
- };
- window.gui = new dat.GUI({
- autoPlace: true,
- closed: true,
- width: 340
- });
- window.pJS_GUI = window.pJSDom[0].pJS;
- window.page_settings = {
- hide_card: false,
- background_color: '#111',
- background_image: 'http://globe-views.com/dcim/dreams/image/image-03.jpg'
- };
- gui_f = {
- particles: gui.addFolder('particles'),
- interactivity: gui.addFolder('interactivity'),
- pagecss: gui.addFolder('page background (css)')
- };
- f = {
- particles: {
- number: gui_f.particles.addFolder('number'),
- color: gui_f.particles.addFolder('color'),
- shape: gui_f.particles.addFolder('shape'),
- size: gui_f.particles.addFolder('size'),
- opacity: gui_f.particles.addFolder('opacity'),
- line_linked: gui_f.particles.addFolder('line_linked'),
- move: gui_f.particles.addFolder('move')
- },
- interactivity: {
- events_onhover: gui_f.interactivity.addFolder('onhover'),
- events_onclick: gui_f.interactivity.addFolder('onclick'),
- modes: gui_f.interactivity.addFolder('modes')
- }
- };
- ff = {
- shape_stroke: f.particles.shape.addFolder('stroke'),
- shape_polygon: f.particles.shape.addFolder('polygon'),
- shape_image: f.particles.shape.addFolder('image'),
- size_anim: f.particles.size.addFolder('anim'),
- opacity_anim: f.particles.opacity.addFolder('anim')
- };
- fm = {
- grab: f.interactivity.modes.addFolder('grab'),
- bubble: f.interactivity.modes.addFolder('bubble'),
- repulse: f.interactivity.modes.addFolder('repulse'),
- push: f.interactivity.modes.addFolder('push'),
- remove: f.interactivity.modes.addFolder('remove')
- };
- fmm = {
- grab_linelinked: fm.grab.addFolder('line_linked')
- };
- gui.add(pJS_GUI, 'retina_detect').name('retina_detect').onChange(function(value) {
- pJS_GUI.retina_detect = value;
- return p.update();
- });
- f.particles.number.add(pJS_GUI.particles.number, 'value', 0, 600).name('value').step(1).onChange(function(value) {
- pJS_GUI.particles.number.value = value;
- return p.update();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement