Stub a 3D demo

This commit is contained in:
Patrick Walton 2017-08-29 19:46:18 -07:00
parent 64e3558986
commit 7029248610
5 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>3D &mdash; Pathfinder Demo</title>
<meta charset="utf-8">
${require('./include/header.html')}
<script type="text/javascript" src="/js/pathfinder/3d-demo.js"></script>
</head>
<body>
${require('./include/navbar.html')}
<div class="rounded py-1 px-3" id="pf-fps-label">0 ms</div>
<canvas id="pf-canvas" width="400" height="300"></canvas>
<div class="pf-bottom-control" id="pf-rendering-options-group">
<select class="custom-select" id="pf-aa-level-select">
<option data-pf-type="none" data-pf-level="0" selected>No AA</option>
<option data-pf-type="ecaa" data-pf-level="0">ECAA (BROKEN)</option>
<option data-pf-type="ssaa" data-pf-level="2">2&times;SSAA</option>
<option data-pf-type="ssaa" data-pf-level="4">4&times;SSAA</option>
</select>
</div>
</body>
</html>

View File

@ -8,6 +8,7 @@
<div class="dropdown-menu" aria-labelledby="pf-demos-menu">
<a class="dropdown-item" href="/">Text</a>
<a class="dropdown-item" href="/demo/svg">SVG</a>
<a class="dropdown-item" href="/demo/3d">3D</a>
</div>
</li>
</ul>

View File

@ -0,0 +1,11 @@
// pathfinder/client/src/3d-demo.ts
//
// Copyright © 2017 The Pathfinder Project Developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
require('../html/3d-demo.html');

View File

@ -3,6 +3,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'inline-source-map',
entry: {
'3d-demo': "./src/3d-demo.ts",
'svg-demo': "./src/svg-demo.ts",
'text-demo': "./src/text-demo.ts",
},

View File

@ -40,6 +40,7 @@ use std::u32;
static STATIC_TEXT_DEMO_PATH: &'static str = "../client/text-demo.html";
static STATIC_SVG_DEMO_PATH: &'static str = "../client/svg-demo.html";
static STATIC_3D_DEMO_PATH: &'static str = "../client/3d-demo.html";
static STATIC_CSS_BOOTSTRAP_PATH: &'static str = "../client/node_modules/bootstrap/dist/css";
static STATIC_CSS_PATHFINDER_PATH: &'static str = "../client/css/pathfinder.css";
static STATIC_JS_BOOTSTRAP_PATH: &'static str = "../client/node_modules/bootstrap/dist/js";
@ -479,6 +480,10 @@ fn static_text_demo() -> io::Result<NamedFile> {
fn static_svg_demo() -> io::Result<NamedFile> {
NamedFile::open(STATIC_SVG_DEMO_PATH)
}
#[get("/demo/3d")]
fn static_3d_demo() -> io::Result<NamedFile> {
NamedFile::open(STATIC_3D_DEMO_PATH)
}
#[get("/css/bootstrap/<file..>")]
fn static_css_bootstrap(file: PathBuf) -> Option<NamedFile> {
NamedFile::open(Path::new(STATIC_CSS_BOOTSTRAP_PATH).join(file)).ok()
@ -528,6 +533,7 @@ fn main() {
partition_svg_paths,
static_text_demo,
static_svg_demo,
static_3d_demo,
static_css_bootstrap,
static_css_pathfinder_css,
static_js_bootstrap,