lexgui 0.5.2 → 0.5.3

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.
@@ -1,5 +1,6 @@
1
1
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
2
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+
3
4
  <head>
4
5
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
6
  <title>LexGUI Area Tabs Demo</title>
@@ -14,99 +15,101 @@
14
15
  }
15
16
  </script>
16
17
  </head>
17
- <body></body>
18
- <script type="module">
19
-
20
- import { LX } from 'lexgui';
21
18
 
22
- // init library and get main area
23
- let area = LX.init();
24
-
25
- area.root.style.width = "100%";
26
- area.root.style.height = "100%";
27
-
28
- function hide( el ) {
29
- el.style.display = 'none';
30
- }
19
+ <body></body>
20
+ <script type="module">
21
+
22
+ import { LX } from 'lexgui';
23
+
24
+ // init library and get main area
25
+ let area = LX.init();
26
+
27
+ area.root.style.width = "100%";
28
+ area.root.style.height = "100%";
29
+
30
+ function hide(el) {
31
+ el.style.display = 'none';
32
+ }
33
+
34
+ function show(el) {
35
+ el.style.display = 'block';
36
+ }
37
+
38
+ const logParams = (entryName, value, event) => { console.log(entryName, value, event) };
39
+ const actionLogParams = (entryName, event) => { console.log("Action called!", entryName, event) };
40
+
41
+ window.sidebar = area.addSidebar(m => {
42
+ m.group("Projects", { icon: "fa fa-plus", callback: (groupName, event) => { console.log(groupName) } });
43
+ m.add("Getting Started", { icon: "fa fa-cube", callback: logParams });
44
+ m.add("Getting Started/Installation", { icon: "fa fa-cube", callback: logParams });
45
+ m.add("Getting Started/Project Structure", { icon: "fa fa-cube", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } });
46
+ m.add("Building Your Application", { icon: "fa fa-code", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } });
47
+ m.add("Search Blocks", { icon: "fa fa-search", callback: logParams });
48
+ m.add("Very loooooooooooooooooooooooong sun", { icon: "fa fa-sun", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } });
49
+ m.separator();
50
+ m.group("API Reference");
51
+ m.add("Components", { icon: "fa fa-cube", callback: logParams });
52
+ m.add("File Conventions", { icon: "fa fa-code", callback: logParams });
53
+ m.add("Functions", { icon: "fa fa-search", callback: logParams });
54
+ m.add("CLI", { icon: "fa fa-sun", callback: logParams });
55
+ m.separator();
56
+ m.group("Architecture");
57
+ m.add("Accessibility ", { icon: "fa fa-cube", callback: logParams });
58
+ m.add("Fast Refresh", { icon: "fa fa-code", callback: logParams });
59
+ m.add("Supported Browsers", { icon: "fa fa-search", callback: logParams });
60
+ m.separator();
61
+ m.add("Calendar ", { collapsable: 3 });
62
+ m.add("Personal ", { callback: logParams, type: "checkbox" });
63
+ m.add("Work", { callback: logParams, type: "checkbox", value: true });
64
+ m.add("Family", { callback: logParams, type: "checkbox" });
65
+ }, {
66
+ headerTitle: "jxarco",
67
+ headerSubtitle: "alexroco.30@gmail.com",
68
+ headerImage: "https://raw.githubusercontent.com/jxarco/lexgui.js/refs/heads/master/images/icon.png",
69
+ footerTitle: "jxarco",
70
+ footerSubtitle: "alexroco.30@gmail.com",
71
+ footerImage: "https://avatars.githubusercontent.com/u/25059187?s=400&u=ad8907b748c13e4e1a7cdd3882826acb6a2928b5&v=4",
72
+ onHeaderPressed: (e) => { console.log("onHeaderPressed") },
73
+ onFooterPressed: (e) => { console.log("onFooterPressed") }
74
+ });
75
+
76
+ // add canvas to left upper part
77
+ var canvas = document.createElement('canvas');
78
+ canvas.id = "mycanvas";
79
+ canvas.width = area.root.clientWidth;
80
+ canvas.height = area.root.clientHeight;
81
+ canvas.style.width = "100%";
82
+ canvas.style.height = "100%";
83
+
84
+ area = sidebar.siblingArea;
85
+
86
+ area.onresize = (bounding) => {
87
+ canvas.width = bounding.width;
88
+ canvas.height = bounding.height;
89
+ };;
90
+
91
+ area.attach(canvas);
92
+
93
+ function loop(dt) {
94
+
95
+ var ctx = canvas.getContext("2d");
96
+
97
+ ctx.fillStyle = "#b7a9b1";
98
+
99
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
100
+ ctx.font = "44px Monospace";
101
+
102
+ ctx.fillStyle = "#ff1999";
103
+
104
+ const text = "lexgui @jxarco";
105
+ const pos2D = [200, 200];
106
+ ctx.fillText(text, pos2D[0], pos2D[1]);
31
107
 
32
- function show( el ) {
33
- el.style.display = 'block';
34
- }
108
+ requestAnimationFrame(loop);
109
+ }
35
110
 
36
- const logParams = (entryName, value, event) => { console.log(entryName, value, event) };
37
- const actionLogParams = (entryName, event) => { console.log("Action called!", entryName, event) };
38
-
39
- window.sidebar = area.addSidebar( m => {
40
- m.group( "Projects", { icon: "fa fa-plus", callback: (groupName, event) => { console.log(groupName) }} );
41
- m.add( "Getting Started", { icon: "fa fa-cube", callback: logParams } );
42
- m.add( "Getting Started/Installation", { icon: "fa fa-cube", callback: logParams } );
43
- m.add( "Getting Started/Project Structure", { icon: "fa fa-cube", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } } );
44
- m.add( "Building Your Application", { icon: "fa fa-code", callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } } );
45
- m.add( "Search Blocks", { icon: "fa fa-search", callback: logParams } );
46
- m.add( "Very loooooooooooooooooooooooong sun", { icon: "fa fa-sun",callback: logParams, action: { name: "ShowMenu", callback: actionLogParams, icon: null } } );
47
- m.separator();
48
- m.group( "API Reference" );
49
- m.add( "Components", { icon: "fa fa-cube", callback: logParams } );
50
- m.add( "File Conventions", { icon: "fa fa-code", callback: logParams } );
51
- m.add( "Functions", { icon: "fa fa-search",callback: logParams } );
52
- m.add( "CLI", { icon: "fa fa-sun",callback: logParams } );
53
- m.separator();
54
- m.group( "Architecture" );
55
- m.add( "Accessibility ", { icon: "fa fa-cube", callback: logParams } );
56
- m.add( "Fast Refresh", { icon: "fa fa-code", callback: logParams } );
57
- m.add( "Supported Browsers", { icon: "fa fa-search",callback: logParams } );
58
- m.separator();
59
- m.add( "Calendar ", { collapsable: 3 } );
60
- m.add( "Personal ", { callback: logParams, type: "checkbox" } );
61
- m.add( "Work", { callback: logParams, type: "checkbox", value: true } );
62
- m.add( "Family", { callback: logParams, type: "checkbox" } );
63
- }, {
64
- headerTitle: "jxarco",
65
- headerSubtitle: "alexroco.30@gmail.com",
66
- headerImage: "https://raw.githubusercontent.com/jxarco/lexgui.js/refs/heads/master/images/icon.png",
67
- footerTitle: "jxarco",
68
- footerSubtitle: "alexroco.30@gmail.com",
69
- footerImage: "https://avatars.githubusercontent.com/u/25059187?s=400&u=ad8907b748c13e4e1a7cdd3882826acb6a2928b5&v=4",
70
- onHeaderPressed: (e) => { console.log( "onHeaderPressed" ) },
71
- onFooterPressed: (e) => { console.log( "onFooterPressed" ) }
72
- });
73
-
74
- // add canvas to left upper part
75
- var canvas = document.createElement('canvas');
76
- canvas.id = "mycanvas";
77
- canvas.width = area.root.clientWidth;
78
- canvas.height = area.root.clientHeight;
79
- canvas.style.width = "100%";
80
- canvas.style.height = "100%";
81
-
82
- area = sidebar.siblingArea;
83
-
84
- area.onresize = ( bounding ) => {
85
- canvas.width = bounding.width;
86
- canvas.height = bounding.height;
87
- };;
88
-
89
- area.attach( canvas );
90
-
91
- function loop(dt) {
92
-
93
- var ctx = canvas.getContext("2d");
94
-
95
- ctx.fillStyle = "#b7a9b1";
96
-
97
- ctx.fillRect(0, 0, canvas.width, canvas.height);
98
- ctx.font = "44px Monospace";
99
-
100
- ctx.fillStyle = "#ff1999";
101
-
102
- const text = "lexgui @jxarco";
103
- const pos2D = [200, 200];
104
- ctx.fillText(text, pos2D[0], pos2D[1]);
105
-
106
- requestAnimationFrame(loop);
107
- }
111
+ requestAnimationFrame(loop);
108
112
 
109
- requestAnimationFrame(loop);
113
+ </script>
110
114
 
111
- </script>
112
115
  </html>
@@ -54,7 +54,7 @@
54
54
  fillPanel( panel );
55
55
 
56
56
  let activeTimeline = null
57
- createKyeframeTimeline( bottomTabs );
57
+ createKeyframeTimeline( bottomTabs );
58
58
  createClipsTimeline( bottomTabs );
59
59
  createCurvesTimeline( bottomTabs );
60
60
 
@@ -173,7 +173,7 @@
173
173
  panel.merge();
174
174
  }
175
175
 
176
- function createKyeframeTimeline( bottomTabs ) {
176
+ function createKeyframeTimeline( bottomTabs ) {
177
177
 
178
178
  let keyframesPanel = new LX.Panel();
179
179
  bottomTabs.add( "Keyframes", keyframesPanel, {onSelect: () => {
@@ -191,8 +191,8 @@
191
191
  panel.addSelect("Animation", ["Anim 1", "Anim 2", "Anim 3"], "Anim 1", ()=> {})
192
192
  },
193
193
  onAfterCreateTopBar: (panel) => {
194
- panel.addButton("", "autoKeyEnable", null, { icon: 'fa fa-wand-magic-sparkles', name: 'autoKeyEnabled', width: "40px" });
195
- panel.addButton("", "unselectAll", (value, event) => { kfTimeline.unSelectAllKeyFrames();}, { icon: 'fa-regular fa-rectangle-xmark', name: 'unselectAll', callback: (value, event) => { kfTimeline.unSelectAllKeyFrames();}, width: "40px"});
194
+ panel.addButton("autoKeyEnabled", "autoKeyEnable", null, { icon: 'fa fa-wand-magic-sparkles', hideName: true });
195
+ panel.addButton("unselectAll", "unselectAll", (value, event) => { kfTimeline.unSelectAllKeyFrames();}, { icon: 'fa-regular fa-rectangle-xmark', hideName: true, callback: (value, event) => { kfTimeline.unSelectAllKeyFrames();} });
196
196
  }
197
197
  });
198
198
 
@@ -1,5 +1,6 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1
+ <!DOCTYPE html "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
2
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+
3
4
  <head>
4
5
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
6
  <title>LexGUI Video Editor Demo</title>
@@ -14,39 +15,41 @@
14
15
  }
15
16
  </script>
16
17
  </head>
18
+
17
19
  <body></body>
18
- <script type="module">
19
-
20
- import { LX } from 'lexgui';
21
- import { VideoEditor } from 'lexgui/components/videoeditor.js';
22
- // init library and get main area
23
- let area = LX.init();
24
-
25
- // split main area
26
- let [leftArea, rightArea] = area.split({sizes:["75%","25%"], minimizable: true});
27
- area.extend();
28
-
29
- const videoArea = new LX.Area({id:'video-area'});
30
- const video = document.createElement('video');
31
- video.src = "../data/video.mp4";
32
- videoArea.attach(video);
33
-
34
- const videoEditor = new LX.VideoEditor(leftArea, {videoArea, video, crop: true})
35
-
36
- const canvas = document.createElement('canvas');
37
- canvas.width = video.clientWidth;
38
- canvas.height = video.clientHeight;
39
- const ctx = canvas.getContext("2d");
40
- ctx.fillStyle = LX.getThemeColor("global-selected-light");
41
- ctx.font = "40px Arial";
42
- ctx.fillText("I'm a canvas above the video!", canvas.width/2, 100);
43
-
44
- canvas.style.position = "absolute";
45
- canvas.style.left = "0";
46
- videoArea.attach(canvas);
47
-
48
- let panel = new LX.Panel();
49
- panel = rightArea.addPanel(panel);
50
-
51
- </script>
20
+ <script type="module">
21
+
22
+ import { LX } from 'lexgui';
23
+ import { VideoEditor } from 'lexgui/components/videoeditor.js';
24
+ // init library and get main area
25
+ let area = LX.init();
26
+
27
+ // split main area
28
+ let [leftArea, rightArea] = area.split({ sizes: ["75%", "25%"], minimizable: true });
29
+ area.extend();
30
+
31
+ const videoArea = new LX.Area({ id: 'video-area' });
32
+ const video = document.createElement('video');
33
+ video.src = "../data/video.mp4";
34
+ videoArea.attach(video);
35
+
36
+ const videoEditor = new LX.VideoEditor(leftArea, { videoArea, video, crop: true })
37
+
38
+ const canvas = document.createElement('canvas');
39
+ canvas.width = video.clientWidth;
40
+ canvas.height = video.clientHeight;
41
+ const ctx = canvas.getContext("2d");
42
+ ctx.fillStyle = LX.getThemeColor("global-selected-light");
43
+ ctx.font = "40px Arial";
44
+ ctx.fillText("I'm a canvas above the video!", canvas.width / 2, 100);
45
+
46
+ canvas.style.position = "absolute";
47
+ canvas.style.left = "0";
48
+ videoArea.attach(canvas);
49
+
50
+ let panel = new LX.Panel();
51
+ panel = rightArea.addPanel(panel);
52
+
53
+ </script>
54
+
52
55
  </html>
@@ -1,5 +1,6 @@
1
1
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
2
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+
3
4
  <head>
4
5
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
6
  <title>LexGUI Video Editor Demo</title>
@@ -14,105 +15,109 @@
14
15
  }
15
16
  </script>
16
17
  </head>
18
+
17
19
  <body></body>
18
- <script type="module">
19
-
20
- import { LX } from 'lexgui';
21
- import { VideoEditor } from 'lexgui/components/videoeditor.js';
22
-
23
- // Init library and get main area
24
- let area = LX.init();
25
- const menubar = area.addMenubar( m => {
26
- m.setButtonImage("Page", "../data/godot_pixelart.png", null, {float: "left"});
27
- });
28
-
29
- // Split main area
30
- let [leftArea, rightArea] = area.split({sizes:["75%","25%"], minimizable: true});
31
- let [topArea, bottomArea] = leftArea.split({sizes:["90%", null], minimizable: false, resize: false, type: "vertical"});
32
- area.extend();
33
-
34
- /* Create video area with a menubar */
35
- const videoArea = new LX.Area({id:'video-area'});
36
-
37
- /* Add video editor with the video into the area*/
38
- const video = document.createElement('video');
39
- video.src = "../data/video.mp4";
40
- videoArea.attach(video);
41
- const videoEditor = new LX.VideoEditor(topArea, {videoArea, video})
42
-
43
- /* Add canvas above video */
44
- const canvas = document.createElement('canvas');
45
- canvas.width = video.clientWidth;
46
- canvas.height = video.clientHeight;
47
- const ctx = canvas.getContext("2d");
48
- ctx.fillStyle = LX.getThemeColor("global-selected-light");
49
- ctx.font = "40px Arial";
50
- ctx.fillText("I'm a canvas above the video!", canvas.width/2, 100);
51
-
52
- canvas.style.position = "absolute";
53
- canvas.style.left = "0";
54
- videoArea.attach(canvas);
55
- leftArea.onresize = (size) => {
56
-
20
+ <script type="module">
21
+
22
+ import { LX } from 'lexgui';
23
+ import { VideoEditor } from 'lexgui/components/videoeditor.js';
24
+
25
+ // Init library and get main area
26
+ let area = LX.init();
27
+ const menubar = area.addMenubar(m => {
28
+ m.setButtonImage("Page", "../data/godot_pixelart.png", null, { float: "left" });
29
+ });
30
+
31
+ // Split main area
32
+ let [leftArea, rightArea] = area.split({ sizes: ["75%", "25%"], minimizable: true });
33
+ let [topArea, bottomArea] = leftArea.split({ sizes: ["90%", null], minimizable: false, resize: false, type: "vertical" });
34
+ area.extend();
35
+
36
+ /* Create video area with a menubar */
37
+ const videoArea = new LX.Area({ id: 'video-area' });
38
+
39
+ /* Add video editor with the video into the area*/
40
+ const video = document.createElement('video');
41
+ video.src = "../data/video.mp4";
42
+ videoArea.attach(video);
43
+ const videoEditor = new LX.VideoEditor(topArea, { videoArea, video })
44
+
45
+ /* Add canvas above video */
46
+ const canvas = document.createElement('canvas');
47
+ canvas.width = video.clientWidth;
48
+ canvas.height = video.clientHeight;
49
+ const ctx = canvas.getContext("2d");
50
+ ctx.fillStyle = LX.getThemeColor("global-selected-light");
51
+ ctx.font = "40px Arial";
52
+ ctx.fillText("I'm a canvas above the video!", canvas.width / 2, 100);
53
+
54
+ canvas.style.position = "absolute";
55
+ canvas.style.left = "0";
56
+ videoArea.attach(canvas);
57
+ leftArea.onresize = (size) => {
58
+
57
59
  canvas.width = video.clientWidth;
58
60
  canvas.height = video.clientHeight;
59
61
  const ctx = canvas.getContext("2d");
60
62
  ctx.fillStyle = LX.getThemeColor("global-selected-light");
61
63
  ctx.font = "40px Arial";
62
- ctx.fillText("I'm a canvas above the video!", canvas.width/2, 100);
64
+ ctx.fillText("I'm a canvas above the video!", canvas.width / 2, 100);
63
65
  //videoEditor.timebar.resize(size)
64
- }
66
+ }
65
67
 
66
- /* Add show/hide right panel button*/
67
- videoArea.addOverlayButtons([{
68
+ /* Add show/hide right panel button*/
69
+ videoArea.addOverlayButtons([{
68
70
  selectable: true,
69
71
  selected: true,
70
72
  icon: "fa-solid fa-info",
71
73
  name: "Properties",
72
74
  callback: (v, e) => {
73
- if(area.split_extended) {
74
- area.reduce();
75
- }
76
- else {
77
- area.extend();
78
- }
75
+ if (area.split_extended) {
76
+ area.reduce();
77
+ }
78
+ else {
79
+ area.extend();
80
+ }
79
81
  }
80
- }], {float: 'tvr'});
82
+ }], { float: 'tvr' });
81
83
 
82
- let p = bottomArea.addPanel({width: "100%", height: "100%", style: {display: "flex", "flex-direction": "row", "justify-content": "center", "align-content": "flex-start", "flex-wrap": "wrap"}});
83
- p.addButton(null, "Trim", (v) => {
84
+ let p = bottomArea.addPanel({ width: "100%", height: "100%", style: { display: "flex", "flex-direction": "row", "justify-content": "center", "align-content": "flex-start", "flex-wrap": "wrap" } });
85
+ p.addButton(null, "Trim", (v) => {
84
86
  console.log(videoEditor.getTrimedTimes())
85
-
87
+
86
88
  videoArea.sections[1].root.resize(["20%", "20%"])
87
- }, {width: "100px"})
88
- p.addButton(null, null, (v) => {}, {width: "40px", icon: "fa-solid fa-rotate-left"})
89
-
90
- /* Create right panel */
91
- let panel = new LX.Panel({id:"Properties"});
92
- panel = rightArea.addPanel({id:"Properties"});
93
- createBlendShapesInspector({"Name 1": 0, "Name 2": 0, "Name 3": 0.5, "Name 4": 0, "Name 5": 1,},
94
- {inspector: panel});
95
-
96
- /* Functions */
97
- function createBlendShapesInspector(bsNames, options = {}) {
98
-
99
- let inspector = options.inspector || new LX.Panel({id:"blendshapes-inspector"});
100
-
101
- if(options.clear) {
102
- inspector.clear();
89
+ }, { width: "100px" })
90
+ p.addButton(null, null, (v) => { }, { width: "40px", icon: "fa-solid fa-rotate-left" })
91
+
92
+ /* Create right panel */
93
+ let panel = new LX.Panel({ id: "Properties" });
94
+ panel = rightArea.addPanel({ id: "Properties" });
95
+ createBlendShapesInspector({ "Name 1": 0, "Name 2": 0, "Name 3": 0.5, "Name 4": 0, "Name 5": 1, },
96
+ { inspector: panel });
97
+
98
+ /* Functions */
99
+ function createBlendShapesInspector(bsNames, options = {}) {
100
+
101
+ let inspector = options.inspector || new LX.Panel({ id: "blendshapes-inspector" });
102
+
103
+ if (options.clear) {
104
+ inspector.clear();
103
105
  }
104
-
105
- if(inspector.root.id) {
106
- inspector.addTitle(inspector.root.id);
106
+
107
+ if (inspector.root.id) {
108
+ inspector.addTitle(inspector.root.id);
107
109
  }
108
110
 
109
- for(let name in bsNames) {
110
- inspector.addProgress(name, bsNames[name], {min: 0, max: 1, low: 0.3, optimum: 1, high: 0.6, editable: options.editable, showNumber: options.showNumber,
111
- callback: (v,e) => {},
112
- signal: "@on_change_au_" + name});
111
+ for (let name in bsNames) {
112
+ inspector.addProgress(name, bsNames[name], {
113
+ min: 0, max: 1, low: 0.3, optimum: 1, high: 0.6, editable: options.editable, showNumber: options.showNumber,
114
+ callback: (v, e) => { },
115
+ signal: "@on_change_au_" + name
116
+ });
113
117
  }
114
-
118
+
115
119
  return inspector;
116
- }
117
- </script>
120
+ }
121
+ </script>
122
+
118
123
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lexgui",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "JS library to create web graphical user interfaces",
5
5
  "type": "module",
6
6
  "main": "./build/lexgui.js",