ocearo-ui 0.1.10 → 0.1.12
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/404.html +1 -1
- package/README.md +30 -9
- package/_next/static/chunks/{0f8af13e.af14efcb2d26c639.js → 0f8af13e.6652bd734d04208b.js} +1 -1
- package/_next/static/chunks/{117-1ad4a6b37bfc6738.js → 117-35a8eb6f9457406b.js} +1 -1
- package/_next/static/chunks/252.d7cc856ebccc7381.js +1 -0
- package/_next/static/chunks/{412.9a891f540865cbd8.js → 412.89dae08d020f4499.js} +1 -1
- package/_next/static/chunks/413.69878f8910eb07d8.js +1 -0
- package/_next/static/chunks/677.f1d160b98bf7d630.js +1 -0
- package/_next/static/chunks/73.8c14d2ab55f3d850.js +1 -0
- package/_next/static/chunks/{746-6aad160476963b55.js → 746-f1a5b23db9004a46.js} +1 -1
- package/_next/static/chunks/870fdd6f.5b9af4fe6d08a9fb.js +1 -0
- package/_next/static/chunks/app/layout-5065440b6db19cf5.js +1 -0
- package/_next/static/chunks/app/page-b9d9f5901e5701ed.js +1 -0
- package/_next/static/chunks/{main-467be1560a4da41c.js → main-8dbe8bddfa3a978c.js} +1 -1
- package/_next/static/chunks/webpack-6800222ed1a234a2.js +1 -0
- package/_next/static/css/c78ab46923ef2f02.css +3 -0
- package/index.html +1 -1
- package/index.txt +3 -3
- package/manifest.json +4 -4
- package/{ocearo-ui-0.1.10.tgz → ocearo-ui-0.1.12.tgz} +0 -0
- package/package.json +1 -1
- package/_next/static/chunks/199.8b338263b2a6aa7d.js +0 -1
- package/_next/static/chunks/252.7d334947f15ddf30.js +0 -1
- package/_next/static/chunks/73.007aee417f54ff9d.js +0 -1
- package/_next/static/chunks/870fdd6f.a18fe21a954fd3ab.js +0 -1
- package/_next/static/chunks/890.5c51beba1d47e5ff.js +0 -1
- package/_next/static/chunks/app/layout-0c6b86ae28776be7.js +0 -1
- package/_next/static/chunks/app/page-e4b029f836d524dc.js +0 -1
- package/_next/static/chunks/webpack-0478fe45d39f1cb5.js +0 -1
- package/_next/static/css/b15803f8682c0ad5.css +0 -3
- package/boats/dufour310/docs/index.json +0 -25
- /package/_next/static/{ED8qlar36uSDUQ_aF23bd → Hr-CngZPYUr2uKuS2yt4x}/_buildManifest.js +0 -0
- /package/_next/static/{ED8qlar36uSDUQ_aF23bd → Hr-CngZPYUr2uKuS2yt4x}/_ssgManifest.js +0 -0
- /package/_next/static/media/{4473ecc91f70f139-s.p.woff → 4473ecc91f70f139-s.woff} +0 -0
- /package/_next/static/media/{463dafcda517f24f-s.p.woff → 463dafcda517f24f-s.woff} +0 -0
- /package/{boats/default/docs → docs}/index.json +0 -0
- /package/{boats/default/docs → docs}/opencpn.pdf +0 -0
- /package/{boats/default/docs → docs}/signalk.pdf +0 -0
package/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><link rel="preconnect" href="/" crossorigin=""/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/><link rel="stylesheet" href="/ocearo-ui/_next/static/css/c78ab46923ef2f02.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/ocearo-ui/_next/static/chunks/webpack-6800222ed1a234a2.js"/><script src="/ocearo-ui/_next/static/chunks/fd9d1056-50d0a3499460e502.js" async=""></script><script src="/ocearo-ui/_next/static/chunks/117-35a8eb6f9457406b.js" async=""></script><script src="/ocearo-ui/_next/static/chunks/main-app-ed02033afba81a43.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><meta name="theme-color" media="(prefers-color-scheme: light)" content="#4bbcd8"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0a2e3d"/><title>Ocearo</title><meta name="description" content="Sailing made smarter"/><link rel="manifest" href="./manifest.json" crossorigin="use-credentials"/><meta name="format-detection" content="telephone=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Ocearo"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="shortcut icon" href="./favicon.ico"/><link rel="icon" href="./favicon.ico" type="image/x-icon"/><link rel="icon" href="./favicon.svg" type="image/svg+xml" sizes="any"/><link rel="icon" href="./favicon-96x96.png" type="image/png" sizes="96x96"/><link rel="apple-touch-icon" href="./apple-touch-icon.png"/><meta name="next-size-adjust"/><script src="/ocearo-ui/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_d559d3 __variable_692ef5 antialiased"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/ocearo-ui/_next/static/chunks/webpack-6800222ed1a234a2.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HC[\"/\",\"\"]\n2:HL[\"/ocearo-ui/_next/static/css/c78ab46923ef2f02.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"3:I[12846,[],\"\"]\n5:I[4707,[],\"\"]\n6:I[36423,[],\"\"]\nc:I[61060,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L3\",null,{\"buildId\":\"Hr-CngZPYUr2uKuS2yt4x\",\"assetPrefix\":\"/ocearo-ui\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L4\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L5\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L6\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/ocearo-ui/_next/static/css/c78ab46923ef2f02.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{}],[\"$\",\"body\",null,{\"className\":\"__variable_d559d3 __variable_692ef5 antialiased\",\"children\":[\"$\",\"$L5\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L6\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"meta\",\"1\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#4bbcd8\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#0a2e3d\"}],[\"$\",\"meta\",\"3\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"4\",{\"children\":\"Ocearo\"}],[\"$\",\"meta\",\"5\",{\"name\":\"description\",\"content\":\"Sailing made smarter\"}],[\"$\",\"link\",\"6\",{\"rel\":\"manifest\",\"href\":\"./manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"7\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"8\",{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"9\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Ocearo\"}],[\"$\",\"meta\",\"10\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"11\",{\"rel\":\"shortcut icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"link\",\"12\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\",\"type\":\"image/x-icon\"}],[\"$\",\"link\",\"13\",{\"rel\":\"icon\",\"href\":\"./favicon.svg\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"link\",\"14\",{\"rel\":\"icon\",\"href\":\"./favicon-96x96.png\",\"type\":\"image/png\",\"sizes\":\"96x96\"}],[\"$\",\"link\",\"15\",{\"rel\":\"apple-touch-icon\",\"href\":\"./apple-touch-icon.png\"}],[\"$\",\"meta\",\"16\",{\"name\":\"next-size-adjust\"}]]\n4:null\n"])</script></body></html>
|
package/README.md
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
[](CONTRIBUTING.md)
|
|
3
3
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
# Ocearo UI
|
|
6
7
|
|
|
8
|
+
|
|
7
9
|
**Sailing Made Smarter**
|
|
8
10
|
|
|
9
11
|
**Ocean Robot** is set to transform sailing with an intuitive and visually engaging user interface (UI) designed for the OpenPlotter boat project. Powered by the **Signal K** platform, Ocean Robot gathers and stores boat data to provide real-time insights.
|
|
@@ -45,18 +47,17 @@ Inspired by Tesla's autopilot UI, this system delivers a futuristic and streamli
|
|
|
45
47
|
|
|
46
48
|

|
|
47
49
|
|
|
48
|
-
### **Man Overboard (MOB) View**
|
|
49
|
-
- Features 3D visualization to pinpoint the location and direction of the person overboard, ensuring precise and timely rescue operations.
|
|
50
|
-
|
|
51
|
-
*Currently in progress.*
|
|
52
|
-
|
|
53
50
|
### **Other Views**
|
|
54
51
|
Additional visuals enhance the system's functionality:
|
|
55
52
|
|
|
56
53
|

|
|
54
|
+

|
|
57
55
|

|
|
58
56
|

|
|
59
57
|

|
|
58
|
+

|
|
59
|
+

|
|
60
|
+

|
|
60
61
|
|
|
61
62
|
---
|
|
62
63
|
|
|
@@ -67,6 +68,9 @@ Ocean Robot's roadmap includes advanced features aimed at enhancing safety and e
|
|
|
67
68
|
- Integration with advanced camera systems (e.g., **see.ai**) to detect floating objects
|
|
68
69
|
- **Future Enhancements**:
|
|
69
70
|
- Camera-based monitoring of sail indicators (*penons*) for optimal sail trim suggestions
|
|
71
|
+
- 3D Bathymetry visualization
|
|
72
|
+
- 3D Laylines visualization
|
|
73
|
+
- 3D Start lines visualization
|
|
70
74
|
|
|
71
75
|
---
|
|
72
76
|
|
|
@@ -76,6 +80,19 @@ Or install it in Signal K using the NPM package: https://www.npmjs.com/package/o
|
|
|
76
80
|
|
|
77
81
|
---
|
|
78
82
|
|
|
83
|
+
## **Contributing**
|
|
84
|
+
|
|
85
|
+
Your support and involvement make Ocearo UI better! Here are some ways you can contribute:
|
|
86
|
+
|
|
87
|
+
* Report bugs: Help me squash issues by letting me know when something isn't working as expected.
|
|
88
|
+
* Suggest features: Share your ideas for new features or improvements your feedback shapes the project!
|
|
89
|
+
* Contribute code: Submit pull requests to add features, fix bugs, or improve documentation.
|
|
90
|
+
* Support the project: Help fund the purchase of webcams, and sensors by buying me a coffee.
|
|
91
|
+
|
|
92
|
+
[](https://www.buymeacoffee.com/laborima)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
79
96
|
## **Development and Deployment**
|
|
80
97
|
|
|
81
98
|
### Building
|
|
@@ -172,6 +189,11 @@ Each tide entry consists of:
|
|
|
172
189
|
- **Height**: Tide height in meters
|
|
173
190
|
- **Coefficient**: If applicable, the coefficient value (otherwise "---")
|
|
174
191
|
|
|
192
|
+
### Setup SSL for PWA
|
|
193
|
+
|
|
194
|
+
For complete documentation on setting up SSL, see:
|
|
195
|
+
|
|
196
|
+
[doc/ssl.md](doc/ssl.md)
|
|
175
197
|
|
|
176
198
|
|
|
177
199
|
### Setup Polar Data
|
|
@@ -193,7 +215,7 @@ Save the downloaded file under:
|
|
|
193
215
|
Create an `index.json` file and place it under:
|
|
194
216
|
|
|
195
217
|
```
|
|
196
|
-
/public/
|
|
218
|
+
/public/docs/index.json
|
|
197
219
|
```
|
|
198
220
|
|
|
199
221
|
#### JSON Format
|
|
@@ -219,11 +241,10 @@ Create an `index.json` file and place it under:
|
|
|
219
241
|
]
|
|
220
242
|
```
|
|
221
243
|
|
|
222
|
-
|
|
223
|
-
|
|
224
244
|
## **Deploying to OpenPlotter**
|
|
225
245
|
|
|
226
|
-
|
|
246
|
+
The recommended way is to use the npm published package.
|
|
247
|
+
If you want to deploy your own build, you can either adapt and run the provided `deploy.sh` script, or use the following manual steps:
|
|
227
248
|
|
|
228
249
|
```bash
|
|
229
250
|
git clone https://github.com/laborima/ocearo-ui.git
|
|
@@ -155,4 +155,4 @@ gl_FragColor.a *= edgeAlpha;
|
|
|
155
155
|
if (edgeAlpha == 0.0) {
|
|
156
156
|
discard;
|
|
157
157
|
}
|
|
158
|
-
`,z=new i.vBJ({color:16777215,side:i.ehD,transparent:!0}),V=new i.yGw,j=new i.Pa4,N=new i.Pa4,H=[],X=new i.Pa4,q="+x+y";function Y(e){return Array.isArray(e)?e[0]:e}let $=()=>{let e=new i.Kj0(new i._12(1,1),z);return $=()=>e,e},Z=()=>{let e=new i.Kj0(new i._12(1,1,32,1),z);return Z=()=>e,e},K={type:"syncstart"},J={type:"synccomplete"},Q=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],ee=Q.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class et extends i.Kj0{constructor(){super(new R,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=8421504,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=q,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(K),C({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);let r=this._queuedSyncs;r&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{r.forEach(e=>e&&e())})),this.dispatchEvent(J),e&&e()})))}onBeforeRender(e,t,r,a,n,i){this.sync(),n.isTroikaTextMaterial&&this._prepareForRender(n)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return function(e){let t=(0,u.B$)(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new i.FM8},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new i.Ltg(0,0,0,0)},uTroikaClipRect:{value:new i.Ltg(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new i.FM8},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new i.Ilk},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new i.Vkp},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:M,vertexTransform:E,fragmentDefs:L,fragmentColorTransform:W,customRewriter({vertexShader:e,fragmentShader:t}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(t)&&(t=t.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(e)||(e=e.replace(u.MW,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:e,fragmentShader:t}}});return t.transparent=!0,t.forceSinglePass=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}(e)}get material(){let e=this._derivedMaterial,t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=z.clone());if(e&&e.isDerivedFrom(t)||(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function r(){t.removeEventListener("dispose",r),e.dispose()})),!this.hasOutline())return e;{let t=e._outlineMtl;return t||((t=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}})).isTextOutlineMaterial=!0,t.depthWrite=!1,t.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),t.dispose()})),[t,e]}}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return Y(this.material).getDepthMaterial()}get customDistanceMaterial(){return Y(this.material).getDistanceMaterial()}_prepareForRender(e){let t=e.isTextOutlineMaterial,r=e.uniforms,a=this.textRenderInfo;if(a){let e,n,i;let{sdfTexture:o,blockBounds:s}=a;r.uTroikaSDFTexture.value=o,r.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),r.uTroikaSDFGlyphSize.value=a.sdfGlyphSize,r.uTroikaSDFExponent.value=a.sdfExponent,r.uTroikaTotalBounds.value.fromArray(s),r.uTroikaUseGlyphColors.value=!t&&!!a.glyphColors;let l=0,u=0,h=0,f=0,d=0;if(t){let{outlineWidth:t,outlineOffsetX:r,outlineOffsetY:a,outlineBlur:n,outlineOpacity:i}=this;l=this._parsePercent(t)||0,u=Math.max(0,this._parsePercent(n)||0),e=i,f=this._parsePercent(r)||0,d=this._parsePercent(a)||0}else(h=Math.max(0,this._parsePercent(this.strokeWidth)||0))&&(i=this.strokeColor,r.uTroikaStrokeColor.value.set(null==i?8421504:i),null==(n=this.strokeOpacity)&&(n=1)),e=this.fillOpacity;r.uTroikaEdgeOffset.value=l,r.uTroikaPositionOffset.value.set(f,d),r.uTroikaBlurRadius.value=u,r.uTroikaStrokeWidth.value=h,r.uTroikaStrokeOpacity.value=n,r.uTroikaFillOpacity.value=null==e?1:e,r.uTroikaCurveRadius.value=this.curveRadius||0;let c=this.clipRect;if(c&&Array.isArray(c)&&4===c.length)r.uTroikaClipRect.value.fromArray(c);else{let e=100*(this.fontSize||.1);r.uTroikaClipRect.value.set(s[0]-e,s[1]-e,s[2]+e,s[3]+e)}this.geometry.applyClipRect(r.uTroikaClipRect.value)}r.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;let n=t?this.outlineColor||0:this.color;if(null==n)delete e.color;else{let t=e.hasOwnProperty("color")?e.color:e.color=new i.Ilk;(n!==t._input||"object"==typeof n)&&t.set(t._input=n)}let o=this.orientation||q;if(o!==e._orientation){let t=r.uTroikaOrient.value,a=(o=o.replace(/[^-+xyz]/g,""))!==q&&o.match(/^([-+])([xyz])([-+])([xyz])$/);if(a){let[,e,r,n,i]=a;j.set(0,0,0)[r]="-"===e?1:-1,N.set(0,0,0)[i]="-"===n?-1:1,V.lookAt(X,j.cross(N),N),t.setFromMatrix4(V)}else t.identity();e._orientation=o}}_parsePercent(e){if("string"==typeof e){let t=e.match(/^(-?[\d.]+)%$/),r=t?parseFloat(t[1]):NaN;e=(isNaN(r)?0:r/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new i.FM8){t.copy(e);let r=this.curveRadius;return r&&(t.x=Math.atan2(e.x,Math.abs(r)-Math.abs(e.z))*Math.abs(r)),t}worldPositionToTextCoords(e,t=new i.FM8){return j.copy(e),this.localPositionToTextCoords(this.worldToLocal(j),t)}raycast(e,t){let{textRenderInfo:r,curveRadius:a}=this;if(r){let n=r.blockBounds,i=a?Z():$(),o=i.geometry,{position:s,uv:l}=o.attributes;for(let e=0;e<l.count;e++){let t=n[0]+l.getX(e)*(n[2]-n[0]),r=n[1]+l.getY(e)*(n[3]-n[1]),i=0;a&&(i=a-Math.cos(t/a)*a,t=Math.sin(t/a)*a),s.setXYZ(e,t,r,i)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,i.matrixWorld=this.matrixWorld,i.material.side=this.material.side,H.length=0,i.raycast(e,H);for(let e=0;e<H.length;e++)H[e].object=this,t.push(H[e])}}copy(e){let t=this.geometry;return super.copy(e),this.geometry=t,ee.forEach(t=>{this[t]=e[t]}),this}clone(){return new this.constructor().copy(this)}}Q.forEach(e=>{let t="_private_"+e;Object.defineProperty(et.prototype,e,{get(){return this[t]},set(e){e!==this[t]&&(this[t]=e,this._needsSync=!0)}})}),new i.ZzF,new i.Ilk,new WeakMap,new WeakMap}}]);
|
|
158
|
+
`,z=new i.vBJ({color:16777215,side:i.ehD,transparent:!0}),V=new i.yGw,j=new i.Pa4,N=new i.Pa4,H=[],X=new i.Pa4,q="+x+y";function Y(e){return Array.isArray(e)?e[0]:e}let $=()=>{let e=new i.Kj0(new i._12(1,1),z);return $=()=>e,e},Z=()=>{let e=new i.Kj0(new i._12(1,1,32,1),z);return Z=()=>e,e},K={type:"syncstart"},J={type:"synccomplete"},Q=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],ee=Q.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class et extends i.Kj0{constructor(){super(new R,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=8421504,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=q,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(K),C({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);let r=this._queuedSyncs;r&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{r.forEach(e=>e&&e())})),this.dispatchEvent(J),e&&e()})))}onBeforeRender(e,t,r,a,n,i){this.sync(),n.isTroikaTextMaterial&&this._prepareForRender(n)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return function(e){let t=(0,u.B$)(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new i.FM8},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new i.Ltg(0,0,0,0)},uTroikaClipRect:{value:new i.Ltg(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new i.FM8},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new i.Ilk},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new i.Vkp},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:M,vertexTransform:E,fragmentDefs:L,fragmentColorTransform:W,customRewriter({vertexShader:e,fragmentShader:t}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(t)&&(t=t.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(e)||(e=e.replace(u.MW,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:e,fragmentShader:t}}});return t.transparent=!0,t.forceSinglePass=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}(e)}get material(){let e=this._derivedMaterial,t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=z.clone());if(e&&e.isDerivedFrom(t)||(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function r(){t.removeEventListener("dispose",r),e.dispose()})),!this.hasOutline())return e;{let t=e._outlineMtl;return t||((t=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}})).isTextOutlineMaterial=!0,t.depthWrite=!1,t.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),t.dispose()})),[t,e]}}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return Y(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return Y(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){let t=e.isTextOutlineMaterial,r=e.uniforms,a=this.textRenderInfo;if(a){let e,n,i;let{sdfTexture:o,blockBounds:s}=a;r.uTroikaSDFTexture.value=o,r.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),r.uTroikaSDFGlyphSize.value=a.sdfGlyphSize,r.uTroikaSDFExponent.value=a.sdfExponent,r.uTroikaTotalBounds.value.fromArray(s),r.uTroikaUseGlyphColors.value=!t&&!!a.glyphColors;let l=0,u=0,h=0,f=0,d=0;if(t){let{outlineWidth:t,outlineOffsetX:r,outlineOffsetY:a,outlineBlur:n,outlineOpacity:i}=this;l=this._parsePercent(t)||0,u=Math.max(0,this._parsePercent(n)||0),e=i,f=this._parsePercent(r)||0,d=this._parsePercent(a)||0}else(h=Math.max(0,this._parsePercent(this.strokeWidth)||0))&&(i=this.strokeColor,r.uTroikaStrokeColor.value.set(null==i?8421504:i),null==(n=this.strokeOpacity)&&(n=1)),e=this.fillOpacity;r.uTroikaEdgeOffset.value=l,r.uTroikaPositionOffset.value.set(f,d),r.uTroikaBlurRadius.value=u,r.uTroikaStrokeWidth.value=h,r.uTroikaStrokeOpacity.value=n,r.uTroikaFillOpacity.value=null==e?1:e,r.uTroikaCurveRadius.value=this.curveRadius||0;let c=this.clipRect;if(c&&Array.isArray(c)&&4===c.length)r.uTroikaClipRect.value.fromArray(c);else{let e=100*(this.fontSize||.1);r.uTroikaClipRect.value.set(s[0]-e,s[1]-e,s[2]+e,s[3]+e)}this.geometry.applyClipRect(r.uTroikaClipRect.value)}r.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;let n=t?this.outlineColor||0:this.color;if(null==n)delete e.color;else{let t=e.hasOwnProperty("color")?e.color:e.color=new i.Ilk;(n!==t._input||"object"==typeof n)&&t.set(t._input=n)}let o=this.orientation||q;if(o!==e._orientation){let t=r.uTroikaOrient.value,a=(o=o.replace(/[^-+xyz]/g,""))!==q&&o.match(/^([-+])([xyz])([-+])([xyz])$/);if(a){let[,e,r,n,i]=a;j.set(0,0,0)[r]="-"===e?1:-1,N.set(0,0,0)[i]="-"===n?-1:1,V.lookAt(X,j.cross(N),N),t.setFromMatrix4(V)}else t.identity();e._orientation=o}}_parsePercent(e){if("string"==typeof e){let t=e.match(/^(-?[\d.]+)%$/),r=t?parseFloat(t[1]):NaN;e=(isNaN(r)?0:r/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new i.FM8){t.copy(e);let r=this.curveRadius;return r&&(t.x=Math.atan2(e.x,Math.abs(r)-Math.abs(e.z))*Math.abs(r)),t}worldPositionToTextCoords(e,t=new i.FM8){return j.copy(e),this.localPositionToTextCoords(this.worldToLocal(j),t)}raycast(e,t){let{textRenderInfo:r,curveRadius:a}=this;if(r){let n=r.blockBounds,i=a?Z():$(),o=i.geometry,{position:s,uv:l}=o.attributes;for(let e=0;e<l.count;e++){let t=n[0]+l.getX(e)*(n[2]-n[0]),r=n[1]+l.getY(e)*(n[3]-n[1]),i=0;a&&(i=a-Math.cos(t/a)*a,t=Math.sin(t/a)*a),s.setXYZ(e,t,r,i)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,i.matrixWorld=this.matrixWorld,i.material.side=this.material.side,H.length=0,i.raycast(e,H);for(let e=0;e<H.length;e++)H[e].object=this,t.push(H[e])}}copy(e){let t=this.geometry;return super.copy(e),this.geometry=t,ee.forEach(t=>{this[t]=e[t]}),this}clone(){return new this.constructor().copy(this)}}Q.forEach(e=>{let t="_private_"+e;Object.defineProperty(et.prototype,e,{get(){return this[t]},set(e){e!==this[t]&&(this[t]=e,this._needsSync=!0)}})}),new i.ZzF,new i.Ilk,new WeakMap,new WeakMap}}]);
|