{"id":16973799,"url":"https://github.com/smartacephale/jabroni-outfit","last_synced_at":"2025-04-12T00:50:17.909Z","repository":{"id":253313107,"uuid":"842958864","full_name":"smartacephale/jabroni-outfit","owner":"smartacephale","description":"out-of-the-box gui and persistent-state library based on vue","archived":false,"fork":false,"pushed_at":"2024-10-08T01:34:38.000Z","size":2274,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T20:33:03.777Z","etag":null,"topics":["cdn","gui","persistent-state","tweaks","vue"],"latest_commit_sha":null,"homepage":"https://smartacephale.github.io/jabroni-outfit/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartacephale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-15T13:29:25.000Z","updated_at":"2024-10-08T01:34:41.000Z","dependencies_parsed_at":"2025-02-20T12:42:19.413Z","dependency_job_id":null,"html_url":"https://github.com/smartacephale/jabroni-outfit","commit_stats":null,"previous_names":["smartacephale/jabroni-outfit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartacephale%2Fjabroni-outfit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartacephale%2Fjabroni-outfit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartacephale%2Fjabroni-outfit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartacephale%2Fjabroni-outfit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartacephale","download_url":"https://codeload.github.com/smartacephale/jabroni-outfit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501902,"owners_count":21114681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdn","gui","persistent-state","tweaks","vue"],"created_at":"2024-10-14T01:03:38.009Z","updated_at":"2025-04-12T00:50:17.889Z","avatar_url":"https://github.com/smartacephale.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eJabroni Outfit\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eout-of-the-box gui and persistent-state library\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\u003ca href=\"https://smartacephale.github.io/jabroni-outfit/\"\u003ehttps://smartacephale.github.io/jabroni-outfit/\u003c/a\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/hCyUJvd.png\" alt=\"Sublime's custom image\"/\u003e\n\u003c/p\u003e\n\n### Introduction\n\nThe `jabroni-outfit` library is a versatile tool for creating user interfaces with persistent state management. It provides a simple and efficient way to define state variables, build UI controls, and automatically update the UI based on state changes.\n\n### Key Features\n\n- **State Management:**\n  - Define state variables with properties like `value`, `persistent`, and `watch`.\n  - Easily manage and update state values throughout your application.\n- **UI Creation:**\n  - Create UI controls (e.g., text inputs, checkboxes) based on state variables.\n  - Automatically update the UI whenever state values change.\n- **Persistence:**\n  - Store state values persistently across application sessions.\n- **Flexibility:**\n  - Customize the UI and state management to fit your specific needs.\n\n### Usage\n\n**1. Import the Library:**\n\n```javascript\nimport { JabroniOutfitStore, JabroniOutfitUI } from 'jabroni-outfit';\n```\nor umd cdn:\n```javascript\n\u003cscript src=\"https://unpkg.com/jabroni-outfit@latest/dist/jabroni-outfit.umd.js\"\u003e\u003c/script\u003e\n...\nconst { JabroniOutfitStore, JabroniOutfitUI } = window.jabronioutfit;\n```\n\n**2. Define State Variables:**\n\nCreate an object containing state variables. Each variable has properties:\n\n- `value`: The current value of the state variable.\n- `persistent`: Boolean indicating if the value should be stored persistently.\n- `watch`: Boolean indicating if the UI should update when the value changes.\n\n```javascript\nconst myState = {\n  gradientColor1: { value: \"red\", persistent: false, watch: true },\n  // ... other state variables\n};\n```\n\n**3. Create a Store:**\n\nInstantiate a `JabroniOutfitStore` object with your state definition.\n\n```javascript\nconst store = new JabroniOutfitStore(myState);\n```\n\n**4. Create UI Controls:**\n\nDefine an object mapping state variables to UI control configurations.\n\n```javascript\nconst uiConfig = {\n  gradientColor1: [{ type: \"text\", model: \"stateLocale.gradientColor1\" }],\n  // ... other UI controls\n};\n```\n\n**5. Create the UI:**\n\nInstantiate a `JabroniOutfitUI` object with the store and UI configuration.\n\n```javascript\nconst ui = new JabroniOutfitUI(store, uiConfig);\n```\n\n**6. Subscribe to reactive data:**\n\nUse the `subscribe` method on the store to trigger updates whenever the state changes.\n\n```javascript\nstore.subscribe(() =\u003e {\n  // ...\n});\n```\n\n### Example\n\n```javascript\nconst {\n      JabroniOutfitStore,\n      JabroniOutfitUI,\n      defaultStateWithDurationAndPrivacy,\n      defaultSchemeWithPrivateFilter\n} = window.jabronioutfit;\n\nconst myState = {\n      gradientColor1: { value: \"red\", persistent: false, watch: true },\n      gradientColor2: { value: \"coral\", persistent: false, watch: true },\n      gradientColor3: { value: \"orange\", persistent: false, watch: true },\n      gradientEnabled: { value: true, persistent: false, watch: true },\n      uiEnabled: { value: true, persistent: true, watch: true }\n}\n\nconst store = new JabroniOutfitStore(myState);\n\nconst ui = new JabroniOutfitUI(store, {\n      gradientColor1: [{ type: \"text\", model: \"stateLocale.gradientColor1\", placeholder: \"color\", labelBefore: \"color1\" }],\n      gradientColor2: [{ type: \"text\", model: \"stateLocale.gradientColor2\", placeholder: \"color\", labelBefore: \"color2\" }],\n      gradientColor3: [{ type: \"text\", model: \"stateLocale.gradientColor3\", placeholder: \"color\", labelBefore: \"color3\" }],\n      gradientEnabled: [{ type: \"checkbox\", model: \"stateLocale.gradientEnabled\", labelBefore: \"gradient enabled\" }],\n});\n\nfunction drawGradient() {\n      const { gradientColor1, gradientColor2, gradientColor3, gradientEnabled } = store.stateLocale;\n      if (!gradientEnabled) { document.body.style.background = 'coral'; return; }\n      document.body.style.background = `radial-gradient(${gradientColor1}, ${gradientColor2}, ${gradientColor3})`;\n}\n\ndrawGradient();\nstore.subscribe(drawGradient);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartacephale%2Fjabroni-outfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartacephale%2Fjabroni-outfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartacephale%2Fjabroni-outfit/lists"}