Git Product home page Git Product logo

object-gui's Introduction

README in: Indonesian README in: German README in: Hebrew README in: Spanish README in: Portuguese

Object GUI - Javascript Object Editor

Object GUI is your fully customizable Javascript Object GUI Editor

Gitpod Ready-to-Code

Usage

You can see a working sample here: https://codepen.io/matteobruni/pen/oNxNvja

Installation

HTML / Vanilla JS

You need to include these files:

CSS

https://cdn.jsdelivr.net/npm/object-gui@2/dist/css/object-gui.css

Javascript

https://cdn.jsdelivr.net/npm/object-gui@2/dist/js/object-gui.min.js

ES 6 Imports

import { Editor } from "object-gui";

CommonJS / Node.js

const Editor = require("object-gui");

Usage

const code = document.getElementById("code");

const data = {
  prop1: "pluto",
  prop2: 3,
  group1: {
    prop1: "paperino",
    prop2: 0.3,
  },
  color1: "#ff0000",
  select1: "Item 2",
  alert: function () {
    alert(JSON.stringify(data, null, 4));
  },
};

const editor = new Editor("sample", "Sample", () => data);

editor.top().right();
editor.theme("light");

const group1 = editor.root.addGroup("group1", "Group 1", true);

group1.addProperty("prop1", "Property 1", "string").change(() => {
  console.log(data);
});

group1
  .addProperty("prop2", "Property 2", "number")
  .min(0)
  .max(1)
  .step(0.01)
  .change(() => {
    console.log(data);
  });

editor.root.addProperty("prop1", "Property 1", "string").change(() => {
  console.log(data);
});

editor.root
  .addProperty("prop2", "Property 2", "number")
  .min(0)
  .max(10)
  .step(0.5)
  .change(() => {
    console.log(data);
  });

editor.root.addProperty("color1", "Color 1", "color").change(() => {
  console.log(data);
});

const select1Input = editor.root.addProperty("select1", "Select 1", "select").change(() => {
  code.innerText = JSON.stringify(data, null, 4);

  console.log(data);
});

select1Input.addItem("Item 1");
select1Input.addItem("Item 2");
select1Input.addItem("Item 3");

editor.root.addButton("alert", "Alert");

code.innerText = JSON.stringify(data, null, 4);

object-gui's People

Contributors

adalbertobrant avatar amauryverschooren avatar arul-ashri avatar bufutda avatar christocarr avatar dependabot[bot] avatar eliely avatar flitzmare avatar glis avatar kant avatar khuirul-huda avatar kligmasn avatar laurenah avatar lovevictoria2020 avatar marcmogdanz avatar martinavukanovic avatar matteobruni avatar miguemartelo avatar nitinnair89 avatar ppastene avatar pranay0302 avatar prathamesh-shanbhag avatar renovate-bot avatar renovate[bot] avatar siddakbagga13 avatar swapnalshahil avatar tijsdebelie avatar tomerpacific avatar tricinel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

object-gui's Issues

README translations

A translated README could help users understand better what this library does and how to use it.

I can contribute to English and Italian, any other language is welcome

Themes

Actually there are some themes but I think they need some improvements in the CSS, mostly the neumorphic ones.

Any new theme is welcome, neumorphic or not

Typo in package.json?

For me it looks like a typo:
In keywords in package.json there is wyiswyg instead of wysiwyg. Looks like this is the case also for tsparticles-editor

Also I see that in package.json license is set to ISC while in repo file LICENSE contains MIT license, is it intended?

Dynamically adding new prop via GUI

Hi @matteobruni

Thanks for sharing an interesting project.

Just wondering if it is possible to update this so that we could add new props on the fly. In the example we have "group1" with 2 props: "prop1" and "prop2". Could we add a plus "+" button to the GUI, so that if you click on that it would allow you to add a "prop3" and a value for that?

Happy to at potentially submitting a PR for such as feature.

Themes

Actually there are some themes but I think they need some improvements in the CSS, mostly the neumorphic ones.

Any new theme is welcome, neumorphic or not

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency rimraf to v5.0.9
  • chore(deps): update dependency prettier to v3.3.3
  • chore(deps): update dependency typescript to v5.5.3
  • chore(deps): update dependency rimraf to v6
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/node.js.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4
npm
package.json
  • @babel/core 7.23.7
  • @typescript-eslint/eslint-plugin 7.5.0
  • @typescript-eslint/parser 7.5.0
  • babel-loader 9.1.3
  • clean-css-cli 5.6.3
  • eslint 8.56.0
  • eslint-config-prettier 9.1.0
  • express 4.19.2
  • fibers 5.0.3
  • helmet 7.1.0
  • prettier 3.2.5
  • pug 3.0.3
  • pug-cli 1.0.0-alpha6
  • rimraf 5.0.7
  • sass 1.74.1
  • sass-loader 14.2.1
  • stylus 0.62.0
  • terser-webpack-plugin 5.3.9
  • typescript 5.4.5
  • webpack 5.89.0
  • webpack-bundle-analyzer 4.10.1
  • webpack-cli 5.1.4

  • Check this box to trigger a request for Renovate to run again on this repository

Themes

Actually there are some themes but I think they need some improvements in the CSS, mostly the neumorphic ones.

Any new theme is welcome, neumorphic or not

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.