Move storybook things to examples/

This commit is contained in:
yushijinhun 2020-07-14 02:53:42 +08:00
parent 90b4c57ada
commit 34b6db200c
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
15 changed files with 9 additions and 7 deletions

1
.gitignore vendored
View File

@ -62,4 +62,3 @@ libs/
_ignore/ _ignore/
.DS_Store .DS_Store
.rpt2_cache .rpt2_cache
dist/

View File

@ -1,4 +1,4 @@
module.exports = { module.exports = {
stories: ['../stories/**/*.stories.js'], stories: ['../examples/stories/**/*.stories.js'],
addons: ['@storybook/addon-knobs/register'] addons: ['@storybook/addon-knobs/register']
}; };

View File

@ -1,5 +1,5 @@
/* eslint-disable */ /* eslint-disable */
import * as skinview3d from ".."; import * as skinview3d from "../..";
import { withKnobs, radios, number } from "@storybook/addon-knobs"; import { withKnobs, radios, number } from "@storybook/addon-knobs";
export default { export default {
@ -14,7 +14,7 @@ const createViewer = () => {
const viewer = new skinview3d.SkinViewer(element, { const viewer = new skinview3d.SkinViewer(element, {
width: 300, width: 300,
height: 400, height: 400,
skin: "texture/1_8_texturemap_redux.png", skin: "textures/1_8_texturemap_redux.png",
}); });
console.log(viewer); console.log(viewer);
@ -88,12 +88,12 @@ export const Textures = () => {
}; };
const capeUrl = radios("Cape Textures", capeOptions, "none"); const capeUrl = radios("Cape Textures", capeOptions, "none");
viewer.loadSkin(`texture/${skinUrl}.png`); viewer.loadSkin(`textures/${skinUrl}.png`);
if (capeUrl === "none") { if (capeUrl === "none") {
viewer.loadCape(null); viewer.loadCape(null);
} else { } else {
viewer.loadCape(`texture/${capeUrl}.png`); viewer.loadCape(`textures/${capeUrl}.png`);
} }
return element; return element;

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 689 B

After

Width:  |  Height:  |  Size: 689 B

View File

@ -0,0 +1,3 @@
# Example textures
Assets in this directory are copyrighted by their original author(s), and are **OUTSIDE** the scope of skinview3d's license.
These files are intended for demo use. If you are the copyright owner and disagree with our use, please submit an issue and we will remove the related files.

View File

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 589 B

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 278 KiB

View File

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 109 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -13,7 +13,7 @@
"test": "npm run test:lint", "test": "npm run test:lint",
"dev:watch:modules": "tsc -w --preserveWatchOutput --declaration --sourceMap --outDir libs -p .", "dev:watch:modules": "tsc -w --preserveWatchOutput --declaration --sourceMap --outDir libs -p .",
"dev:watch:bundles": "rollup -w --no-watch.clearScreen -c", "dev:watch:bundles": "rollup -w --no-watch.clearScreen -c",
"dev:storybook": "start-storybook -s ./public -p 6006", "dev:storybook": "start-storybook -s ./examples -p 6006",
"dev": "npm-run-all --parallel dev:watch:modules dev:storybook", "dev": "npm-run-all --parallel dev:watch:modules dev:storybook",
"prepublishOnly": "npm run clean && npm run build" "prepublishOnly": "npm run clean && npm run build"
}, },