Skip to content

Commit

Permalink
Restore index.ts for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictus committed May 15, 2024
1 parent dd670a2 commit 5049758
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions js/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Renderer } from "./Renderer";
import * as utils from "./utils";
import fs from "./shaders/teaser_fragment.glsl";
import vs from "./shaders/teaser_vertex.glsl";

async function main() {
let canvas = document.querySelector("canvas")!;
let { gl, program } = utils.initGL(canvas, fs, vs);
let renderer = new Renderer(gl, program, "mnist");

renderer.overlay.fullScreenButton.style("top", "18px");
renderer.overlay.epochSlider.style("top", "calc(100% - 28px)");
renderer.overlay.playButton.style("top", "calc(100% - 34px)");
renderer.overlay.grandtourButton.style("top", "calc(100% - 34px)");

{
let clearBanner = utils.createLoadingBanner(renderer.overlay.figure);
let res = await fetch(new URL("../data/eigs.arrow", import.meta.url))
await renderer.initData(
await res.arrayBuffer(),
["E1", "E2", "E3", "E4", "E5", "E6"],
"name",
{"A1": "#e23838", "A2": "#ffb900", "B0": "#5ebd3e", "B1": "#009cdf", "B4": "#973999"},
);
clearBanner();
}

window.addEventListener("resize", () => {
renderer.setFullScreen(renderer.isFullScreen);
});
}

main();

0 comments on commit 5049758

Please sign in to comment.