mirror of
https://gitee.com/ice-gl/icegl-three-vue-tres.git
synced 2025-04-05 06:22:43 +08:00
Merge branch 'master' into online
# Conflicts: # .fes.js # package.json
This commit is contained in:
commit
4012797c10
5
.env
5
.env
@ -0,0 +1,5 @@
|
||||
# 自动增加插件里面pages的页面路由
|
||||
FES_APP_PLUGINS=false
|
||||
|
||||
# 自动替换默认目录为插件的preview.vue
|
||||
FES_APP_PREINDEX=false
|
5
.env.predev
Normal file
5
.env.predev
Normal file
@ -0,0 +1,5 @@
|
||||
# 自动增加插件里面pages的页面路由
|
||||
FES_APP_PLUGINS=true
|
||||
|
||||
# 自动替换默认目录为插件的preview.vue
|
||||
FES_APP_PREINDEX=true
|
14
.fes.js
14
.fes.js
@ -4,16 +4,17 @@
|
||||
* @Autor: 地虎降天龙
|
||||
* @Date: 2023-10-16 10:53:09
|
||||
* @LastEditors: 地虎降天龙
|
||||
* @LastEditTime: 2023-11-14 16:47:05
|
||||
* @LastEditTime: 2023-11-16 16:09:31
|
||||
*/
|
||||
// import { resolve } from 'path';
|
||||
import { join } from 'path';
|
||||
import { defineBuildConfig } from '@fesjs/fes';
|
||||
import { defineBuildConfig, someApi, plugin, ApplyPluginsType } from '@fesjs/fes';
|
||||
import { templateCompilerOptions } from '@tresjs/core';
|
||||
import UnoCSS from 'unocss/vite';
|
||||
// import glsl from 'vite-plugin-glsl';
|
||||
|
||||
export default defineBuildConfig({
|
||||
publicPath: './',
|
||||
access: {
|
||||
roles: {
|
||||
admin: ['*'],
|
||||
@ -21,14 +22,7 @@ export default defineBuildConfig({
|
||||
},
|
||||
},
|
||||
layout: {
|
||||
title: 'Icegl',
|
||||
navigation: 'top',
|
||||
multiTabs: false,
|
||||
isFixedHeader: true,
|
||||
// isFixedSidebar: true,
|
||||
// sideWidth: 800,
|
||||
logo: 'logo.png',
|
||||
menus: [],
|
||||
navigation: null,
|
||||
},
|
||||
enums: {
|
||||
status: [
|
||||
|
26
.fes.predev.js
Normal file
26
.fes.predev.js
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Version: 1.668
|
||||
* @Autor: 地虎降天龙
|
||||
* @Date: 2023-10-16 10:53:09
|
||||
* @LastEditors: 地虎降天龙
|
||||
* @LastEditTime: 2023-11-16 15:22:17
|
||||
*/
|
||||
import { defineBuildConfig } from '@fesjs/fes';
|
||||
|
||||
export default defineBuildConfig({
|
||||
layout: {
|
||||
title: 'Icegl',
|
||||
navigation: 'top',
|
||||
multiTabs: false,
|
||||
isFixedHeader: true,
|
||||
logo: 'logo.png',
|
||||
menus: [
|
||||
{
|
||||
name: 'preview',
|
||||
path: '/',
|
||||
title: '开源框架展示'
|
||||
}
|
||||
],
|
||||
},
|
||||
});
|
@ -1,5 +0,0 @@
|
||||
import { defineBuildConfig } from '@fesjs/fes';
|
||||
|
||||
export default defineBuildConfig({
|
||||
publicPath: './',
|
||||
});
|
@ -83,10 +83,15 @@ ThreeJS大名鼎鼎的基于浏览器渲染,JavaScript语言的3D库。
|
||||
|
||||
3、yarn //安装依赖
|
||||
|
||||
4、yarn dev //调试模式
|
||||
4、yarn pre.dev // 预览 下的调试模式
|
||||
|
||||
5、yarn build //编译打包
|
||||
5、yarn dev // 自己项目 下的调试模式
|
||||
|
||||
6、yarn pre.build //预览 下的编译打包
|
||||
|
||||
7、yarn build //自己项目 下的编译打包
|
||||
```
|
||||

|
||||
|
||||
# 📖 文档
|
||||
项目文档正在紧张的编写中...敬请期待!
|
||||
|
7
babel.config.json
Normal file
7
babel.config.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"env": {
|
||||
"development": {
|
||||
"compact": false
|
||||
}
|
||||
}
|
||||
}
|
1
dist/static/buildings-42c9cb95.js
vendored
Normal file
1
dist/static/buildings-42c9cb95.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as b,j as m,az as _,a5 as y,ae as w,Z as u,o as d,s,B as C,I as p,V as g}from"./vendor-524e5929.js";import{_ as f,l as h,a as B,b as x}from"./pagesShow.vue_vue_type_style_index_0_lang-4a631ac6.js";import"./_commonjsHelpers-725317a4.js";const L=b({__name:"buildings",async setup(k){let e,r;const n=m(!1),c=([e,r]=_(()=>h()),e=await e,r(),e);n.value=!0,y(()=>{const l=new w({title:"建筑效果",expanded:!0}),o=l.addFolder({title:"线条"});o.addBinding(i,"show",{label:"显示"}),o.addBinding(i,"color",{label:"颜色"}),o.addBinding(i,"width",{label:"宽度",min:0,max:10,step:1}),o.addBinding(i,"opacity",{label:"透明度",min:0,max:1,step:.1});const t=l.addFolder({title:"建筑物"});t.addBinding(a,"show",{label:"显示"}),t.addBinding(a,"bulidingsColor",{label:"楼宇颜色"}),t.addBinding(a,"gradient",{label:"渐变"}),t.addBinding(a,"opacity",{label:"透明度",min:0,max:1,step:.1}),t.addBinding(a,"landColor",{label:"地面颜色"})});const i=u({width:1,color:"#000",opacity:1,show:!0}),a=u({bulidingsColor:"#e523ff",landColor:"#112233",opacity:.9,show:!0,gradient:!0});return(l,o)=>(d(),s(f,{showBuildings:!1},{ability:C(()=>[a.show&&n.value?(d(),s(B,{key:0,model:p(c),bulidingsColor:a.bulidingsColor,landColor:a.landColor,gradient:a.gradient,opacity:a.opacity},null,8,["model","bulidingsColor","landColor","gradient","opacity"])):g("",!0),i.show&&n.value?(d(),s(x,{key:1,builds:p(c).city,width:i.width,color:i.color,opacity:i.opacity},null,8,["builds","width","color","opacity"])):g("",!0)]),_:1}))}});export{L as default};
|
1
dist/static/cameraControls-a0f420d6.js
vendored
Normal file
1
dist/static/cameraControls-a0f420d6.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as g,Z as x,a2 as u,al as D,am as i,o as k,s as M,B as f,a6 as p,I as h,a7 as C,$ as F,a0 as T,a1 as w,a as y,an as b,U as o}from"./vendor-524e5929.js";const G=o("TresPerspectiveCamera",{position:[5,5,5]},null,-1),S=o("TresGridHelper",{position:[0,-1,0]},null,-1),A=o("TresBoxGeometry",{args:[2,2,2]},null,-1),E=o("TresMeshBasicMaterial",{color:"orange",wireframe:""},null,-1),N=[A,E],P=o("TresAmbientLight",{intensity:1},null,-1),H=g({__name:"cameraControls",setup(U){const m={clearColor:"#82DBC5",shadows:!0,alpha:!1,shadowMapType:F,outputColorSpace:T,toneMapping:w},l=x({distance:5,minDistance:0,maxDistance:100}),e=u(),r=u(),{pane:n}=D(),d=n.addFolder({title:"距离参数"});d.addBinding(l,"distance",{label:"设置距离",step:.01,min:0,max:100}),d.addBinding(l,"minDistance",{label:"最小距离",step:.01,min:0,max:10}),d.addBinding(l,"maxDistance",{label:"最大距离",step:.01,min:0,max:100});const c=n.addFolder({title:"远近"});c.addButton({title:"(+1)"}).on("click",()=>{var t,a;(a=(t=e==null?void 0:e.value)==null?void 0:t.value)==null||a.dolly(1,!0)}),c.addButton({title:"(-1)"}).on("click",()=>{var t,a;(a=(t=e==null?void 0:e.value)==null?void 0:t.value)==null||a.dolly(-1,!0)});const s=n.addFolder({title:"旋转"});s.addButton({title:"Rotate theta 45°"}).on("click",()=>{var t,a;(a=(t=e==null?void 0:e.value)==null?void 0:t.value)==null||a.rotate(45*i.DEG2RAD,0,!0)}),s.addButton({title:"Rotate theta -90°"}).on("click",()=>{var t,a;(a=(t=e==null?void 0:e.value)==null?void 0:t.value)==null||a.rotate(-90*i.DEG2RAD,0,!0)}),s.addButton({title:"Rotate theta 360°"}).on("click",()=>{var t,a;(a=(t=e==null?void 0:e.value)==null?void 0:t.value)==null||a.rotate(360*i.DEG2RAD,0,!0)}),s.addButton({title:"Rotate phi 20°"}).on("click",()=>{var t,a;(a=(t=e==null?void 0:e.value)==null?void 0:t.value)==null||a.rotate(0,20*i.DEG2RAD,!0)}),n.addFolder({title:"移动"}).addButton({title:"对焦到 box of the mesh"}).on("click",()=>{var t,a;(a=(t=e==null?void 0:e.value)==null?void 0:t.value)==null||a.fitToBox(r.value,!0)});function _(){console.log("change")}function B(){console.log("start")}function v(){console.log("end")}return(t,a)=>(k(),M(h(C),p(m,{"window-size":""}),{default:f(()=>[G,y(h(b),p(l,{ref_key:"controlsRef",ref:e,"make-default":"",onChange:_,onStart:B,onEnd:v}),null,16),S,o("TresMesh",{ref_key:"boxMeshRef",ref:r},N,512),P]),_:1},16))}});export{H as default};
|
1
dist/static/digitalBrain-7eab4f3b.js
vendored
Normal file
1
dist/static/digitalBrain-7eab4f3b.js
vendored
Normal file
File diff suppressed because one or more lines are too long
17
dist/static/earthA-f58b8f09.js
vendored
Normal file
17
dist/static/earthA-f58b8f09.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/firstPersonControls-3f5594ce.js
vendored
Normal file
1
dist/static/firstPersonControls-3f5594ce.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as p,o as l,s as c,B as d,a6 as _,I as e,a7 as u,$ as m,a1 as f,a as s,ao as h,ap as g,aq as w,U as a}from"./vendor-524e5929.js";const B=a("TresPerspectiveCamera",{position:[0,3,10]},null,-1),C=a("TresGridHelper",{args:[100,100]},null,-1),T=a("TresAmbientLight",{intensity:1},null,-1),M=p({__name:"firstPersonControls",setup(b){const n={clearColor:"#82DBC5",shadows:!0,alpha:!1,shadowMapType:m,toneMapping:f},r=o=>console.log(o);return(o,t)=>(l(),c(e(u),_(n,{"window-size":""}),{default:d(()=>[s(e(h)),B,s(e(g),{"make-default":"",onIsLock:t[0]||(t[0]=i=>r(i))}),s(e(w),{"head-bobbing":""}),C,T]),_:1},16))}});export{M as default};
|
1
dist/static/glassMaterial-033bbc60.js
vendored
Normal file
1
dist/static/glassMaterial-033bbc60.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as _,j as u,a2 as r,w as d,o as h,s as f,B as n,a6 as M,I as s,a7 as g,$ as m,a0 as T,a1 as x,U as e,a,aD as i,as as w,ax as y,aE as B,aa as C}from"./vendor-524e5929.js";const R=e("TresPerspectiveCamera",{position:[3,3,3]},null,-1),k={"position-x":3},v=e("TresTorusKnotGeometry",{args:[1,.4,256,20]},null,-1),G={position:[0,0,-1]},S=e("TresPlaneGeometry",{args:[3,3]},null,-1),b=["side"],D=e("TresGridHelper",{args:[10,10]},null,-1),P=e("TresAmbientLight",{intensity:1},null,-1),N=e("TresDirectionalLight",{intensity:1,position:[2,2,2]},null,-1),V=_({__name:"glassMaterial",setup(z){const c={clearColor:"#82DBC5",shadows:!0,alpha:!1,shadowMapType:m,outputColorSpace:T,toneMapping:x},p=u(),t=r(),o=r();return d(t,l=>{o.value.value.material.dispose(),o.value.value.material=l.MeshGlassMaterialClass}),(l,I)=>(h(),f(s(g),M(c,{ref_key:"context",ref:p,"window-size":""}),{default:n(()=>[R,e("TresMesh",k,[v,a(s(i),{ref_key:"glassMaterialRef",ref:t},null,512)]),a(s(w),{scale:.5},{default:n(()=>[a(s(i))]),_:1}),a(s(y),{ref_key:"boxRef",ref:o,"position-x":-3},null,512),e("TresMesh",G,[S,e("TresMeshBasicMaterial",{side:s(B),color:16716049},null,8,b)]),D,P,N,a(s(C))]),_:1},16))}});export{V as default};
|
1
dist/static/heatmap-21ea4fd4.js
vendored
Normal file
1
dist/static/heatmap-21ea4fd4.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as n,Z as o,ae as s,o as i,c as r,a as e,B as m,C as p,a6 as l}from"./vendor-524e5929.js";import{_}from"./heatmapJS.vue_vue_type_script_setup_true_lang-eb9daff6.js";import{_ as c}from"./loading.vue_vue_type_script_setup_true_lang-fa08807f.js";import{_ as d}from"./pagesShow.vue_vue_type_style_index_0_lang-4a631ac6.js";import"./heatmap-d02141de.js";import"./_commonjsHelpers-725317a4.js";const v=n({__name:"heatmap",setup(f){const a=o({show2dCanvas:!0,heightRatio:20,position:[0,20,0],Plane:[1e3,1e3,1e3,1e3]}),t=new s({title:"参数",expanded:!0});return t.addBinding(a,"show2dCanvas",{label:"显示二维图"}),t.addBinding(a,"heightRatio",{label:"高度",min:10,max:100,step:10}),(h,u)=>(i(),r(p,null,[e(c),e(d,null,{ability:m(()=>[e(_,l({ref:"heatmapJSRef"},a),null,16)]),_:1})],64))}});export{v as default};
|
1
dist/static/heatmap2-d61c5581.js
vendored
Normal file
1
dist/static/heatmap2-d61c5581.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{aG as _,Y as y,aH as x,a4 as g,o as b,c as w,aE as B,j as C,az as A,Z as d,ae as M,s as S,B as U,a as h,a6 as v,I as f}from"./vendor-524e5929.js";import{C as D,_ as L,l as P,b as T}from"./pagesShow.vue_vue_type_style_index_0_lang-4a631ac6.js";import{h as X}from"./heatmap-d02141de.js";import"./_commonjsHelpers-725317a4.js";const p=(a,t)=>Math.round((Math.random()*(a-t+1)+t)*10)/10,Y=(a,t)=>{if(!t){let e=0;for(t=[];e<2e3;)t.push({x:p(1,a._config.width),y:p(1,a._config.height),value:p(1,6)}),e++}a.setData({max:12,data:t})},E=(a=250,t=250,o=!0)=>{const e=document.createElement("heatmap-canvas");return e.style.position="absolute",o||(e.style.display="none"),e.style.top="0",e.style.left="0",document.body.appendChild(e),X.create({container:e,width:a,height:t,blur:".8",radius:10})},F=a=>{a.computeBoundingBox();const{max:t,min:o}=a.boundingBox;a.deleteAttribute("uv");const e=t.x-o.x,n=t.y-o.y,i=[];for(let r=0;r<a.attributes.position.count;r++)i.push((a.attributes.position.getX(r)-o.x)/e),i.push((a.attributes.position.getY(r)-o.y)/n);const s=new Float32Array(i);a.setAttribute("uv",new _(s,2))},k=(a,t)=>{t.computeBoundingBox(),t.deleteAttribute("uv"),a.computeBoundingBox();const{max:o,min:e}=a.boundingBox,n=o.x-e.x,i=o.y-e.y,s=[];for(let c=0;c<t.attributes.position.count;c++)s.push((t.attributes.position.getX(c)-e.x)/n),s.push((t.attributes.position.getY(c)-e.y)/i);const r=new Float32Array(s);t.setAttribute("uv",new _(r,2))},N=["object"],O=y({__name:"buildingsHeatmap",props:{model:{},opacity:{default:1}},setup(a){const t=a,o=E();Y(o);const e=new x(o._renderer.canvas);e.needsUpdate=!0;const n=(u,l)=>new D({baseMaterial:u,vertexShader:"\n varying vec2 vUv;\n void main() {\n csm_Position = position * vec3(1.0);\n vUv = uv;\n }\n ",fragmentShader:"\n uniform sampler2D heightMap;\n uniform float uOpacity;\n varying vec2 vUv;\n void main() {\n csm_DiffuseColor = vec4(texture2D(heightMap, vUv.xy).rgb, uOpacity);\n }\n ",silent:!0,uniforms:{uOpacity:{value:t.opacity},heightMap:{type:"t",value:l}},depthWrite:!0,depthTest:!0,transparent:!0,side:B}),i=t.model.city,s=t.model.land,r=()=>{const{geometry:u}=s;F(u);const l=n(s.material,e);s.material.dispose(),s.material=l},c=()=>{const u=s.geometry,{geometry:l}=i;k(u,l);const m=n(i.material,e);i.material.dispose(),i.material=m};return r(),c(),g(()=>{t.opacity&&(s.material.uniforms.uOpacity.value=t.opacity)}),(u,l)=>(b(),w("primitive",{object:t.model.model.clone()},null,8,N))}}),$=y({__name:"heatmap2",async setup(a){let t,o;const e=C(!1),n=([t,o]=A(()=>P()),t=await t,o(),t);e.value=!0;const i=d({width:1,color:"#000",opacity:1,show:!0}),s=d({opacity:.9});return new M({title:"参数",expanded:!0}).addBinding(s,"opacity",{label:"透明度",min:0,max:1,step:.1}),(c,u)=>(b(),S(L,{showBuildings:!1},{ability:U(()=>[h(O,v({model:f(n)},s),null,16,["model"]),h(T,v(i,{builds:f(n).city}),null,16,["builds"])]),_:1}))}});export{$ as default};
|
1
dist/static/heatmapExample-3096137e.js
vendored
Normal file
1
dist/static/heatmapExample-3096137e.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as c,j as f,a3 as u,Z as d,ae as h,o as _,s as m,B as g,a6 as r,I as i,a7 as C,a0 as w,b5 as S,a as l,aa as v,U as a}from"./vendor-524e5929.js";import{_ as x}from"./heatmapJS.vue_vue_type_script_setup_true_lang-eb9daff6.js";import"./heatmap-d02141de.js";import"./_commonjsHelpers-725317a4.js";const y=a("TresPerspectiveCamera",{position:[21,34,55],fov:60,near:1,far:1e3},null,-1),B=a("TresAmbientLight",{color:"#cccccc",intensity:.4},null,-1),R=a("TresPointLight",{color:"#ffffff",intensity:.8},null,-1),L=a("TresGridHelper",{args:[50,25],position:[0,0,0]},null,-1),J=c({__name:"heatmapExample",setup(P){const p={clearColor:"#030311",shadows:!0,alpha:!1,outputColorSpace:w,shadowMapType:S,useLegacyLights:!0,antialias:!0},t=f();let e=!0;u().onLoop(({elapsed:s})=>{!e&&parseInt(s)%2==1&&(e=!0,t.value&&t.value.setData()),e&&parseInt(s)%2==0&&(e=!1)});const o=d({show2dCanvas:!0,heightRatio:6}),n=new h({title:"参数",expanded:!0});return n.addBinding(o,"show2dCanvas",{label:"显示二维图"}),n.addBinding(o,"heightRatio",{label:"高度",min:1,max:10,step:1}),(s,T)=>(_(),m(i(C),r(p,{"window-size":""}),{default:g(()=>[y,l(i(v),{autoRotate:!0,autoRotateSpeed:2}),B,R,L,l(x,r({ref_key:"heatmapJSRef",ref:t},o),null,16)]),_:1},16))}});export{J as default};
|
1
dist/static/heatmapJS.vue_vue_type_script_setup_true_lang-eb9daff6.js
vendored
Normal file
1
dist/static/heatmapJS.vue_vue_type_script_setup_true_lang-eb9daff6.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as d,aH as m,aE as g,a4 as f,o as y,c as x,U as u,a8 as _,a9 as M}from"./vendor-524e5929.js";import{h as R}from"./heatmap-d02141de.js";const w=["position"],b=["args","rotate-x"],C=d({__name:"heatmapJS",props:{position:{default:[0,0,0]},Plane:{default:[50,50,1e3,1e3]},show2dCanvas:{type:Boolean,default:!0},heightRatio:{default:6}},setup(p,{expose:c}){const a=p;let i=null;const s=(t,o)=>Math.round((Math.random()*(t-o+1)+o)*10)/10;let e=null;const v=()=>(e=document.createElement("heatmap-canvas"),e.width=100,e.height=100,e.style.position="absolute",e.style.top="0",e.style.left="0",document.body.appendChild(e),i=R.create({container:e,width:256,height:256,blur:".8",radius:10}),i),r=t=>{if(!t){let h=0;for(t=[];h<2e3;)t.push({x:s(1,256),y:s(1,256),value:s(1,6)}),h++}i.setData({max:12,data:t}),n.needsUpdate=!0},n=new m(v()._renderer.canvas);r();const l={transparent:!0,side:g,vertexShader:"\n uniform sampler2D heightMap;\n uniform float heightRatio;\n varying vec2 vUv;\n varying float hValue;\n varying vec3 cl;\n void main() {\n vUv = uv;\n vec3 pos = position;\n cl = texture2D(heightMap, vUv).rgb;\n hValue = texture2D(heightMap, vUv).r;\n pos.y = hValue * heightRatio;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos,1.0);\n }",fragmentShader:"\n varying float hValue;\n varying vec3 cl;\n void main() {\n float v = abs(hValue - 1.);\n gl_FragColor = vec4(cl, .8 - v * v*1.1) ; \n }",uniforms:{heightMap:{type:"t",value:n},heightRatio:{value:a.heightRatio}}};return f(()=>{e.style.display="".concat(a.show2dCanvas?"block":"none"),a.heightRatio&&(l.uniforms.heightRatio.value=a.heightRatio)}),c({setData:r}),(t,o)=>(y(),x("TresMesh",{position:a.position},[u("TresPlaneGeometry",{args:a.Plane,"rotate-x":-Math.PI*.5},null,8,b),u("TresShaderMaterial",_(M(l)),null,16)],8,w))}});export{C as _};
|
1
dist/static/htmls-504b84e1.js
vendored
Normal file
1
dist/static/htmls-504b84e1.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as u,j as c,Z as h,o as f,s as m,B as a,a6 as r,I as o,a7 as T,$ as M,a0 as x,a1 as w,a as l,aa as y,U as e,af as p,at as B,au as S,_ as g}from"./vendor-524e5929.js";const s=t=>(B("data-v-f4d85785"),t=t(),S(),t),v=s(()=>e("TresPerspectiveCamera",{position:[3,0,8]},null,-1)),C={position:[1,1,1]},I=s(()=>e("TresBoxGeometry",null,null,-1)),N=s(()=>e("TresMeshNormalMaterial",null,null,-1)),R=s(()=>e("h1",{class:"bg-white text-xs p-0.5 rounded"}," I'm a Box 📦 ",-1)),k=s(()=>e("TresSphereGeometry",null,null,-1)),G=s(()=>e("TresMeshNormalMaterial",null,null,-1)),b=s(()=>e("h1",{class:"bg-white text-xs p-0.5 rounded"}," I'm a Sphere ⭕️ ",-1)),P=s(()=>e("TresTorusGeometry",null,null,-1)),V=s(()=>e("TresMeshNormalMaterial",null,null,-1)),j=[P,V],z=s(()=>e("TresAmbientLight",{intensity:1},null,-1)),A=u({__name:"htmls",setup(t){const i={clearColor:"#82DBC5",shadows:!0,alpha:!1,shadowMapType:M,outputColorSpace:x,toneMapping:w},n=c(null),d=c(null),_=h({wrapperClass:"wrapper",as:"div",center:!0});return(D,L)=>(f(),m(o(T),r(i,{"window-size":""}),{default:a(()=>[v,l(o(y)),e("TresMesh",C,[I,N,l(o(p),r(_,{transform:"",occlude:[n.value]}),{default:a(()=>[R]),_:1},16,["occlude"])]),e("TresMesh",{ref_key:"sphereRef",ref:n,position:[4,1,1]},[k,G,l(o(p),r(_,{transform:""}),{default:a(()=>[b]),_:1},16)],512),e("TresMesh",{ref_key:"torusRef",ref:d,position:[7,1,1]},j,512),z]),_:1},16))}});const Y=g(A,[["__scopeId","data-v-f4d85785"]]);export{Y as default};
|
1
dist/static/index-e385109a.js
vendored
Normal file
1
dist/static/index-e385109a.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/index-e43837b0.css
vendored
Normal file
1
dist/static/index-e43837b0.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/loading.vue_vue_type_script_setup_true_lang-fa08807f.js
vendored
Normal file
1
dist/static/loading.vue_vue_type_script_setup_true_lang-fa08807f.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as r,az as l,w as _,o as d,s as p,B as u,b6 as y,b7 as h,G as f,H as w,I as a,U as i,E as v,t as x,a as g,b8 as m}from"./vendor-524e5929.js";const b={style:{"background-color":"black"},class:"absolute bg-grey-600 t-0 l-0 w-full h-full z-20 flex justify-center items-center text-black font-mono"},k={class:"w-200px text-white"},N=r({__name:"loading",async setup(B){let t,e;const{hasFinishLoading:c,progress:s}=([t,e]=l(()=>h()),t=await t,e(),t);return _(()=>s.value,async(o,n)=>{console.log(o,n)}),(o,n)=>(d(),p(y,{name:"fade-overlay","enter-active-class":"opacity-1 transition-opacity duration-100","leave-active-class":"opacity-0 transition-opacity duration-200"},{default:u(()=>[f(i("div",b,[i("div",k,[v(" 载入中... "+x(a(s))+" % ",1),g(a(m),{class:"text-yellow"})])],512),[[w,!a(c)]])]),_:1}))}});export{N as _};
|
1
dist/static/loadingA-56a7cea5.js
vendored
Normal file
1
dist/static/loadingA-56a7cea5.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/lowpolyPlanet-1865d4b6.js
vendored
Normal file
1
dist/static/lowpolyPlanet-1865d4b6.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as M,az as S,aA as b,a3 as y,w as P,o as _,c as f,I as p,a2 as v,U as w,a as u,C as x,D as L,B as z,a6 as B,a7 as k,a0 as $,b5 as j,aa as A,s as W,aC as F,av as I}from"./vendor-524e5929.js";import{_ as T}from"./loading.vue_vue_type_script_setup_true_lang-fa08807f.js";const N=["object"],R=.2,D=M({__name:"airplane",props:{planet:{}},async setup(h){let e,i;const n=h,{scene:a}=([e,i]=S(()=>b("./plugins/earthSample/model/lowpolyPlanet/airplane.gltf")),e=await e,i(),e),t=a;t.rotation.set(0,Math.PI,0),a.traverse(s=>{s.isMesh&&(s.castShadow=!0)}),t.updateMatrixWorld();const{onLoop:c}=y();P(()=>n.planet,s=>{var d;if(!s)return;s.geometry.computeBoundingSphere();const r=Math.abs(((d=s.geometry.boundingSphere)==null?void 0:d.radius)|1);t.position.set(r,0,0),t.lookAt(s.position)});let o=0;return c(({delta:s})=>{if(!t||!n.planet)return;const r=Math.abs(n.planet.geometry.boundingSphere.radius)+.5;o+=s*R;const d=r*Math.cos(o),l=r*Math.sin(o);t.position.x=d,t.position.z=l,t.rotation.z=-Math.PI/2,t.rotation.y=-o,t.updateMatrixWorld()}),(s,r)=>(_(),f("primitive",{object:p(t)},null,8,N))}}),E=["object"],Q=M({__name:"cloud",props:{planet:{}},async setup(h){let e,i;const n=h,{scene:a}=([e,i]=S(()=>b("./plugins/earthSample/model/lowpolyPlanet/cloud.gltf")),e=await e,i(),e);v();const t=a.children[0];t.castShadow=!0;function c(l,m){const g=Math.random()*(m-l)+l;return Math.random()<.5?-g:g}t.position.set(c(-8,8),c(.5,1),c(-8,8));const o=c(.5,1);t.scale.set(o,o,o),t.updateMatrixWorld(),P(()=>n.planet,l=>{l&&(t.lookAt(l.position),t.updateMatrixWorld())});const{onLoop:s}=y();let r=c(-1,1)*Math.PI;const d=Math.random()/10;return s(({delta:l})=>{if(!t)return;const m=Math.abs(n.planet.geometry.boundingSphere.radius-.5);r+=l*d;const g=m*Math.cos(r),C=m*Math.sin(r);t.position.x=g,t.position.z=C,t.rotation.y=-r,t.lookAt(n.planet.position),t.updateMatrixWorld()}),(l,m)=>(_(),f("primitive",{object:p(a),"cast-shadow":""},null,8,E))}}),V=["object"],G=M({__name:"planet",async setup(h){let e,i;const{nodes:n}=([e,i]=S(()=>b("./plugins/earthSample/model/lowpolyPlanet/planet.gltf")),e=await e,i(),e),a=n.Planet,t=n.Icosphere;a.traverse(o=>{o.isMesh&&(o.receiveShadow=!0)});const{onLoop:c}=y();return c(({delta:o})=>{a&&(a.rotation.y+=o*.04,a.rotation.z+=o*.02,a.rotation.x+=o*.05,a.updateMatrixWorld())}),(o,s)=>(_(),f(x,null,[w("primitive",{object:p(a)},null,8,V),u(D,{planet:p(t)},null,8,["planet"]),(_(),f(x,null,L([1,2,3,4,5,6,7,8,9],r=>u(Q,{key:r,planet:p(t)},null,8,["planet"])),64))],64))}}),U=w("TresPerspectiveCamera",{position:[0,1,5],fov:75,near:.1,far:1e3},null,-1),Y=w("TresAmbientLight",{color:"#484068",intensity:1},null,-1),q=w("TresPointLight",{color:"#1BFFEF",position:[0,0,-8],intensity:80,"cast-shadow":""},null,-1),H=w("TresDirectionalLight",{position:[0,2,4],intensity:3,"cast-shadow":"","shadow-mapSize-width":2048,"shadow-mapSize-height":2048},null,-1),O=M({__name:"lowpolyPlanet",setup(h){const e={clearColor:"#11101B",shadows:!0,alpha:!1,outputColorSpace:$,shadowMapType:j,useLegacyLights:!0},i=v(0);return y().onLoop(({delta:n})=>{i.value+=.02*n}),(n,a)=>(_(),f(x,null,[u(T),u(p(k),B(e,{"window-size":""}),{default:z(()=>[U,u(p(A)),Y,(_(),W(F,null,{default:z(()=>[u(G)]),_:1})),u(p(I),{rotation:[0,i.value,0],radius:50,depth:50,count:5e3,size:.3,"size-attenuation":!0},null,8,["rotation"]),q,H]),_:1},16)],64))}});export{O as default};
|
1
dist/static/mapControls-6fb66200.js
vendored
Normal file
1
dist/static/mapControls-6fb66200.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as r,o as n,s as l,B as s,a6 as p,I as a,a7 as i,a0 as c,a1 as _,a as o,ar as u,as as d,U as e}from"./vendor-524e5929.js";const m=e("TresPerspectiveCamera",{position:[3,3,3]},null,-1),h=e("TresMeshNormalMaterial",null,null,-1),f=e("TresGridHelper",{args:[10,10]},null,-1),C=e("TresAmbientLight",{intensity:1},null,-1),N=r({__name:"mapControls",setup(g){const t={clearColor:"#82DBC5",alpha:!1,outputColorSpace:c,toneMapping:_};return(B,T)=>(n(),l(a(i),p(t,{"window-size":""}),{default:s(()=>[m,o(a(u)),o(a(d),{scale:.5},{default:s(()=>[h]),_:1}),f,C]),_:1},16))}});export{N as default};
|
1
dist/static/menuA-3d30ef29.js
vendored
Normal file
1
dist/static/menuA-3d30ef29.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/orbitControls-77805bd5.js
vendored
Normal file
1
dist/static/orbitControls-77805bd5.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as b,Z as h,al as x,r as B,o as _,c as P,a as o,B as A,a6 as s,I as m,a7 as M,C as f,$ as C,a0 as S,a1 as F,aa as I,U as i}from"./vendor-524e5929.js";const z=i("TresPerspectiveCamera",{position:[3,3,3]},null,-1),Z=i("TresGridHelper",null,null,-1),D=i("TresAmbientLight",{intensity:1},null,-1),L=b({__name:"orbitControls",setup(T){const r={clearColor:"#82DBC5",shadows:!0,alpha:!1,shadowMapType:C,outputColorSpace:S,toneMapping:F},a=h({enableDamping:!0,dampingFactor:.05,enableZoom:!0,autoRotate:!1,autoRotateSpeed:2,maxPolarAngle:Math.PI,minPolarAngle:0,maxAzimuthAngle:Math.PI,minAzimuthAngle:-Math.PI,enablePan:!0,maxDistance:100,minDistance:0,minZoom:0,maxZoom:100,zoomSpeed:1,enableRotate:!0,rotateSpeed:1}),{pane:e}=x();e.addBinding(a,"enableDamping",{label:"启用阻尼"}),e.addBinding(a,"dampingFactor",{label:"阻尼系数",step:.01,min:0,max:1}),e.addBinding(a,"enableZoom",{label:"启用缩放"}),e.addBinding(a,"enablePan",{label:"启用移动"});const l=e.addFolder({title:"旋转"});l.addBinding(a,"autoRotate",{label:"自动旋转"}),l.addBinding(a,"autoRotateSpeed",{label:"自动旋转速度",step:.01,min:0,max:Math.PI});const n=e.addFolder({title:"角度"});n.addBinding(a,"maxPolarAngle",{label:"max极角",step:.01,min:0,max:Math.PI}),n.addBinding(a,"minPolarAngle",{label:"min极角",step:.01,min:0,max:Math.PI}),n.addBinding(a,"maxAzimuthAngle",{label:"max方位角",step:.01,min:0,max:2*Math.PI}),n.addBinding(a,"minAzimuthAngle",{label:"min方位角",step:.01,min:0,max:2*Math.PI});const d=e.addFolder({title:"距离"});d.addBinding(a,"maxDistance",{label:"最大距离",step:.01,min:0,max:100}),d.addBinding(a,"minDistance",{label:"最小距离",step:.01,min:0,max:100});const t=e.addFolder({title:"缩放"});t.addBinding(a,"enableZoom",{label:"开启"}),t.addBinding(a,"minZoom",{label:"最小",step:.01,min:0,max:10}),t.addBinding(a,"maxZoom",{label:"最大",step:.01,min:0,max:100}),t.addBinding(a,"zoomSpeed",{label:"速度",step:.01,min:0,max:20});function p(){}function c(){}function g(){}return(w,R)=>{const u=B("TresLeches");return _(),P(f,null,[o(u),o(m(M),s(r,{"window-size":""}),{default:A(()=>[z,o(m(I),s(a,{onChange:p,onStart:c,onEnd:g}),null,16),Z,D]),_:1},16)],64)}}});export{L as default};
|
1
dist/static/pagesShow.vue_vue_type_style_index_0_lang-4a631ac6.js
vendored
Normal file
1
dist/static/pagesShow.vue_vue_type_style_index_0_lang-4a631ac6.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/penetrateEvent-1f835e2a.js
vendored
Normal file
1
dist/static/penetrateEvent-1f835e2a.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as i,j as _,ae as c,o as d,s as u,B as a,I as t,a7 as p,U as e,a as l,af as h,aa as m,ag as x}from"./vendor-524e5929.js";const f=e("TresPerspectiveCamera",{"look-at":[0,4,0]},null,-1),B=["blocks-pointer-events"],g=e("TresBoxGeometry",{args:[1,1,1]},null,-1),T=e("TresMeshNormalMaterial",null,null,-1),v=[g,T],b=e("TresBoxGeometry",{args:[1,1,1]},null,-1),k=e("TresMeshNormalMaterial",null,null,-1),M=e("h1",{class:"bg-white text-xs p-0.5 rounded -mt-10"}," Box2 📦 ",-1),w=e("TresGridHelper",null,null,-1),C=e("TresAmbientLight",{intensity:1},null,-1),E=i({__name:"penetrateEvent",setup(N){const r=s=>{console.log(s),x.info(s)},o=_(!0);return new c({title:"穿透事件",expanded:!0}).addBinding(o,"value",{label:"Box2📦可点"}),(s,n)=>(d(),u(t(p),{"window-size":""},{default:a(()=>[f,e("TresMesh",{position:[0,1,0],"blocks-pointer-events":!o.value},v,8,B),e("TresMesh",{position:[-2,0,-2],name:"box 2",onClick:n[0]||(n[0]=G=>r("点击了 Box2 📦"))},[b,k,l(t(h),{center:!0,transform:""},{default:a(()=>[M]),_:1})]),l(t(m)),w,C]),_:1}))}});export{E as default};
|
1
dist/static/polyfills-9a43b4f2.js
vendored
Normal file
1
dist/static/polyfills-9a43b4f2.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/preview-385aa9db.js
vendored
Normal file
1
dist/static/preview-385aa9db.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/preview-6af5d8e1.css
vendored
Normal file
1
dist/static/preview-6af5d8e1.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.fes-divider:not(.is-vertical) .fes-divider-text{font-size:1.2em;background-color:#0f1222;font-weight:bolder;color:#fff}.fes-divider{background-color:#0f1222;margin:0 10px;width:95%}.article-text[data-v-513cf3f8]{line-height:30px;margin-bottom:15px;padding:0 20px}.article-text p[data-v-513cf3f8]{text-indent:2em}.article-text img[data-v-513cf3f8]{margin:10px auto;display:block;max-width:100%;height:auto;cursor:zoom-in;-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.layout-logo{width:12.5rem!important;padding:0!important;justify-content:center!important;margin:0!important}.fes-menu.is-vertical.is-inverted .fes-menu-item,.fes-menu.is-horizontal.is-inverted .fes-menu-item{font-size:.93em;font-weight:100}
|
1
dist/static/radars-ef9b2ec8.js
vendored
Normal file
1
dist/static/radars-ef9b2ec8.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/scrollControls-6f78b04a.js
vendored
Normal file
1
dist/static/scrollControls-6f78b04a.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as v,j as n,a4 as m,a3 as h,o as g,c as C,a,B as p,a6 as x,I as s,a7 as R,C as S,a0 as w,a1 as y,at as I,au as k,U as e,av as B,aw as V,as as N,ax as T,_ as b}from"./vendor-524e5929.js";const c=l=>(I("data-v-3a9657c1"),l=l(),k(),l),j=c(()=>e("TresPerspectiveCamera",{position:[0,2,5]},null,-1)),z=c(()=>e("TresGridHelper",{args:[10,10]},null,-1)),E=c(()=>e("main",null,[e("section",null,[e("h1",null,"First section")]),e("section",null,[e("h2",null,"Second section")])],-1)),F=v({__name:"scrollControls",setup(l){const u=n(),i=n(),t=n(),o=n(0);m(()=>{console.log("jaime ~ progress:",o.value)});const _={clearColor:"#333",alpha:!0,outputColorSpace:w,toneMapping:y},{onLoop:d}=h();return d(()=>{t.value&&(t.value.value.rotation.x=o.value*10,t.value.value.rotation.y=o.value*2)}),(G,r)=>(g(),C(S,null,[a(s(R),x(_,{"window-size":"",class:"canvas-class"}),{default:p(()=>[j,a(s(B),{radius:1}),z,a(s(V),{ref_key:"scRef",ref:u,modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=f=>o.value=f),distance:10,"smooth-scroll":.1,"html-scroll":""},{default:p(()=>[a(s(N),{ref_key:"sphereRef",ref:i,scale:.1,position:[1,2,0]},null,512),a(s(T),{ref_key:"boxRef",ref:t,scale:.5,color:16711935,position:[-1,1,0]},null,512)]),_:1},8,["modelValue"])]),_:1},16),E],64))}});const P=b(F,[["__scopeId","data-v-3a9657c1"]]);export{P as default};
|
1
dist/static/shaderParticles-80e6f554.js
vendored
Normal file
1
dist/static/shaderParticles-80e6f554.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as c,Z as d,a3 as u,o as m,s as f,B as h,a6 as p,I as t,a7 as _,a as v,aa as P,U as o,a8 as g,a9 as w,ah as x}from"./vendor-524e5929.js";const T=o("TresPerspectiveCamera",{position:[5,5,5],fov:45,near:.1,far:1e3,"look-at":[-8,3,-3]},null,-1),S=o("TresAmbientLight",{intensity:.5},null,-1),C={position:[-2,-2,-2]},M=["position","a-scale"],y=o("TresDirectionalLight",{position:[0,2,4],intensity:1,"cast-shadow":""},null,-1),z=o("TresGridHelper",null,null,-1),a=3e3,b=c({__name:"shaderParticles",setup(A){const r=d({clearColor:"black",shadows:!0,alpha:!1}),n={transparent:!0,blending:x,depthWrite:!1,vertexShader:"\n uniform float uPixelRatio;\n uniform float uSize;\n uniform float uTime;\n attribute float aScale;\n\n void main()\n {\n vec4 modelPosition = modelMatrix * vec4(position, 1.0);\n modelPosition.y += sin(uTime + modelPosition.x * 100.0) * aScale * 0.2;\n vec4 viewPosition = viewMatrix * modelPosition;\n vec4 projectionPosition = projectionMatrix * viewPosition;\n\n gl_Position = projectionPosition;\n gl_PointSize = aScale * uSize * uPixelRatio;\n gl_PointSize *= (1.0 / - viewPosition.z);\n }\n ",fragmentShader:"\n void main()\n {\n float distanceToCenter = distance(gl_PointCoord, vec2(0.5));\n float strength = 0.05 / distanceToCenter - 0.1;\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, strength);\n }\n ",uniforms:{uSize:{value:100},uPixelRatio:{value:Math.min(window.devicePixelRatio,2)},uTime:{value:0}}},i=new Float32Array(a*3),s=new Float32Array(a);for(let e=0;e<a;e++)i[e*3+0]=Math.random()*4,i[e*3+1]=Math.random()*4,i[e*3+2]=Math.random()*4,s[e]=Math.random();const{onLoop:l}=u();return l(({elapsed:e})=>{n.uniforms.uTime.value=e}),(e,B)=>(m(),f(t(_),p(r,{"window-size":""}),{default:h(()=>[T,v(t(P)),S,o("TresPoints",C,[o("TresBufferGeometry",{position:[t(i),3],"a-scale":[t(s),1]},null,8,M),o("TresShaderMaterial",g(w(n)),null,16)]),y,z]),_:1},16))}});export{b as default};
|
1
dist/static/simpleExample-85f4a200.js
vendored
Normal file
1
dist/static/simpleExample-85f4a200.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{aH as d,bp as h,Y as u,a3 as m,aE as f,o as g,s as v,B as y,a6 as S,I as c,a7 as C,a0 as w,b5 as M,a as _,aa as x,U as i,a8 as b,a9 as P}from"./vendor-524e5929.js";const l={segments:30,w:256,h:256},T=()=>{const e=new Array;for(let o=0;o<l.segments;o++)e[o]=parseInt(Math.random()*25+10);return e},G=(e,o)=>{let{x:r,y:t,radius:a,weight:n}=o;a=parseInt(a*n);const s=e.createRadialGradient(r,t,0,r,t,a);s.addColorStop(0,"rgba(255, 255, 0, 1)"),s.addColorStop(1,"rgba(255, 0, 0, 0)"),e.fillStyle=s,e.globalAlpha=n,e.beginPath(),e.arc(r,t,a,0,2*Math.PI),e.closePath(),e.fill()},U=()=>{const e={1:"#f00",.8:"#e2fa00",.6:"#33f900",.3:"#0349df",0:"#fff"},o=256,r=10,t=document.createElement("canvas");t.width=o,t.height=r,t.style.position="absolute",t.style.top="0",t.style.right="0";const a=t.getContext("2d"),n=a.createLinearGradient(0,0,o,0);for(const p in e)n.addColorStop(p,e[p]);a.fillStyle=n,a.fillRect(0,0,o,r),document.body.appendChild(t);const s=new d(t);return s.minFilter=h,s.needsUpdate=!0,s},L=()=>{const e=document.createElement("canvas");e.width=l.w,e.height=l.h,e.style.position="absolute",e.style.top="20px",e.style.right="0";const o=e.getContext("2d"),r=T();for(let a=0;a<l.segments;a++){const n=r[a]/35,s=Math.random()*l.w,p=Math.random()*l.h;G(o,{x:s,y:p,radius:80,weight:n})}document.body.appendChild(e);const t=new d(e);return t.minFilter=h,t.needsUpdate=!0,t},R=i("TresPerspectiveCamera",{position:[0,0,3e3],fov:40,near:.1,far:1e4},null,-1),A=i("TresAmbientLight",{color:"#eef0ff",intensity:1},null,-1),B=i("TresPlaneGeometry",{args:[1500,1500]},null,-1),E=u({__name:"simpleExample",setup(e){const o={clearColor:"#030311",shadows:!0,alpha:!1,outputColorSpace:w,shadowMapType:M,useLegacyLights:!0};m().onLoop(({delta:a})=>{});const r={transparent:!0,side:f,vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",fragmentShader:"\n #ifdef GL_ES\n precision highp float;\n #endif\n varying vec2 vUv;\n uniform sampler2D alphaScaleMap;\n uniform sampler2D paletteMap;\n void main() {\n vec4 alphaColor = texture2D(alphaScaleMap, vUv);\n vec4 color = texture2D(paletteMap, vec2(alphaColor.a, 0.0));\n gl_FragColor = vec4(color.r, color.g, color.b, alphaColor.a);\n }",uniforms:{alphaScaleMap:{type:"t",value:L()},paletteMap:{type:"t",value:U()}}};function t(a){a&&console.log(a)}return(a,n)=>(g(),v(c(C),S(o,{"window-size":""}),{default:y(()=>[R,_(c(x),{autoRotate:!0,autoRotateSpeed:2}),A,i("TresMesh",{position:[0,0,10],onPointerMove:t},[B,i("TresShaderMaterial",b(P(r)),null,16)],32)]),_:1},16))}});export{E as default};
|
1
dist/static/suspenseLayout-a513da63.js
vendored
Normal file
1
dist/static/suspenseLayout-a513da63.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{_ as o,r as s,o as t,s as r,B as a,aC as n,a as c}from"./vendor-524e5929.js";const _={};function u(p,f){const e=s("router-view");return t(),r(n,null,{default:a(()=>[c(e)]),_:1})}const i=o(_,[["render",u]]);export{i as default};
|
1
dist/static/theBasic-1697e3d4.js
vendored
Normal file
1
dist/static/theBasic-1697e3d4.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as d,Z as i,$ as _,a0 as m,a1 as f,j as l,a2 as T,a3 as M,a4 as g,a5 as w,o as P,s as v,B as y,a6 as S,I as c,a7 as R,a as x,a8 as D,a9 as b,aa as k,U as e}from"./vendor-524e5929.js";const A=e("TresPerspectiveCamera",{position:[15,15,15],fov:45,near:.1,far:1e3,"look-at":[0,0,0]},null,-1),B=e("TresAmbientLight",{intensity:.5},null,-1),L=e("TresSphereGeometry",{args:[2,32,32]},null,-1),z=e("TresMeshToonMaterial",{color:"#006060"},null,-1),C=[L,z],G=e("TresSphereGeometry",{args:[2,32,32]},null,-1),I=e("TresMeshToonMaterial",{color:"#006060"},null,-1),F=[G,I],Z=["rotation"],N=e("TresPlaneGeometry",{args:[20,20,20,20]},null,-1),j=e("TresMeshToonMaterial",null,null,-1),E=[N,j],V=e("TresDirectionalLight",{position:[10,2,4],intensity:1,"cast-shadow":""},null,-1),H=e("TresGridHelper",null,null,-1),q=d({__name:"theBasic",setup(U){const h=i({clearColor:"#201919",shadows:!0,alpha:!1,shadowMapType:_,outputColorSpace:m,toneMapping:f}),u=i({enableDamping:!0,dampingFactor:.05,enableZoom:!0,autoRotate:!1,autoRotateSpeed:2,maxPolarAngle:Math.PI,minPolarAngle:0,maxAzimuthAngle:Math.PI,minAzimuthAngle:-Math.PI,enablePan:!0,keyPanSpeed:7,maxDistance:100,minDistance:0,minZoom:0,maxZoom:100,zoomSpeed:1,enableRotate:!0,rotateSpeed:1}),t=l(),s=l(),o=T(),{onLoop:p}=M();p(({elapsed:a})=>{t.value&&(t.value.position.y+=Math.sin(a)*.01,s.value.position.y+=Math.sin(a)*.01)});function n(a){a&&a.object.material.color.set("#DFFF45")}function r(a){a&&a.material.color.set("#006060")}return g(()=>{o.value&&(o.value.shadow.mapSize.set(1e3,1e3),o.value.shadow.camera.near=.5,o.value.shadow.camera.top=20,o.value.shadow.camera.right=20,o.value.shadow.camera.left=-20,o.value.shadow.camera.bottom=-20)}),w(()=>{}),(a,Y)=>(P(),v(c(R),S(h,{"window-size":""}),{default:y(()=>[A,x(c(k),D(b(u)),null,16),B,e("TresMesh",{ref_key:"sphereRef",ref:t,position:[0,4,0],"cast-shadow":"",onPointerEnter:n,onPointerLeave:r},C,544),e("TresMesh",{ref_key:"sphereRef2",ref:s,position:[4,4,0],"cast-shadow":"",onPointerEnter:n,onPointerLeave:r},F,544),e("TresMesh",{rotation:[-Math.PI/2,0,0],"receive-shadow":""},E,8,Z),e("TresDirectionalLight",{ref_key:"TDirectionalLight",ref:o,position:[10,8,4],intensity:1,"cast-shadow":""},null,512),V,H]),_:1},16))}});export{q as default};
|
1
dist/static/theConditional-05f49fc6.js
vendored
Normal file
1
dist/static/theConditional-05f49fc6.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as f,Z as M,$ as T,a0 as b,a1 as m,j as a,a5 as x,ae as g,ai as B,aj as y,w as V,ak as v,o as t,s as w,B as k,a6 as C,I as i,a7 as G,U as e,c as r,V as n,a as P,aa as L}from"./vendor-524e5929.js";const N=e("TresPerspectiveCamera",{position:[11,11,11],fov:45,near:.1,far:1e3,"look-at":[-8,3,-3]},null,-1),R=e("TresDirectionalLight",{position:[0,8,4],intensity:.2,"cast-shadow":""},null,-1),S=["material"],j=e("TresBoxGeometry",{args:[1,1,1]},null,-1),E=[j],I={key:0,position:[4,0,0]},U=e("TresBoxGeometry",{args:[1,1,1]},null,-1),$=e("TresMeshToonMaterial",{color:"#efefef"},null,-1),z=[U,$],A={key:1,position:[4,1,0]},D=e("TresBoxGeometry",{args:[1,1,1]},null,-1),Y=e("TresMeshToonMaterial",{color:"#efefef"},null,-1),Z=[D,Y],q={key:2,position:[0,-4,-5]},F=e("TresGroup",null,[e("TresMesh",{position:[0,0,0]},[e("TresBoxGeometry",{args:[1,1,1]}),e("TresMeshBasicMaterial",{color:"#efef11"})]),e("TresMesh",{position:[0,2,0]},[e("TresBoxGeometry",{args:[1,1,1]}),e("TresMeshBasicMaterial",{color:"#ef11ef"})])],-1),H=[F],J=e("TresAmbientLight",{intensity:.5},null,-1),Q=f({__name:"theConditional",setup(K){const p=M({clearColor:"#000000",shadows:!0,alpha:!1,shadowMapType:T,outputColorSpace:b,toneMapping:m,useLegacyLights:!1}),s=a({groupVisible:!0,boxPropMaterialVisible:!0}),_=a(null),l=a(!0);let o=null,c=null;x(()=>{o||(o=new g({title:"显隐参数",expanded:!0}),o.addBinding(l,"value",{label:"boxVisible"}),o.addBinding(s.value,"boxPropMaterialVisible"),o.addBinding(s.value,"groupVisible")),c=B().proxy}),y(()=>{o&&(o.dispose(),o=null)}),V(()=>l,(u,d)=>{d!==void 0&&(c.$refs.boxRef.visible=u.value)},{deep:!0});const h=new v({color:"#ff0000"});return(u,d)=>(t(),w(i(G),C(p,{"window-size":""}),{default:k(()=>[N,R,e("TresMesh",{ref_key:"boxRef",ref:_,position:[0,0,0],material:i(h)},E,8,S),s.value.boxPropMaterialVisible?(t(),r("TresMesh",I,z)):n("",!0),s.value.boxPropMaterialVisible?(t(),r("TresMesh",A,Z)):n("",!0),s.value.groupVisible?(t(),r("TresGroup",q,H)):n("",!0),P(i(L)),J]),_:1},16))}});export{Q as default};
|
1
dist/static/theEvents-456fa19d.js
vendored
Normal file
1
dist/static/theEvents-456fa19d.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as d,o,s as m,B as C,a6 as g,I as c,a7 as T,$ as B,a0 as M,a1 as k,a as w,aa as P,c as n,D as a,C as s,U as t}from"./vendor-524e5929.js";const x=t("TresPerspectiveCamera",{position:[11,11,11],"look-at":[0,0,0]},null,-1),y=["position"],L=t("TresBoxGeometry",{args:[1,1,1]},null,-1),S=t("TresMeshToonMaterial",{color:"#efefef"},null,-1),b=[L,S],E=t("TresDirectionalLight",{intensity:1},null,-1),F=t("TresAmbientLight",{intensity:1},null,-1),G=d({__name:"theEvents",setup(N){const u={clearColor:"#202020",shadows:!0,alpha:!1,shadowMapType:B,outputColorSpace:M,toneMapping:k};function p(e){e&&e.object.material.color.set("#008080")}function _(e){e&&e.object.material.color.set("#CCFF03")}function f(e){e&&e.material.color.set("#efefef")}function h(e){e&&console.log(e)}return(e,j)=>(o(),m(c(T),g(u,{"window-size":""}),{default:C(()=>[x,w(c(P)),(o(),n(s,null,a([-2.5,0,2.5],r=>(o(),n(s,null,[(o(),n(s,null,a([-2.5,0,2.5],i=>(o(),n(s,null,[(o(),n(s,null,a([-2.5,0,2.5],l=>t("TresMesh",{key:"".concat([r,i,l]),position:[r,i,l],onClick:p,onPointerEnter:_,onPointerLeave:f,onPointerMove:h},b,40,y)),64))],64))),64))],64))),64)),E,F]),_:1},16))}});export{G as default};
|
1
dist/static/theGroups-f30718a4.js
vendored
Normal file
1
dist/static/theGroups-f30718a4.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as a,a3 as r,j as n,o as i,s as c,B as l,I as o,a7 as _,a as p,aa as h,U as e}from"./vendor-524e5929.js";const u=e("TresPerspectiveCamera",{position:[5,5,5],fov:75,aspect:1,near:.1,far:1e3},null,-1),d=e("TresAmbientLight",{color:16777215,intensity:.5},null,-1),f=e("TresMesh",{scale:1,position:[-4,0,0],"cast-shadow":""},[e("TresSphereGeometry",{args:[1,500,500]}),e("TresMeshToonMaterial",{color:"#FBB03B"})],-1),T=e("TresMesh",{scale:1,position:[4,0,0],"cast-shadow":""},[e("TresSphereGeometry",{args:[1,500,500]}),e("TresMeshToonMaterial",{color:"teal"})],-1),m=[f,T],B=e("TresDirectionalLight",{position:[0,2,4],intensity:2,"cast-shadow":""},null,-1),g=e("TresAxesHelper",null,null,-1),v=a({__name:"theGroups",setup(w){const{onLoop:t}=r(),s=n();return t(()=>{s.value&&(s.value.rotation.y+=.01)}),(y,M)=>(i(),c(o(_),{clearColor:"#000000","window-size":""},{default:l(()=>[u,p(o(h)),d,e("TresGroup",{ref_key:"groupRef",ref:s,position:[0,-4,-5]},m,512),B,g]),_:1}))}});export{v as default};
|
1
dist/static/transformControls-8b49cc0b.js
vendored
Normal file
1
dist/static/transformControls-8b49cc0b.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as f,j as o,Z as m,al as b,o as c,s as p,B as w,a6 as v,I as r,a7 as B,$ as g,a0 as Y,a1 as Z,a as X,aa as C,U as a,ay as T,V as M}from"./vendor-524e5929.js";const k=a("TresPerspectiveCamera",{position:[3,3,3]},null,-1),y=a("TresBoxGeometry",null,null,-1),S=a("TresMeshNormalMaterial",null,null,-1),N=[y,S],R=a("TresSphereGeometry",null,null,-1),j=a("TresMeshNormalMaterial",null,null,-1),G=[R,j],V=a("TresAmbientLight",{intensity:1},null,-1),z=a("TresGridHelper",null,null,-1),A=f({__name:"transformControls",setup($){const h={clearColor:"#82DBC5",shadows:!0,alpha:!1,shadowMapType:g,outputColorSpace:Y,toneMapping:Z},i=o(),d=o(),n=o();function u(s){n.value=s}const _=o(),e=m({mode:"translate",enabled:!0,space:"world",axis:"XYZ",size:1,showX:!0,showY:!0,showZ:!0}),{pane:t}=b();return t.addBlade({view:"list",label:"模式",options:[{text:"移动",value:"translate"},{text:"旋转",value:"rotate"},{text:"缩放",value:"scale"}],value:e.mode}).on("change",s=>{e.mode=s.value}),t.addBinding(e,"enabled",{label:"开启"}),t.addBlade({view:"list",label:"Space",options:[{text:"世界坐标",value:"world"},{text:"本地坐标",value:"local"}],value:e.space}).on("change",s=>{e.space=s.value}),t.addBlade({view:"list",label:"轴",options:[{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"XY",value:"XY"},{text:"YZ",value:"YZ"},{text:"XZ",value:"XZ"},{text:"XYZ",value:"XYZ"}],value:e.axis}),t.addBinding(e,"size",{label:"大小",step:.01,min:0,max:10}),t.addBinding(e,"showX",{label:"显示X轴"}),t.addBinding(e,"showY",{label:"显示Y轴"}),t.addBinding(e,"showZ",{label:"显示Z轴"}),(s,l)=>(c(),p(r(B),v(h,{ref_key:"context",ref:_,"window-size":""}),{default:w(()=>[k,X(r(C),{"make-default":""}),a("TresMesh",{ref_key:"boxRef",ref:i,position:[-2,1,0],onClick:l[0]||(l[0]=x=>u(i.value))},N,512),n.value?(c(),p(r(T),v({key:0,object:n.value},e),null,16,["object"])):M("",!0),a("TresMesh",{ref_key:"sphereRef",ref:d,position:[2,1,0],onClick:l[1]||(l[1]=x=>u(d.value))},G,512),V,z]),_:1},16))}});export{A as default};
|
14
dist/static/vendor-524e5929.js
vendored
Normal file
14
dist/static/vendor-524e5929.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/weather-9210f352.js
vendored
Normal file
1
dist/static/weather-9210f352.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
var B=Object.defineProperty;var m=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var _=(s,a,e)=>a in s?B(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e,c=(s,a)=>{for(var e in a||(a={}))R.call(a,e)&&_(s,e,a[e]);if(m)for(var e of m(a))z.call(a,e)&&_(s,e,a[e]);return s};import{Y as h,Z as r,az as b,aM as g,j as v,a4 as x,w as Y,o as u,s as C,I as k,aN as S,aO as y,ae as Z,c as $,a as d,B as w,C as X,a8 as M,a9 as P,aC as E}from"./vendor-524e5929.js";import{_ as F}from"./pagesShow.vue_vue_type_style_index_0_lang-4a631ac6.js";import{_ as N}from"./loading.vue_vue_type_script_setup_true_lang-fa08807f.js";import"./_commonjsHelpers-725317a4.js";const j=h({__name:"precipitation",props:{speed:{default:12},randomness:{default:0},count:{default:6e3},size:{default:7},areaX:{default:1500},areaY:{default:1e3},areaZ:{default:1500},type:{default:"snow"},color:{default:"#fff"}},async setup(s){let a,e;const t=s,n={snow:"./plugins/digitalCity/image/snow.png",rain:"./plugins/digitalCity/image/rain.png",cilcle:"./plugins/digitalCity/image/cilcle.png"},i=r({});n[t.type]&&(i.value=([a,e]=b(()=>g({map:n[t.type]})),a=await a,e(),a));const o=v();return x(async()=>{}),Y(()=>t.type,async(p,l)=>{var f;p!=l&&((f=i.value)!=null&&f.map&&i.value.map.dispose(),i.value=await g({map:n[p]?n[p]:n.cilcle}))}),(p,l)=>(u(),C(k(S),{ref_key:"precipitationRef",ref:o,position:[0,t.areaY/2,0],speed:t.speed,color:t.color,alphaTest:.5,area:[t.areaX,t.areaY,t.areaZ],count:t.count,depthWrite:!0,randomness:t.randomness,size:t.size,opacity:1,map:i.value.map,alphaMap:i.value.map},null,8,["position","speed","color","area","count","randomness","size","map","alphaMap"]))}}),V=h({__name:"weather",setup(s){const a=v();x(()=>{a.value&&a.value.$refs.perspectiveCameraRef.position.set(750,500,800)});const e=r({speed:12,size:10,count:6e3,color:"#fff",type:"snow"}),t=r({areaX:1500,areaY:1e3,areaZ:1500}),n=r(c(c({},y(e)),y(t))),o=new Z({title:"天气",expanded:!0}).addFolder({title:"下落物"});return o.addBinding(e,"speed",{label:"速度",min:0,max:30,step:1}),o.addBinding(e,"color",{label:"颜色"}),o.addBinding(e,"size",{label:"大小",min:0,max:26,step:1}),o.addBinding(e,"count",{label:"数量",min:1e3,max:1e4,step:100}),o.addBinding(e,"type",{view:"list",label:"类型",options:[{text:"雪",value:"snow"},{text:"雨",value:"rain"},{text:"点",value:"point"}]}),(p,l)=>(u(),$(X,null,[d(N),d(F,{ref_key:"pagesShowRef",ref:a,autoRotate:!1},{ability:w(()=>[(u(),C(E,null,{default:w(()=>[d(j,M(P(n)),null,16)]),_:1}))]),_:1},512)],64))}});export{V as default};
|
1
dist/static/website-5dd97604.js
vendored
Normal file
1
dist/static/website-5dd97604.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as p,j as d,az as u,aA as m,o as r,s as n,B as t,U as s,a as c,I as e,af as h,aB as f,a6 as w,a7 as g,$ as b,a0 as x,a1 as C,aa as B,aC as y}from"./vendor-524e5929.js";const M=["object"],S=s("iframe",{class:"rounded-lg w-[1024px] h-[670px]",src:"https://www.icegl.cn",frameborder:"0"},null,-1),T=p({__name:"laptop",async setup(l){let a,o;const i=d(),{nodes:_}=([a,o]=u(()=>m("./plugins/basic/htmls/model/model.gltf",{draco:!0})),a=await a,o(),a);return(j,A)=>(r(),n(e(f),null,{default:t(()=>[s("primitive",{ref_key:"primitiveref",ref:i,object:e(_).Macbook},[c(e(h),{transform:"","wrapper-class":"webpage","distance-factor":11,position:[0,10.5,-13.6],occlude:"","rotation-x":-.256},{default:t(()=>[S]),_:1})],8,M)]),_:1}))}}),k=s("TresPerspectiveCamera",{position:[-5,4,3]},null,-1),v=s("TresAmbientLight",{intensity:1},null,-1),$=s("TresDirectionalLight",{intensity:2,position:[2,3,0],"cast-shadow":!0,"shadow-camera-far":50,"shadow-camera-left":-10,"shadow-camera-right":10,"shadow-camera-top":10,"shadow-camera-bottom":-10},null,-1),z=p({__name:"website",setup(l){const a={clearColor:"#241a1a",shadows:!0,alpha:!1,shadowMapType:b,outputColorSpace:x,toneMapping:C};return(o,i)=>(r(),n(e(g),w(a,{"window-size":""}),{default:t(()=>[k,c(e(B)),(r(),n(y,null,{default:t(()=>[c(T)]),_:1})),v,$]),_:1},16))}});export{z as default};
|
1
dist/static/wobbleMaterial-ad408626.js
vendored
Normal file
1
dist/static/wobbleMaterial-ad408626.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import{Y as l,j as s,ae as i,o as c,s as p,B as d,a6 as u,I as a,a7 as _,$ as h,a0 as f,a1 as m,U as e,a as t,aF as C,aa as T}from"./vendor-524e5929.js";const g=e("TresPerspectiveCamera",{position:[3,3,3]},null,-1),w=e("TresTorusGeometry",null,null,-1),B=e("TresGridHelper",{args:[10,10]},null,-1),x=e("TresAmbientLight",{intensity:1},null,-1),M=e("TresDirectionalLight",{intensity:1,position:[2,2,2]},null,-1),G=l({__name:"wobbleMaterial",setup(y){const n={clearColor:"#82DBC5",shadows:!0,alpha:!1,shadowMapType:h,outputColorSpace:f,toneMapping:m},r=s(),o=s("#5384ff");return new i({title:"流体波动",expanded:!0}).addBinding(o,"value",{label:"颜色"}),(S,k)=>(c(),p(a(_),u(n,{ref_key:"context",ref:r,"window-size":""}),{default:d(()=>[g,e("TresMesh",null,[w,t(a(C),{color:o.value,speed:3,factor:8},null,8,["color"])]),B,x,M,t(a(T))]),_:1},16))}});export{G as default};
|
10
package.json
10
package.json
@ -3,11 +3,11 @@
|
||||
"version": "0.0.1",
|
||||
"description": "icegl出品:基于three + vue3.0的webgl三维可视化快速开发平台",
|
||||
"scripts": {
|
||||
"build": "fes build",
|
||||
"prod": "FES_ENV=prod fes build",
|
||||
"analyze": "ANALYZE=1 fes build",
|
||||
"dev": "fes dev",
|
||||
"preview": "vite preview",
|
||||
"build": "fes build",
|
||||
"pre.dev": "FES_ENV=predev fes dev",
|
||||
"pre.build": "FES_ENV=predev fes build",
|
||||
"analyze": "ANALYZE=1 fes build",
|
||||
"test:unit": "fes test:unit"
|
||||
},
|
||||
"publishConfig": {
|
||||
@ -39,4 +39,4 @@
|
||||
"vue": "^3.2.47"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
}
|
BIN
preview/compileMode.png
Normal file
BIN
preview/compileMode.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
111
src/app.jsx
111
src/app.jsx
@ -4,9 +4,9 @@
|
||||
* @Autor: 地虎降天龙
|
||||
* @Date: 2023-10-16 10:53:09
|
||||
* @LastEditors: 地虎降天龙
|
||||
* @LastEditTime: 2023-11-14 11:46:55
|
||||
* @LastEditTime: 2023-11-16 15:28:31
|
||||
*/
|
||||
import { defineRuntimeConfig,useModel,defineBuildConfig } from '@fesjs/fes'
|
||||
import { defineRuntimeConfig, useModel } from '@fesjs/fes'
|
||||
import { FMenu } from '@fesjs/fes-design';
|
||||
import PageLoading from '@/components/pageLoading.vue';
|
||||
import UserCenter from '@/components/userCenter.vue';
|
||||
@ -34,18 +34,10 @@ export default defineRuntimeConfig({
|
||||
},
|
||||
layout: {
|
||||
renderCustom: () => <UserCenter />,
|
||||
menus: [
|
||||
{
|
||||
name: 'index',
|
||||
},
|
||||
// {
|
||||
// name: 'preview',
|
||||
// },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
export function onAppCreated({ app }) {
|
||||
export function onAppCreated ({ app }) {
|
||||
app.use(FMenu);
|
||||
}
|
||||
|
||||
@ -53,71 +45,72 @@ const findStringBetween = (str) => {
|
||||
const regex = /plugins\/([^/]+)\/pages\//;
|
||||
const match = str.match(regex);
|
||||
if (match && match[1]) {
|
||||
return match[1];
|
||||
return match[1];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//自动读取plugins目录下所有插件的pages的目录下的*.vue 并加入路由
|
||||
|
||||
export function patchRoutes ({ routes }) {
|
||||
if (process.env.FES_APP_PLUGINS === 'false') {
|
||||
console.log('项目开发模式: 配置 不自动增加插件plugins里面各个pages的页面路由')
|
||||
return
|
||||
}
|
||||
|
||||
// 自动读取plugins目录下所有插件的pages的目录下的*.vue 并加入路由
|
||||
const viteModules = import.meta.glob('./plugins/**/pages/**/*.vue')
|
||||
const needAddRouter = {
|
||||
path: '/plugins',
|
||||
component: () => import("./components/suspenseLayout.vue"),
|
||||
component: () => import("./components/suspenseLayout.vue"),
|
||||
children: []
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line guard-for-in
|
||||
for (const [key, value] of Object.entries(viteModules)) {
|
||||
const pluginName = findStringBetween(key)
|
||||
const urlList = key.match(/\.\/(.+)\.vue$/)[1].split('/')
|
||||
if(urlList.length === 4){ //插件一级目录 普通插件
|
||||
if (urlList.length === 4) { //插件一级目录 普通插件
|
||||
needAddRouter.children.unshift({
|
||||
path:`/plugins/${pluginName}/${urlList[3]}`,
|
||||
component:value
|
||||
})
|
||||
path: `/plugins/${pluginName}/${urlList[3]}`,
|
||||
component: value
|
||||
})
|
||||
}
|
||||
else if(urlList.length === 5){ //插件二级目录 目前只存在已 basic 基础功能展示
|
||||
else if (urlList.length === 5) { //插件二级目录 目前只存在已 basic 基础功能展示
|
||||
needAddRouter.children.unshift({
|
||||
path:`/plugins/${pluginName}/${urlList[3]}/${urlList[4]}`,
|
||||
component:value
|
||||
})
|
||||
}else{ // 若目录异常 那么直接跳过
|
||||
path: `/plugins/${pluginName}/${urlList[3]}/${urlList[4]}`,
|
||||
component: value
|
||||
})
|
||||
} else { // 若目录异常 那么直接跳过
|
||||
return
|
||||
}
|
||||
}
|
||||
routes.unshift(needAddRouter)
|
||||
}
|
||||
// export function patchRoutes ({ routes }) { 只读取一级 已弃用
|
||||
// const needAddRouter = {}
|
||||
// const viteModules = import.meta.glob('./plugins/*/pages/*.vue');
|
||||
// //const viteModules = import.meta.glob('./plugins/**/pages/**/*.vue');
|
||||
// debugger
|
||||
// for (const [key, value] of Object.entries(viteModules)) {
|
||||
// const pluginName = findStringBetween(key)
|
||||
// const pageName = key.slice(key.lastIndexOf('/') + 1, key.lastIndexOf('.'))
|
||||
// if(pluginName){
|
||||
// const nodeRouter = {
|
||||
// path:`/${pluginName}/${pageName}`,
|
||||
// component:value
|
||||
// }
|
||||
// if(needAddRouter[pluginName]){
|
||||
// needAddRouter[pluginName].push(nodeRouter)
|
||||
// }else{
|
||||
// needAddRouter[pluginName] = [nodeRouter]
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // eslint-disable-next-line guard-for-in
|
||||
// for (const one in needAddRouter) {
|
||||
// const OneNode = needAddRouter[one]
|
||||
// const addRouterNode = {
|
||||
// path: `/${one}`,
|
||||
// component: () => import("./components/suspenseLayout.vue"), // 全局增加suspense 标签 异步语法糖
|
||||
// children: []
|
||||
// }
|
||||
// // eslint-disable-next-line array-callback-return
|
||||
// OneNode.forEach((e)=>{
|
||||
// addRouterNode.children.push(e)
|
||||
// })
|
||||
// routes.unshift(addRouterNode)
|
||||
// }
|
||||
// }
|
||||
|
||||
export function modifyRoute (memo) {
|
||||
if (process.env.FES_APP_PREINDEX === 'true') {
|
||||
console.log('预览模式下 直接替换index的路由为 plugins/preview.vue')
|
||||
let indexRoute = memo.routes.find(route => route.path === '/')
|
||||
if (indexRoute) {
|
||||
indexRoute = indexRoute.children.find(route => route.path === '/')
|
||||
if (indexRoute) {
|
||||
indexRoute.component = () => import("./plugins/preview.vue")
|
||||
indexRoute.meta = {
|
||||
name: 'preview',
|
||||
title: '开源框架展示',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (process.env.FES_APP_PLUGINS === 'false') {
|
||||
console.log('项目开发模式: 默认路由 去除layout')
|
||||
const indexRoute = memo.routes.find(route => route.path === '/')
|
||||
if (indexRoute) {
|
||||
indexRoute.component = null
|
||||
}
|
||||
}
|
||||
return {
|
||||
...memo,
|
||||
routes: [
|
||||
...memo.routes
|
||||
]
|
||||
}
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
body, html {
|
||||
margin: 0;
|
||||
background-color: black;
|
||||
}
|
||||
#app{
|
||||
background-color: --f-body-bg-color;
|
||||
}
|
@ -1,100 +1,110 @@
|
||||
<!--
|
||||
* @Description:
|
||||
* @Version: 1.668
|
||||
* @Autor: 地虎降天龙
|
||||
* @Date: 2023-10-16 10:53:09
|
||||
* @LastEditors: 地虎降天龙
|
||||
* @LastEditTime: 2023-11-09 10:08:16
|
||||
-->
|
||||
<template>
|
||||
<div class="flex h-full">
|
||||
<div class="w-50" style="background-color: black;">
|
||||
<f-menu mode="vertical" :defaultExpandAll="true" :inverted="true" @select="goto">
|
||||
<f-sub-menu value="1">
|
||||
<template #icon>
|
||||
<AppstoreOutlined />
|
||||
</template>
|
||||
<template #label>原生功能展示</template>
|
||||
<template v-for="(bP, pkey) in pluginsConfig">
|
||||
<f-menu-item v-if="pkey === 'basic'" v-for="(onePlugin, okey) in bP.child" :value="onePlugin.name">
|
||||
<template #label>{{ onePlugin.title }}</template>
|
||||
</f-menu-item>
|
||||
</template>
|
||||
</f-sub-menu>
|
||||
<f-sub-menu value="2">
|
||||
<template #icon>
|
||||
<PictureOutlined />
|
||||
</template>
|
||||
<template #label>插件中心</template>
|
||||
<template v-for="(onePlugin, pkey) in pluginsConfig">
|
||||
<f-menu-item v-if="pkey !== 'basic'" :value="pkey">
|
||||
<template #label>{{ onePlugin.title }}</template>
|
||||
</f-menu-item>
|
||||
</template>
|
||||
</f-sub-menu>
|
||||
<f-sub-menu value="8">
|
||||
<template #icon>
|
||||
<ClusterOutlined />
|
||||
</template>
|
||||
<template #label>aboutUs</template>
|
||||
<f-menu-item value="abus">
|
||||
<template #label>关于我们</template>
|
||||
</f-menu-item>
|
||||
</f-sub-menu>
|
||||
</f-menu>
|
||||
</div>
|
||||
<div class="flex-1 overflow-scroll" style="height: calc(100vh - 54px);">
|
||||
<template v-for="(onePlugin, pkey) in pluginsConfig" :key="pkey">
|
||||
<div style="background-color: #f1f1f2;" v-if="pkey !== 'basic'" :ref="el => tabListRef[pkey] = el">
|
||||
<cardList :onePlugin="onePlugin" />
|
||||
</div>
|
||||
<template v-else>
|
||||
<div style="background-color: #f1f1f2;" v-for="(one, opkey) in onePlugin.child" :key="opkey"
|
||||
:ref="el => tabListRef[one.name] = el">
|
||||
<cardList :onePlugin="one" />
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<div style="background-color: rgb(255 255 255);" :ref="el => tabListRef.abus = el">
|
||||
<aboutUs />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<TresCanvas v-bind="state" window-size>
|
||||
<TresPerspectiveCamera :position="[15, 15, 15]" :fov="45" :near="0.1" :far="1000" :look-at="[0, 0, 0]" />
|
||||
<OrbitControls v-bind="controlsState" />
|
||||
<TresAmbientLight :intensity="0.5" />
|
||||
|
||||
<TresMesh ref="sphereRef" :position="[0, 4, 0]" cast-shadow @pointer-enter="onPointerEnter"
|
||||
@pointer-leave="onPointerLeave">
|
||||
<TresSphereGeometry :args="[2, 32, 32]" />
|
||||
<TresMeshToonMaterial color="#006060" />
|
||||
</TresMesh>
|
||||
|
||||
<TresMesh ref="sphereRef2" :position="[4, 4, 0]" cast-shadow @pointer-enter="onPointerEnter"
|
||||
@pointer-leave="onPointerLeave">
|
||||
<TresSphereGeometry :args="[2, 32, 32]" />
|
||||
<TresMeshToonMaterial color="#006060" />
|
||||
</TresMesh>
|
||||
|
||||
<TresMesh :rotation="[-Math.PI / 2, 0, 0]" receive-shadow>
|
||||
<TresPlaneGeometry :args="[20, 20, 20, 20]" />
|
||||
<TresMeshToonMaterial />
|
||||
</TresMesh>
|
||||
|
||||
|
||||
<TresDirectionalLight ref="TDirectionalLight" :position="[10, 8, 4]" :intensity="1" cast-shadow />
|
||||
<TresDirectionalLight :position="[10, 2, 4]" :intensity="1" cast-shadow />
|
||||
|
||||
<TresGridHelper />
|
||||
</TresCanvas>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { defineRouteMeta } from '@fesjs/fes'; //fesJS的路由被他自己封装了
|
||||
import { AppstoreOutlined, PictureOutlined, ClusterOutlined } from '@fesjs/fes-design/icon';
|
||||
import { getPluginsConfig } from '../common/utils';
|
||||
import cardList from '../components/cardList.vue'
|
||||
import aboutUs from '../components/aboutUs.vue'
|
||||
import { SRGBColorSpace, BasicShadowMap, NoToneMapping } from 'three'
|
||||
import { reactive, ref, onMounted, shallowRef, watchEffect } from 'vue'
|
||||
import { TresCanvas, useRenderLoop } from '@tresjs/core'
|
||||
import { OrbitControls } from '@tresjs/cientos'
|
||||
|
||||
defineRouteMeta({
|
||||
name: 'index',
|
||||
title: '开源框架展示',
|
||||
});
|
||||
const state = reactive({
|
||||
clearColor: '#201919',
|
||||
shadows: true,
|
||||
alpha: false,
|
||||
|
||||
const tabListRef = ref([])
|
||||
let pluginsConfig = getPluginsConfig();
|
||||
const goto = (value: string) => {
|
||||
tabListRef.value[value.value]?.scrollIntoView({ behavior: 'smooth', block: 'center', inline: "nearest" })
|
||||
shadowMapType: BasicShadowMap,
|
||||
outputColorSpace: SRGBColorSpace,
|
||||
toneMapping: NoToneMapping,
|
||||
})
|
||||
|
||||
const controlsState = reactive({
|
||||
enableDamping: true,
|
||||
dampingFactor: 0.05,
|
||||
enableZoom: true,
|
||||
autoRotate: false,
|
||||
autoRotateSpeed: 2,
|
||||
maxPolarAngle: Math.PI,
|
||||
minPolarAngle: 0,
|
||||
maxAzimuthAngle: Math.PI,
|
||||
minAzimuthAngle: -Math.PI,
|
||||
enablePan: true,
|
||||
keyPanSpeed: 7,
|
||||
maxDistance: 100,
|
||||
minDistance: 0,
|
||||
minZoom: 0,
|
||||
maxZoom: 100,
|
||||
zoomSpeed: 1,
|
||||
enableRotate: true,
|
||||
rotateSpeed: 1,
|
||||
})
|
||||
|
||||
|
||||
const sphereRef = ref()
|
||||
const sphereRef2 = ref()
|
||||
const TDirectionalLight = shallowRef()
|
||||
|
||||
// const { onLoop, pause, resume } = useRenderLoop()
|
||||
const { onLoop } = useRenderLoop()
|
||||
|
||||
onLoop(({ elapsed }) => {
|
||||
if (!sphereRef.value) return
|
||||
sphereRef.value.position.y += Math.sin(elapsed) * 0.01
|
||||
sphereRef2.value.position.y += Math.sin(elapsed) * 0.01
|
||||
})
|
||||
|
||||
function onPointerEnter(ev: any) {
|
||||
if (ev) {
|
||||
ev.object.material.color.set('#DFFF45')
|
||||
// pause()
|
||||
}
|
||||
}
|
||||
function onPointerLeave(ev: any) {
|
||||
if (ev) {
|
||||
ev.material.color.set('#006060')
|
||||
// resume()
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.layout-logo {
|
||||
/* margin-right: 6.2em !important; */
|
||||
width: 12.5rem !important;
|
||||
padding: 0 !important;
|
||||
justify-content: center !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.fes-menu.is-vertical.is-inverted .fes-menu-item,
|
||||
.fes-menu.is-horizontal.is-inverted .fes-menu-item {
|
||||
font-size: 0.93em;
|
||||
font-weight: 100;
|
||||
}
|
||||
</style>
|
||||
watchEffect(() => {
|
||||
if (TDirectionalLight.value) {
|
||||
TDirectionalLight.value.shadow.mapSize.set(1000, 1000)
|
||||
TDirectionalLight.value.shadow.camera.near = 0.5; // default
|
||||
// TDirectionalLight.value.shadow.camera.far = 50000; // default
|
||||
TDirectionalLight.value.shadow.camera.top = 20
|
||||
TDirectionalLight.value.shadow.camera.right = 20
|
||||
TDirectionalLight.value.shadow.camera.left = -20
|
||||
TDirectionalLight.value.shadow.camera.bottom = -20
|
||||
}
|
||||
})
|
||||
onMounted(() => {
|
||||
})
|
||||
</script>
|
@ -1,18 +0,0 @@
|
||||
<!--
|
||||
* @Description:
|
||||
* @Version: 1.668
|
||||
* @Autor: 地虎降天龙
|
||||
* @Date: 2023-10-16 10:53:09
|
||||
* @LastEditors: 地虎降天龙
|
||||
* @LastEditTime: 2023-11-05 11:37:53
|
||||
-->
|
||||
<template>
|
||||
<div class="flex h-full">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less"></style>
|
92
src/plugins/preview.vue
Normal file
92
src/plugins/preview.vue
Normal file
@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<div class="flex h-full">
|
||||
<div class="w-50" style="background-color: black;">
|
||||
<f-menu mode="vertical" :defaultExpandAll="true" :inverted="true" @select="goto">
|
||||
<f-sub-menu value="1">
|
||||
<template #icon>
|
||||
<AppstoreOutlined />
|
||||
</template>
|
||||
<template #label>原生功能展示</template>
|
||||
<template v-for="(bP, pkey) in pluginsConfig">
|
||||
<f-menu-item v-if="pkey === 'basic'" v-for="(onePlugin, okey) in bP.child" :value="onePlugin.name">
|
||||
<template #label>{{ onePlugin.title }}</template>
|
||||
</f-menu-item>
|
||||
</template>
|
||||
</f-sub-menu>
|
||||
<f-sub-menu value="2">
|
||||
<template #icon>
|
||||
<PictureOutlined />
|
||||
</template>
|
||||
<template #label>插件中心</template>
|
||||
<template v-for="(onePlugin, pkey) in pluginsConfig">
|
||||
<f-menu-item v-if="pkey !== 'basic'" :value="pkey">
|
||||
<template #label>{{ onePlugin.title }}</template>
|
||||
</f-menu-item>
|
||||
</template>
|
||||
</f-sub-menu>
|
||||
<f-sub-menu value="8">
|
||||
<template #icon>
|
||||
<ClusterOutlined />
|
||||
</template>
|
||||
<template #label>aboutUs</template>
|
||||
<f-menu-item value="abus">
|
||||
<template #label>关于我们</template>
|
||||
</f-menu-item>
|
||||
</f-sub-menu>
|
||||
</f-menu>
|
||||
</div>
|
||||
<div class="flex-1 overflow-scroll" style="height: calc(100vh - 54px);">
|
||||
<template v-for="(onePlugin, pkey) in pluginsConfig" :key="pkey">
|
||||
<div style="background-color: #f1f1f2;" v-if="pkey !== 'basic'" :ref="el => tabListRef[pkey] = el">
|
||||
<cardList :onePlugin="onePlugin" />
|
||||
</div>
|
||||
<template v-else>
|
||||
<div style="background-color: #f1f1f2;" v-for="(one, opkey) in onePlugin.child" :key="opkey"
|
||||
:ref="el => tabListRef[one.name] = el">
|
||||
<cardList :onePlugin="one" />
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<div style="background-color: rgb(90, 76, 76);" :ref="el => tabListRef.abus = el">
|
||||
<aboutUs />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { defineRouteMeta } from '@fesjs/fes';
|
||||
import { AppstoreOutlined, PictureOutlined, ClusterOutlined } from '@fesjs/fes-design/icon';
|
||||
import { getPluginsConfig } from '../common/utils';
|
||||
import cardList from '../components/cardList.vue'
|
||||
import aboutUs from '../components/aboutUs.vue'
|
||||
|
||||
defineRouteMeta({
|
||||
name: 'preview',
|
||||
title: '开源框架展示',
|
||||
});
|
||||
|
||||
const tabListRef = ref([])
|
||||
let pluginsConfig = getPluginsConfig();
|
||||
const goto = (value: string) => {
|
||||
tabListRef.value[value.value]?.scrollIntoView({ behavior: 'smooth', block: 'center', inline: "nearest" })
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.layout-logo {
|
||||
/* margin-right: 6.2em !important; */
|
||||
width: 12.5rem !important;
|
||||
padding: 0 !important;
|
||||
justify-content: center !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.fes-menu.is-vertical.is-inverted .fes-menu-item,
|
||||
.fes-menu.is-horizontal.is-inverted .fes-menu-item {
|
||||
font-size: 0.93em;
|
||||
font-weight: 100;
|
||||
}
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user