46 lines
1.4 KiB
HTML
46 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Brian</title>
|
|
</head>
|
|
<body>
|
|
<div id="svg"></div>
|
|
<script type="text/javascript" src="dist/browser/bundle.js"></script></body>
|
|
<script>
|
|
var pattern = freesewing_patterns_brian;
|
|
pattern.settings.measurements = {
|
|
bicepsCircumference: 305,
|
|
centerBackNeckToWaist: 495,
|
|
chestCircumference: 965,
|
|
hipsCircumference: 838,
|
|
naturalWaistToHip: 110,
|
|
neckCircumference: 391,
|
|
shoulderSlope: 49,
|
|
shoulderToShoulder: 444,
|
|
shoulderToWrist: 680,
|
|
wristCircumference: 185
|
|
};
|
|
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');
|
|
console.log('Point '+id+' ( '+cx+' , '+cy+' )');
|
|
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);
|
|
}
|
|
console.log(pattern.parts.backBlock.points);
|
|
</script>
|
|
</html>
|
|
|