Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit 0ec0dec

Browse files
committed
docs: update docs
1 parent aa09c5d commit 0ec0dec

File tree

16 files changed

+30552
-8894
lines changed

16 files changed

+30552
-8894
lines changed

ghpages/docs/ast/source/cLive2DApp.js.json

Lines changed: 6756 additions & 6756 deletions
Large diffs are not rendered by default.

ghpages/docs/ast/source/config/configMgr.js.json

Lines changed: 1820 additions & 881 deletions
Large diffs are not rendered by default.

ghpages/docs/ast/source/config/configValidater.js.json

Lines changed: 763 additions & 763 deletions
Large diffs are not rendered by default.

ghpages/docs/ast/source/elementMgr.js.json

Lines changed: 20568 additions & 0 deletions
Large diffs are not rendered by default.

ghpages/docs/ast/source/index.js.json

Lines changed: 442 additions & 442 deletions
Large diffs are not rendered by default.

ghpages/docs/coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
65
4343
]
4444
},
45-
"src/elementManager.js": {
45+
"src/elementMgr.js": {
4646
"expectCount": 3,
4747
"actualCount": 3,
4848
"undocumentLines": []

ghpages/docs/file/src/cLive2DApp.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
*/
8989

9090
import { config } from './config/configMgr';
91-
import { createElement, currWebGL } from './elementManager';
91+
import { createElement, currWebGL } from './elementMgr';
9292

9393
/**
9494
* Main function of live2d-widget

ghpages/docs/file/src/config/configMgr.js.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@
6868

6969
const defaultConfig = {
7070
model: {
71-
jsonPath: '',
71+
jsonPath: 'https://unpkg.com/[email protected]/assets/shizuku.model.json',
7272
scale: 1,
7373
hHeadPos: 0.5,
7474
vHeadPos: 0.618,
7575
myDefine: [],
7676
},
7777
display: {
7878
antialias: 2,
79-
widght: 150,
79+
width: 150,
8080
height: 300,
8181
position: 'right',
8282
hOffset: 0,
@@ -98,7 +98,7 @@
9898
},
9999
dev: {
100100
log: false,
101-
border: false,
101+
border: (process.env.NODE_ENV === 'development' ? true : false),
102102
mouseLog: false,
103103
mouseFunc: (x, y, ix, iy) => {console.log(`MouseFunc: ${x},${y}; ${ix}, ${iy}`);},
104104
},
@@ -122,6 +122,7 @@
122122
// }
123123

124124
currConfig = _.defaultsDeep(userConfig, defaultConfig);
125+
console.log('currConfig:', currConfig);
125126

126127
}
127128

ghpages/docs/file/src/config/configValidater.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
}),
7272
display: PropTypes.shape({
7373
antialias: PropTypes.number,
74-
widght: PropTypes.number,
74+
width: PropTypes.number,
7575
height: PropTypes.number,
7676
scale: PropTypes.number,
7777
position: PropTypes.oneOf(['left', 'right']),
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<base data-ice="baseUrl" href="../../">
6+
<title data-ice="title">src/elementMgr.js | live2d-widget.js</title>
7+
<link type="text/css" rel="stylesheet" href="css/style.css">
8+
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
9+
<script src="script/prettify/prettify.js"></script>
10+
<script src="script/manual.js"></script>
11+
<meta name="description" content="Add the Sseexxyyy live2d to webpages."><meta property="twitter:card" content="summary"><meta property="twitter:title" content="live2d-widget.js"><meta property="twitter:description" content="Add the Sseexxyyy live2d to webpages."></head>
12+
<body class="layout-container" data-ice="rootContainer">
13+
14+
<header>
15+
<a href="./">Home</a>
16+
17+
<a href="identifiers.html">Reference</a>
18+
<a href="source.html">Source</a>
19+
20+
<div class="search-box">
21+
<span>
22+
<img src="./image/search.png">
23+
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
24+
</span>
25+
<ul class="search-result"></ul>
26+
</div>
27+
<a style="position:relative; top:3px;" href="https://github.com/xiazeyu/live2d-widget.js"><img width="20px" src="./image/github.png"></a></header>
28+
29+
<nav class="navigation" data-ice="nav"><div>
30+
<ul>
31+
32+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-PlatformManager">PlatformManager</a></span></span></li>
33+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-cManager">cManager</a></span></span></li>
34+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-cModel">cModel</a></span></span></li>
35+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-cLive2DApp">cLive2DApp</a></span></span></li>
36+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createElement">createElement</a></span></span></li>
37+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-init">init</a></span></span></li>
38+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getCurrentPath">getCurrentPath</a></span></span></li>
39+
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-currWebGL">currWebGL</a></span></span></li>
40+
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#-utils">_utils</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-ModelSettingJson">ModelSettingJson</a></span></span></li>
41+
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#config">config</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-configApplyer">configApplyer</a></span></span></li>
42+
</ul>
43+
</div>
44+
</nav>
45+
46+
<div class="content" data-ice="content"><h1 data-ice="title">src/elementMgr.js</h1>
47+
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">/**
48+
* @description The container and manager for all the DOM and WebGL emelents.
49+
*/
50+
51+
52+
import { config } from &apos;./config/configMgr&apos;;
53+
import htmlTemplate from &apos;./tmplate/innerHTML&apos;;
54+
55+
/**
56+
* The current WebGL element
57+
* @type {RenderingContext}
58+
*/
59+
60+
let currWebGL = undefined;
61+
62+
/**
63+
* The current canvas element
64+
* @type {HTMLElement}
65+
*/
66+
67+
let currCanvas;
68+
69+
/**
70+
* Create the canvas and styles using DOM
71+
* @return {null}
72+
*/
73+
74+
function createElement(){
75+
76+
let newElem = document.createElement(&apos;div&apos;);
77+
newElem.id = config.name.div;
78+
newElem.innerHTML = htmlTemplate;
79+
let newCanvasElem = document.createElement(&apos;canvas&apos;);
80+
newCanvasElem.setAttribute(&apos;id&apos;, config.name.canvas);
81+
newCanvasElem.setAttribute(&apos;width&apos;, config.display.width * config.display.antialias);
82+
newCanvasElem.setAttribute(&apos;height&apos;, config.display.height * config.display.antialias);
83+
newCanvasElem.style.setProperty(&apos;position&apos;, &apos;fixed&apos;);
84+
newCanvasElem.style.setProperty(&apos;width&apos;, config.display.width);
85+
newCanvasElem.style.setProperty(&apos;height&apos;, config.display.height);
86+
newCanvasElem.style.setProperty(&apos;opacity&apos;, config.react.opacityDefault);
87+
newCanvasElem.style.setProperty(config.display.position, config.display.hOffset + &apos;px&apos;);
88+
newCanvasElem.style.setProperty(&apos;bottom&apos;, config.display.vOffset + &apos;px&apos;);
89+
newCanvasElem.style.setProperty(&apos;z-index&apos;, 99999);
90+
newCanvasElem.style.setProperty(&apos;pointer-events&apos;, &apos;none&apos;);
91+
if(config.dev.border) newCanvasElem.style.setProperty(&apos;border&apos;, &apos;dashed 1px #CCC&apos;);
92+
newElem.appendChild(newCanvasElem);
93+
94+
document.body.appendChild(newElem);
95+
currCanvas = document.getElementById(config.name.canvas);
96+
97+
initWebGL();
98+
99+
}
100+
101+
/**
102+
* Find and set the current WebGL element to the container
103+
* @return {null}
104+
*/
105+
106+
function initWebGL(){
107+
108+
var NAMES = [&apos;webgl2&apos;, &apos;webgl&apos;, &apos;experimental-webgl2&apos;, &apos;experimental-webgl&apos;, &apos;webkit-3d&apos;, &apos;moz-webgl&apos;];
109+
for(let i = 0; i &lt; NAMES.length; i++){
110+
try{
111+
let ctx = currCanvas.getContext(NAMES[i], {
112+
alpha: true,
113+
antialias: true,
114+
premultipliedAlpha: true,
115+
failIfMajorPerformanceCaveat: false,
116+
});
117+
if(ctx) currWebGL = ctx;
118+
}catch(e){}
119+
}
120+
if(!currWebGL){
121+
console.error(&apos;Live2D widgets: Failed to create WebGL context.&apos;);
122+
if(!window.WebGLRenderingContext){
123+
console.error(&apos;Your browser may not support WebGL, check https://get.webgl.org/ for futher information.&apos;);
124+
}
125+
return;
126+
}
127+
};
128+
129+
130+
export{
131+
createElement,
132+
currWebGL,
133+
}
134+
</code></pre>
135+
136+
</div>
137+
138+
<footer class="footer">
139+
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.0.4)</span><img src="./image/esdoc-logo-mini-black.png"></a>
140+
</footer>
141+
142+
<script src="script/search_index.js"></script>
143+
<script src="script/search.js"></script>
144+
<script src="script/pretty-print.js"></script>
145+
<script src="script/inherited-summary.js"></script>
146+
<script src="script/test-summary.js"></script>
147+
<script src="script/inner-link.js"></script>
148+
<script src="script/patch-for-local.js"></script>
149+
</body>
150+
</html>

0 commit comments

Comments
 (0)