2018-07-16 09:07:51 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
2018-07-16 15:21:26 +00:00
|
|
|
<title>Brian</title>
|
2018-07-16 09:07:51 +02:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="svg"></div>
|
2018-07-18 18:19:46 +00:00
|
|
|
<script type="text/javascript" src="dist/browser/bundle.js"></script>
|
|
|
|
<script type="text/javascript" src="theme-default.js"></script>
|
|
|
|
<script type="text/javascript" src="theme-designer.js"></script>
|
|
|
|
<script>
|
|
|
|
var pattern = freesewing_patterns_brian;
|
|
|
|
pattern.settings.measurements = {
|
2018-07-19 13:14:50 +00:00
|
|
|
bicepsCircumference: 335,
|
|
|
|
centerBackNeckToWaist: 480,
|
|
|
|
chestCircumference: 1080,
|
|
|
|
hipsCircumference: 950,
|
|
|
|
naturalWaistToHip: 120,
|
|
|
|
neckCircumference: 420,
|
|
|
|
shoulderSlope: 55,
|
|
|
|
shoulderToShoulder: 470,
|
|
|
|
shoulderToWrist: 700,
|
|
|
|
wristCircumference: 190
|
2018-07-18 18:19:46 +00:00
|
|
|
};
|
2018-07-19 14:43:27 +00:00
|
|
|
pattern.settings.paperless = true;
|
2018-07-19 13:14:50 +00:00
|
|
|
pattern.on('preRenderSvg', function(next) {
|
|
|
|
this.attributes.add("viewBox", "-10 -10 600 800");
|
|
|
|
next();
|
|
|
|
});
|
2018-07-18 18:19:46 +00:00
|
|
|
//pattern.on('preRenderSvg', function(next) {
|
|
|
|
// this.style += 'path { stroke: green; stroke-width: 30;}';
|
|
|
|
// next();
|
|
|
|
//});
|
|
|
|
//pattern.on('postRenderSvg', function(next) {
|
|
|
|
// this.svg = this.svg.replace('green', 'yellow');
|
|
|
|
// next();
|
|
|
|
//});
|
|
|
|
//console.log(freesewing_theme_default);
|
|
|
|
pattern.loadPlugin(freesewing_theme_designer);
|
|
|
|
pattern.loadPlugin(freesewing_theme_default);
|
|
|
|
pattern.draft();
|
|
|
|
document.getElementById("svg").innerHTML = pattern.render();
|
|
|
|
function pointHover(evt) {
|
|
|
|
var point = evt.target;
|
|
|
|
var id = point.id;
|
|
|
|
var cx = point.getAttribute('x');
|
|
|
|
var cy = point.getAttribute('y');
|
2018-07-19 13:14:50 +00:00
|
|
|
var name = point.getAttribute('data-point');
|
|
|
|
var part = point.getAttribute('data-part');
|
|
|
|
console.log(name+' ('+cx+', '+cy+') @ '+part);
|
2018-07-18 18:19:46 +00:00
|
|
|
var scale = 2;
|
|
|
|
cx = cx-scale*cx;
|
|
|
|
cy = cy-scale*cy;
|
|
|
|
point.setAttribute("transform", 'matrix('+scale+', 0, 0, '+scale+', '+cx+', '+cy+')');
|
|
|
|
pointUnhover(id);
|
|
|
|
}
|
|
|
|
function pointUnhover(id) {
|
|
|
|
setTimeout(function(){
|
|
|
|
document.getElementById(id).removeAttribute("transform", '');
|
|
|
|
}, 500);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
2018-07-16 09:07:51 +02:00
|
|
|
</html>
|