lexgui 0.1.44 → 0.1.45

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.
package/changelog.md CHANGED
@@ -1,8 +1,27 @@
1
1
  # lexgui.js changelog
2
2
 
3
- ## 0.1.45 (dev)
3
+ ## 0.1.46 (dev)
4
4
 
5
- ## 0.1.44 (master)
5
+
6
+
7
+ ## 0.1.45 (master)
8
+
9
+ Widgets:
10
+ - New Counter Widget added `Panel.addCounter`.
11
+ - Support for colored and sized buttons.
12
+ - Fixed editable Progress Widget.
13
+ - Added 'pattern' and 'required' options to Text Widget.
14
+ - Form Widget now uses entry validation (pattern) before callback.
15
+ - Improved Tags Widget style.
16
+
17
+ Added initial support for creating footers.
18
+ Added `LX.buildTextPattern(options)` for Input validation.
19
+ Allow changing light/dark schemes manually `LX.setTheme`.
20
+ Start support for swap icons (now at `Menubar.addButtons`).
21
+ Started theme customization docs page.
22
+ Added theme-swap button to demo and docs.
23
+
24
+ ## 0.1.44
6
25
 
7
26
  VideoEditor:
8
27
  - Support cropping video area.
package/demo.js CHANGED
@@ -103,20 +103,27 @@ area.addMenubar( m => {
103
103
  {
104
104
  title: "Play",
105
105
  icon: "fa-solid fa-play",
106
- callback: (domEl) => {
107
- console.log("play!");
108
- domEl.classList.toggle('fa-play'), domEl.classList.toggle('fa-stop');
106
+ swap: "fa-solid fa-stop",
107
+ callback: (event, swapValue) => {
108
+ if( swapValue ) console.log("play!");
109
+ else console.log("stop!");
109
110
  }
110
111
  },
111
112
  {
112
113
  title: "Pause",
113
114
  icon: "fa-solid fa-pause",
114
115
  disabled: true,
115
- callback: (domEl) => { console.log("pause!") }
116
+ callback: (event) => { console.log("pause!"); }
116
117
  },
117
118
  {
118
119
  icon: "fa-solid fa-magnifying-glass",
119
- callback: (domEl) => { console.log("glass!") }
120
+ callback: (event) => { console.log("glass!"); }
121
+ },
122
+ {
123
+ title: "Change Theme",
124
+ icon: "fa-solid fa-moon",
125
+ swap: "fa-solid fa-sun",
126
+ callback: (event, swapValue) => { LX.setTheme( swapValue ? "light" : "dark" ) }
120
127
  }
121
128
  ]);
122
129
 
@@ -306,7 +313,6 @@ topTabs.area.addOverlayButtons( [
306
313
  {
307
314
  name: "Move",
308
315
  icon: "fa-solid fa-arrows-up-down-left-right",
309
- img: "https://webglstudio.org/latest/imgs/mini-icon-gizmo.png",
310
316
  callback: (value, event) => console.log(value),
311
317
  selectable: true
312
318
  },
@@ -336,7 +342,8 @@ topTabs.area.addOverlayButtons( [
336
342
  }
337
343
  ], {
338
344
  name: "Button 4",
339
- img: "https://webglstudio.org/latest/imgs/mini-icon-gizmo.png",
345
+ // img: "https://webglstudio.org/latest/imgs/mini-icon-gizmo.png",
346
+ icon: "fa fa-cube",
340
347
  callback: (value, event) => console.log(value)
341
348
  }
342
349
  ], { float: "htc" } );
@@ -354,6 +361,44 @@ fillRightBottomPanel( sideBottomPanelH, 'Horizontal' );
354
361
  bottomTabs.add( "Panel V", sideBottomPanel );
355
362
  bottomTabs.add( "Panel H", sideBottomPanelH );
356
363
 
364
+ const footer = new LX.Footer( {
365
+ parent: bottomPanel.root,
366
+ columns: [
367
+ {
368
+ title: "LexGUI",
369
+ items: [
370
+ { title: "Download", link: "" },
371
+ { title: "Documentation", link: "" },
372
+ { title: "Web demo", link: "" },
373
+ { title: "Source code", link: "" }
374
+ ]
375
+ },
376
+ {
377
+ title: "Projects",
378
+ items: [
379
+ { title: "Animics", link: "" },
380
+ { title: "Performs", link: "" }
381
+ ]
382
+ },
383
+ {
384
+ title: "Other stuff",
385
+ items: [
386
+ { title: "Some section", link: "" },
387
+ { title: "Just filling", link: "" },
388
+ { title: "No more ideas", link: "" },
389
+ ]
390
+ }
391
+ ],
392
+ credits: `2019-${ new Date().getUTCFullYear() } Alex Rodríguez and contributors. Website source code on GitHub.`,
393
+ socials: [
394
+ { title: "Github", link: "", icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6.0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6.0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3.0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1.0-6.2-.3-40.4-.3-61.4.0.0-70 15-84.7-29.8.0.0-11.4-29.1-27.8-36.6.0.0-22.9-15.7 1.6-15.4.0.0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5.0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9.0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4.0 33.7-.3 75.4-.3 83.6.0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6.0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9.0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg>` },
395
+ { title: "BlueSky", link: "", icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M407.8 294.7c-3.3-.4-6.7-.8-10-1.3 3.4.4 6.7.9 10 1.3zM288 227.1C261.9 176.4 190.9 81.9 124.9 35.3 61.6-9.4 37.5-1.7 21.6 5.5 3.3 13.8.0 41.9.0 58.4S9.1 194 15 213.9c19.5 65.7 89.1 87.9 153.2 80.7 3.3-.5 6.6-.9 10-1.4-3.3.5-6.6 1-10 1.4-93.9 14-177.3 48.2-67.9 169.9C220.6 589.1 265.1 437.8 288 361.1c22.9 76.7 49.2 222.5 185.6 103.4 102.4-103.4 28.1-156-65.8-169.9-3.3-.4-6.7-.8-10-1.3 3.4.4 6.7.9 10 1.3 64.1 7.1 133.6-15.1 153.2-80.7C566.9 194 576 75 576 58.4s-3.3-44.7-21.6-52.9c-15.8-7.1-40-14.9-103.2 29.8C385.1 81.9 314.1 176.4 288 227.1z"></path></svg>` },
396
+ { title: "Mastodon", link: "", icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M433 179.1c0-97.2-63.7-125.7-63.7-125.7-62.5-28.7-228.6-28.4-290.5.0.0.0-63.7 28.5-63.7 125.7.0 115.7-6.6 259.4 105.6 289.1 40.5 10.7 75.3 13 103.3 11.4 50.8-2.8 79.3-18.1 79.3-18.1l-1.7-36.9s-36.3 11.4-77.1 10.1c-40.4-1.4-83-4.4-89.6-54a102.5 102.5.0 01-.9-13.9c85.6 20.9 158.7 9.1 178.8 6.7 56.1-6.7 105-41.3 111.2-72.9 9.8-49.8 9-121.5 9-121.5zm-75.1 125.2h-46.6V190.1c0-49.7-64-51.6-64 6.9v62.5H201V197c0-58.5-64-56.6-64-6.9v114.2H90.2c0-122.1-5.2-147.9 18.4-175 25.9-28.9 79.8-30.8 103.8 6.1l11.6 19.5 11.6-19.5c24.1-37.1 78.1-34.8 103.8-6.1 23.7 27.3 18.4 53 18.4 175z"></path></svg>` },
397
+ { title: "Discord", link: "", icon: `<a class="fa-brands fa-discord"></a>` },
398
+ { title: "Reddit", link: "", icon: `<a class="fa-brands fa-reddit"></a>` }
399
+ ]
400
+ } );
401
+
357
402
  function loop(dt) {
358
403
 
359
404
  var ctx = canvas.getContext("2d");
@@ -480,13 +525,20 @@ function fillPanel( panel ) {
480
525
  // add widgets to panel branch
481
526
  panel.branch("Preferences", {icon: "fa-solid fa-gear"});
482
527
  panel.addButton(null, "Show Notifications" + LX.badge("+99", "accent sm"));
483
- panel.addText("Text", "Warning text", null, { warning: true });
528
+ panel.addCounter("Calories Counter ", 350, (v) => { console.log( v + " calories!" ) }, { label: "CALORIES/DAY", max: 500 });
529
+ panel.addButton("Colored Tiny Button", "Click here!", () => {}, { buttonClass: "primary xs" });
530
+ panel.addButton("Colored Small Button", "Click here!", () => {}, { buttonClass: "accent sm" });
531
+ panel.addButton("A Classic Button", "Click here!", () => {}, { buttonClass: "md" });
484
532
  panel.addCheckbox("Check me, Please", false, (value, event) => {
485
533
  console.log(value);
486
534
  }, { className: "secondary" });
487
- panel.addToggle("Toggle me, Please", false, (value, event) => {
535
+ panel.sameLine(2);
536
+ panel.addToggle("Colored Toggle", false, (value, event) => {
488
537
  console.log(value);
489
- }, { className: "accent" });
538
+ }, { className: "accent", nameWidth: "50%" });
539
+ panel.addToggle("Outlined Checkbox ", false, (value, event) => {
540
+ console.log(value);
541
+ }, { className: "secondary outline", nameWidth: "50%" });
490
542
  panel.addFile("I'm a File Input", data => { console.log(data) }, { disabled: true } );
491
543
  panel.addDropdown("Best Engine", ["Godot", "Unity", "Unreal Engine"], "Unity", (value, event) => {
492
544
  console.log(value);
@@ -494,7 +546,6 @@ function fillPanel( panel ) {
494
546
  panel.addDropdown("Best Logo", [{value:"Godot", src: "https://godotengine.org/assets/press/logo_vertical_color_light.png"}, {value: "Unity", src: "https://logos-world.net/wp-content/uploads/2023/01/Unity-Logo.png"}, {value:"Unreal Engine", src: "https://cdn2.unrealengine.com/ue-logo-stacked-unreal-engine-w-677x545-fac11de0943f.png"}], "Godot", (value, event) => {
495
547
  console.log(value);
496
548
  }, {filter: true});
497
-
498
549
  panel.addDropdown("Best Gif", [{value:"Godot", src: "https://i.redd.it/4vepr95bye861.gif"}, {value: "Unity", src: "https://i.gifer.com/origin/db/db3cb258e9bbb78c5851a000742e5468_w200.gif"}, {value:"Unreal Engine", src: "https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/d/e0deb23c10cc7852c6ab91c28083e27f9c8228f8.gif"}], "Godot", (value, event) => {
499
550
  console.log(value);
500
551
  }, {filter: true});
@@ -699,9 +750,11 @@ function fillBottomPanel( panel ) {
699
750
  // add widgets to panel branch
700
751
  panel.branch("Information", {icon: "fa fa-circle-info"});
701
752
  panel.addText("Camera", "Canon EOS 80D", null, {disabled: true});
702
- panel.addText("Serial number", "194E283DD", (value, event) => {
753
+ panel.addText("Text", "Warning text", null, { warning: true });
754
+ const patternOptions = { uppercase: true }
755
+ panel.addText("Text With Validator Pattern", "", (value, event) => {
703
756
  console.log(value);
704
- });
757
+ }, { pattern: LX.buildTextPattern( patternOptions ) });
705
758
  panel.addTextArea("Notes", "", (value, event) => {
706
759
  console.log(value);
707
760
  }, { placeholder: 'Some notes...' });
@@ -728,13 +781,15 @@ function createLoginForm() {
728
781
  Username: {
729
782
  value: "",
730
783
  placeholder: "Enter username",
731
- icon: "fa fa-user"
784
+ icon: "fa fa-user",
785
+ pattern: LX.buildTextPattern( { minLength: 3 } )
732
786
  },
733
787
  Password: {
734
788
  value: "",
735
789
  type: "password",
736
790
  placeholder: "Enter password",
737
- icon: "fa fa-key"
791
+ icon: "fa fa-key",
792
+ pattern: LX.buildTextPattern( { lowercase: true, uppercase: true, digit: true, minLength: 6 } )
738
793
  }
739
794
  };
740
795
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lexgui",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "JS library to create web graphical user interfaces",
5
5
  "type": "module",
6
6
  "main": "./build/lexgui.js",