Revert "Merge pull request #59 from bs-community/add-storybook"

This reverts commit c65b2cd25c, reversing
changes made to 990deb16db.
This commit is contained in:
yushijinhun 2020-08-17 20:35:05 +08:00
parent 8a5ba09a14
commit 9385dc131a
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
16 changed files with 3031 additions and 12234 deletions

View File

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

View File

@ -1,3 +0,0 @@
{
"type": "commonjs"
}

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

40
examples/index.html Normal file
View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>skinview3d</title>
<link href="https://fonts.googleapis.com/css?family=Archivo+Black" rel="stylesheet">
<style>
html,
body {
margin: 0;
padding: 0;
background-color: #1e1e1e;
}
</style>
</head>
<body>
<div id="skin_container"></div>
<script type="text/javascript" src="../bundles/skinview3d.bundle.js"></script>
<script>
let skinViewer = new skinview3d.SkinViewer(document.getElementById("skin_container"), {
width: 400,
height: 300,
skin: "./1_8_texturemap_redux.png"
});
let control = new skinview3d.createOrbitControls(skinViewer);
skinViewer.animations.add(skinview3d.WalkingAnimation);
skinViewer.animations.speed = 1.5;
</script>
</body>
</html>

View File

@ -1,100 +0,0 @@
/* eslint-disable */
import * as skinview3d from "../..";
import { withKnobs, radios, number } from "@storybook/addon-knobs";
export default {
title: "Skinview3d",
decorators: [withKnobs],
};
let currentAnimation;
const createViewer = () => {
const element = document.createElement("div");
const viewer = new skinview3d.SkinViewer(element, {
width: 300,
height: 400,
skin: "textures/1_8_texturemap_redux.png",
});
console.log(viewer);
// Control objects with your mouse!
const control = skinview3d.createOrbitControls(viewer);
control.enableRotate = true;
control.enableZoom = false;
control.enablePan = false;
// Add an animation
currentAnimation = viewer.animations.add(skinview3d.WalkingAnimation);
return { viewer, element };
};
let { viewer, element } = createViewer();
export const Basic = () => {
// reset
let { viewer, element } = createViewer();
if (currentAnimation) {
currentAnimation.remove();
}
return element;
};
export const Animation = () => {
if (currentAnimation) {
currentAnimation.remove();
}
const animationMap = {
Walk: skinview3d.WalkingAnimation,
Run: skinview3d.RunningAnimation,
Rotate: skinview3d.RotatingAnimation,
};
const animationKey = radios("Animations", Object.keys(animationMap), "Run");
currentAnimation = viewer.animations.add(animationMap[animationKey]);
const label = "Speed";
const defaultValue = 0.5;
const options = {
range: true,
min: 0.1,
max: 2,
step: 0.01,
};
const value = number(label, defaultValue, options);
currentAnimation.speed = value;
return element;
};
export const Textures = () => {
const skinOptions = {
"1.8 Skin": "1_8_texturemap_redux",
"Classic Skin": "Hacksore",
"HD Skin": "ironman_hd",
};
const skinUrl = radios("Skin Textures", skinOptions, "1_8_texturemap_redux");
const capeOptions = {
None: "none",
"Classic Cape": "cape",
"HD Cape": "hd_cape",
};
const capeUrl = radios("Cape Textures", capeOptions, "none");
viewer.loadSkin(`textures/${skinUrl}.png`);
if (capeUrl === "none") {
viewer.loadCape(null);
} else {
viewer.loadCape(`textures/${capeUrl}.png`);
}
return element;
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 689 B

View File

@ -1,3 +0,0 @@
# 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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

15102
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,10 +11,10 @@
"build": "npm run build:modules && npm run build:bundles",
"test:lint": "eslint --ext .ts src",
"test": "npm run test:lint",
"dev:watch:modules": "tsc -w --preserveWatchOutput --declaration --sourceMap --outDir libs -p .",
"dev:watch:bundles": "rollup -w --no-watch.clearScreen -c",
"dev:storybook": "start-storybook -s ./examples -p 6006",
"dev": "npm-run-all --parallel dev:watch:modules dev:storybook",
"dev:watch:modules": "tsc -w --declaration --sourceMap --outDir libs -p .",
"dev:watch:bundles": "rollup -w -c",
"dev:serve": "ws",
"dev": "npm-run-all --parallel dev:watch:modules dev:watch:bundles dev:serve",
"prepublishOnly": "npm run clean && npm run build"
},
"repository": {
@ -42,16 +42,13 @@
"three": "^0.118.3"
},
"devDependencies": {
"@babel/core": "^7.10.4",
"@rollup/plugin-node-resolve": "^8.4.0",
"@rollup/plugin-typescript": "^5.0.2",
"@storybook/addon-knobs": "^5.3.19",
"@storybook/html": "^5.3.19",
"@typescript-eslint/eslint-plugin": "^3.6.1",
"@typescript-eslint/parser": "^3.6.1",
"@yushijinhun/three-minifier-rollup": "^0.1.7",
"babel-loader": "^8.1.0",
"eslint": "^7.4.0",
"local-web-server": "^4.2.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"rollup": "^2.21.0",