Skip to content

Commit

Permalink
chore: move demo styles out of the ui module
Browse files Browse the repository at this point in the history
  • Loading branch information
w-gao committed Apr 5, 2023
1 parent efcd85d commit 02f2318
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 46 deletions.
9 changes: 1 addition & 8 deletions packages/web/index.html
Expand Up @@ -6,14 +6,7 @@
<title>Variation Graph Visualization</title>
</head>
<body>
<div id="app">

<!-- <div class="alert" id="alert">
<div class="alert__content">This is a message.</div>
<div class="alert__close" onclick="document.getElementById('alert').style.display = 'none'">[x]</div>
</div> -->

</div>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
37 changes: 37 additions & 0 deletions packages/web/src/main.scss
@@ -0,0 +1,37 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
color: #242424;
}

body {
margin: 0;
}

#app {
min-height: 500px;
background: #fefefe;
}

// TODO: move this to its own component.

// <!-- <div class="alert" id="alert">
// <div class="alert__content">This is a message.</div>
// <div class="alert__close" onclick="document.getElementById('alert').style.display = 'none'">[x]</div>
// </div> -->

.alert {
display: flex;
justify-content: space-between;
margin: 0;
padding: 10px 20px;
background: #ffb1b1;
border: 1px rgb(255 137 10) solid;
border-radius: 3px;
}

.alert__close {
cursor: pointer;
}
1 change: 1 addition & 0 deletions packages/web/src/main.ts
@@ -1,4 +1,5 @@
import { PGV } from "./pgv"
import "./main.scss"

/**
* Main entry.
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/pgv.ts
Expand Up @@ -87,6 +87,7 @@ export class PGV {
// Clear whatever we might have.
this._renderer.clear()

// Show the selected region on the UI.
this._ui.updateRegion(desc.region)

// Apply the layout.
Expand Down
1 change: 0 additions & 1 deletion packages/web/src/renderer/three.ts
Expand Up @@ -101,7 +101,6 @@ export class ThreeRenderer implements IRenderer {
this.renderer.shadowMap.enabled = true

this.element = this.renderer.domElement
this.element.setAttribute("class", "renderCanvas")

// Add canvas element to container.
divElement.appendChild(this.element)
Expand Down
36 changes: 0 additions & 36 deletions packages/web/src/ui/style.css
@@ -1,36 +0,0 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
color: #242424;
}

body {
margin: 0;
}

#app {
min-height: 500px;
background: #fefefe;
}

.alert {
display: flex;
justify-content: space-between;
margin: 0;
padding: 10px 20px;
background: #ffb1b1;
border: 1px rgb(255 137 10) solid;
border-radius: 3px;
}

.alert__close {
cursor: pointer;
}

.renderCanvas {
margin: 0;
width: 100%;
height: 500px;
}
2 changes: 1 addition & 1 deletion packages/web/src/ui/ui.tsx
Expand Up @@ -31,7 +31,7 @@ export interface Track {
/**
* The user interface.
*
* Use the method calls to update the values on the UI.
* Use the method calls to update what is shown on the UI.
*
* Register events to handle user input from the UI. (WIP)
*
Expand Down

0 comments on commit 02f2318

Please sign in to comment.