Skip to content

Commit

Permalink
Fix demo site (#11)
Browse files Browse the repository at this point in the history
* Update gitignore

* Move demo notebook to example dir

* Add html and build script for site
  • Loading branch information
nvictus authored May 16, 2024
1 parent d38293c commit 7bf8db0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ jobs:
run_install: true

- name: Build 🔧
run: pnpm build --base '/eigen-tour/'
run: |
pnpm build-site
cp example/index.html dist
cp example/data/* dist
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules/
dist/
__pycache__
Expand Down
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css">
<link rel="stylesheet" type="text/css" href="./index.css">
<script type="module" crossorigin src="./index.js"></script>
</head>

<body>
<d-figure class="teaser">
<canvas id="teaser"></canvas>
</d-figure>
</body>
4 changes: 3 additions & 1 deletion js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as utils from "./utils";
import fs from "./shaders/teaser_fragment.glsl";
import vs from "./shaders/teaser_vertex.glsl";

import "./widget.css";

async function main() {
let canvas = document.querySelector("canvas")!;
let { gl, program } = utils.initGL(canvas, fs, vs);
Expand All @@ -15,7 +17,7 @@ async function main() {

{
let clearBanner = utils.createLoadingBanner(renderer.overlay.figure);
let res = await fetch(new URL("../data/eigs.arrow", import.meta.url))
let res = await fetch(new URL("./eigs.arrow", import.meta.url))
await renderer.initData(
await res.arrayBuffer(),
["E1", "E2", "E3", "E4", "E5", "E6"],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"scripts": {
"dev": "npm run build -- --sourcemap=inline --watch",
"build": "esbuild js/widget.ts --minify --format=esm --bundle --outdir=src/eigen_tour/static",
"build-site": "esbuild js/index.ts --format=esm --bundle --outdir=dist/",
"fmt": "deno fmt --ignore=dist,node_modules --options-use-tabs"
},
"author": "Trevor Manz",
Expand Down

0 comments on commit 7bf8db0

Please sign in to comment.