mirror of
https://github.com/wassname/svg2cube.git
synced 2026-08-03 13:21:02 +08:00
63 lines
1.2 KiB
HTML
63 lines
1.2 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Snap.js isometric SVG</title>
|
|
</head>
|
|
<body>
|
|
</body>
|
|
|
|
<script type="text/javascript" src="../../node_modules/snapsvg/dist/snap.svg.js" ></script>
|
|
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5/dat.gui.min.js" ></script>
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js" ></script>
|
|
|
|
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.4.1/snap.svg-min.js"></script> -->
|
|
<script src="projectSVG.js"></script>
|
|
<script>
|
|
|
|
|
|
var cube1
|
|
|
|
|
|
// redraw cube oninput
|
|
var update = function () {
|
|
if (cube1) {
|
|
cube1.update()
|
|
}
|
|
}
|
|
|
|
window.onload = function () {
|
|
|
|
cube1 = new SvgCube({
|
|
rotateX: 45,
|
|
topUrl: 'top.svg',
|
|
leftUrl: 'left.svg',
|
|
frontUrl: 'front.svg',
|
|
rightUrl: 'right.svg',
|
|
backUrl: 'back.svg',
|
|
bottomUrl: 'bottom.svg',
|
|
clipCircle: false,
|
|
stroke: {
|
|
"stroke": 'black', // stroke color for outline
|
|
"stroke-width": 0, // outline width
|
|
},
|
|
size: 256,
|
|
});
|
|
cube1.drawCube()
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var module
|
|
if (module){
|
|
module.exports=SvgCube
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
</html>
|