jabroni-outfit 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar"]
3
+ }
package/README.md CHANGED
@@ -1,3 +1,45 @@
1
- # Jabroni Outfit
2
- ### out-of-the-box gui and persistent-state library
1
+ <h1 align="center">Jabroni Outfit</h1>
2
+ <h3 align="center">out-of-the-box gui and persistent-state library</h3>
3
+ <p align="center"><a href="https://smartacephale.github.io/jabroni-outfit/">https://smartacephale.github.io/jabroni-outfit/</a></p>
4
+ <p align="center">
5
+ <img src="https://i.imgur.com/hCyUJvd.png" alt="Sublime's custom image"/>
6
+ </p>
3
7
 
8
+ ## How to use
9
+ ```
10
+ <script src="https://unpkg.com/jabroni-outfit@1.3.0/dist/jabroni-outfit.umd.js"></script>
11
+ ```
12
+
13
+ ```
14
+ const {
15
+ JabroniOutfitStore,
16
+ JabroniOutfitUI,
17
+ defaultStateWithDurationAndPrivacy,
18
+ defaultSchemeWithPrivateFilter
19
+ } = window.jabronioutfit;
20
+
21
+ const myState = {
22
+ gradientColor1: { value: "red", persistent: false, watch: true },
23
+ gradientColor2: { value: "coral", persistent: false, watch: true },
24
+ gradientColor3: { value: "orange", persistent: false, watch: true },
25
+ gradientEnabled: { value: true, persistent: false, watch: true },
26
+ uiEnabled: { value: true, persistent: true, watch: true }
27
+ }
28
+ const store = new JabroniOutfitStore(myState);
29
+
30
+ const ui = new JabroniOutfitUI(store, {
31
+ gradientColor1: [{ type: "text", model: "stateLocale.gradientColor1", placeholder: "color", labelBefore: "color1" }],
32
+ gradientColor2: [{ type: "text", model: "stateLocale.gradientColor2", placeholder: "color", labelBefore: "color2" }],
33
+ gradientColor3: [{ type: "text", model: "stateLocale.gradientColor3", placeholder: "color", labelBefore: "color3" }],
34
+ gradientEnabled: [{ type: "checkbox", model: "stateLocale.gradientEnabled", labelBefore: "gradient enabled" }],
35
+ });
36
+
37
+ function drawGradient() {
38
+ const { gradientColor1, gradientColor2, gradientColor3, gradientEnabled } = store.stateLocale;
39
+ if (!gradientEnabled) { document.body.style.background = 'coral'; return; }
40
+ document.body.style.background = `radial-gradient(${gradientColor1}, ${gradientColor2}, ${gradientColor3})`;
41
+ }
42
+
43
+ drawGradient();
44
+ store.subscribe(drawGradient);
45
+ ```