mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-06 07:48:50 +08:00
using prettier for more files. also, client app is built on merge to master (#141)
This commit is contained in:
1 parent
e0fb77bf1a
commit
d52c11c04c
5 files changed
+49
-45
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
name: Prettier
|
name: Run prettier for viewer client app.
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -18,4 +18,4 @@ jobs:
|
|||||||
uses: creyD/prettier_action@v4.2
|
uses: creyD/prettier_action@v4.2
|
||||||
with:
|
with:
|
||||||
# This part is also where you can pass other options, for example:
|
# This part is also where you can pass other options, for example:
|
||||||
prettier_options: --write ./pyrad/**/*.js
|
prettier_options: --write ./pyrad/viewer/app/*
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
name: Deploy
|
name: Deploy
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<head>
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
<meta name="description" content="Web site created using create-react-app" />
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Web site created using create-react-app"
|
||||||
|
/>
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
<!--
|
<!--
|
||||||
manifest.json provides metadata used when your web app is installed on a
|
manifest.json provides metadata used when your web app is installed on a
|
||||||
@@ -23,9 +25,9 @@
|
|||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<title>PyRad Viewer</title>
|
<title>PyRad Viewer</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<!--
|
<!--
|
||||||
@@ -38,6 +40,5 @@
|
|||||||
To begin the development, run `npm start` or `yarn start`.
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
To create a production bundle, use `npm run build` or `yarn build`.
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
-->
|
-->
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -115,7 +115,6 @@ export class Viewer extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_object(path, object) {
|
set_object(path, object) {
|
||||||
|
|
||||||
if (!(object instanceof THREE.Camera)) {
|
if (!(object instanceof THREE.Camera)) {
|
||||||
this.state.scene_tree.find(path.concat(["<object>"])).set_object(object);
|
this.state.scene_tree.find(path.concat(["<object>"])).set_object(object);
|
||||||
}
|
}
|
||||||
@@ -164,17 +163,18 @@ export class Viewer extends Component {
|
|||||||
|
|
||||||
set_output_options(object) {
|
set_output_options(object) {
|
||||||
if (this.created_controls === false) {
|
if (this.created_controls === false) {
|
||||||
let output_options_control = new function () {
|
let output_options_control = new (function () {
|
||||||
this.output_options = 'default';
|
this.output_options = "default";
|
||||||
}
|
})();
|
||||||
// add controls
|
// add controls
|
||||||
this.state.gui.add(output_options_control, 'output_options', object).listen().onChange(
|
this.state.gui
|
||||||
(value) => {
|
.add(output_options_control, "output_options", object)
|
||||||
|
.listen()
|
||||||
|
.onChange((value) => {
|
||||||
this.send_output_type_over_websocket(value);
|
this.send_output_type_over_websocket(value);
|
||||||
}
|
});
|
||||||
)
|
|
||||||
}
|
}
|
||||||
this.created_controls = true
|
this.created_controls = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
handle_command(cmd) {
|
handle_command(cmd) {
|
||||||
@@ -195,7 +195,7 @@ export class Viewer extends Component {
|
|||||||
} else if (cmd.type === "set_property") {
|
} else if (cmd.type === "set_property") {
|
||||||
let path = split_path(cmd.path);
|
let path = split_path(cmd.path);
|
||||||
this.set_property(path, cmd.property, cmd.value);
|
this.set_property(path, cmd.property, cmd.value);
|
||||||
} else if(cmd.type == 'set_output_options') {
|
} else if (cmd.type == "set_output_options") {
|
||||||
this.set_output_options(cmd.output_options);
|
this.set_output_options(cmd.output_options);
|
||||||
}
|
}
|
||||||
// web rtc commands
|
// web rtc commands
|
||||||
@@ -366,8 +366,9 @@ export class Viewer extends Component {
|
|||||||
this.state.controls_main.update();
|
this.state.controls_main.update();
|
||||||
|
|
||||||
let path = ["Cameras", "Main Camera"];
|
let path = ["Cameras", "Main Camera"];
|
||||||
this.state.scene_tree.find(path.concat(["<object>"])).set_object(this.state.camera_main);
|
this.state.scene_tree
|
||||||
|
.find(path.concat(["<object>"]))
|
||||||
|
.set_object(this.state.camera_main);
|
||||||
|
|
||||||
// Axes display
|
// Axes display
|
||||||
let axes = new THREE.AxesHelper(5);
|
let axes = new THREE.AxesHelper(5);
|
||||||
@@ -396,8 +397,7 @@ export class Viewer extends Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="WebRTCVideo">
|
<div className="WebRTCVideo">
|
||||||
<video id="WebRTCVideo-video" autoPlay playsInline muted>
|
<video id="WebRTCVideo-video" autoPlay playsInline muted></video>
|
||||||
</video>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="canvas-container-main"> </div>
|
<div id="canvas-container-main"> </div>
|
||||||
<div id="stats-container"> </div>
|
<div id="stats-container"> </div>
|
||||||
|
|||||||
@@ -1,40 +1,43 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
||||||
-webkit-font-smoothing: antialiased;
|
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||||
-moz-osx-font-smoothing: grayscale;
|
sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
|
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||||
|
monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.BackgroundDiv,
|
.BackgroundDiv,
|
||||||
.WebRTCVideo {
|
.WebRTCVideo {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#BackgroundDiv-video,
|
#BackgroundDiv-video,
|
||||||
#WebRTCVideo-video {
|
#WebRTCVideo-video {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: fill;
|
object-fit: fill;
|
||||||
}
|
}
|
||||||
|
|
||||||
#canvas-container-main {
|
#canvas-container-main {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#canvas-container-main canvas {
|
#canvas-container-main canvas {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user