|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <title>Aaron</title> |
| 6 | + <style> |
| 7 | + .two { |
| 8 | + display: inline-block; |
| 9 | + max-width: 95%; |
| 10 | + margin: auto; |
| 11 | + } |
| 12 | + </style> |
| 13 | + </head> |
| 14 | + <body> |
| 15 | + <div id="svg"></div> |
| 16 | + <div id="svg1" class="two"></div> |
| 17 | + <div id="svg2" class="two"></div> |
| 18 | + <script type="text/javascript" src="node_modules/freesewing/dist/browser.js"></script> |
| 19 | + <script type="text/javascript" src="node_modules/@freesewing/brian/dist/browser.js"></script> |
| 20 | + <script type="text/javascript" src="node_modules/@freesewing/plugin-bundle/dist/browser.js"></script> |
| 21 | + <script type="text/javascript" src="dist/browser.js"></script> |
| 22 | + <script type="text/javascript" src="node_modules/@freesewing/plugin-theme/dist/browser.js"></script> |
| 23 | + <script type="text/javascript" src="node_modules/@freesewing/plugin-designer/dist/browser.js"></script> |
| 24 | + <script type="text/javascript" src="node_modules/@freesewing/plugin-debug/dist/browser.js"></script> |
| 25 | + <script type="text/javascript" src="node_modules/@freesewing/plugin-validate/dist/browser.js"></script> |
| 26 | + <script type="text/javascript" src="node_modules/@freesewing/plugin-i18n/dist/browser.js"></script> |
| 27 | + <script type="text/javascript" src="node_modules/@freesewing/models/dist/browser.js"></script> |
| 28 | + <script> |
| 29 | +console.log(freesewing); |
| 30 | + let settings = { |
| 31 | + "complete": true, |
| 32 | + "idPrefix": "fs-", |
| 33 | + "locale": "en", |
| 34 | + "options": { }, |
| 35 | + "embed": true, |
| 36 | + "sa": 10, |
| 37 | + "paperless": true, |
| 38 | + "measurements": { |
| 39 | + "bicepsCircumference": 335, |
| 40 | + "centerBackNeckToWaist": 520, |
| 41 | + "chestCircumference": 1080, |
| 42 | + "hipsCircumference": 990, |
| 43 | + "naturalWaist": 925, |
| 44 | + "naturalWaistToHip": 145, |
| 45 | + "neckCircumference": 420, |
| 46 | + "shoulderSlope": 55, |
| 47 | + "shoulderToElbow": 410, |
| 48 | + "shoulderToShoulder": 465, |
| 49 | + "shoulderToWrist": 680, |
| 50 | + "wristCircumference": 190, |
| 51 | + "seatCircumference": 1080, |
| 52 | + "inseam": 910, |
| 53 | + "seatDepth": 200, |
| 54 | + "hipsToUpperLeg": 220, |
| 55 | + "upperLegCircumference": 630, |
| 56 | + "headCircumference": 590, |
| 57 | + "naturalWaistToFloor": 1310, |
| 58 | + "naturalWaistToSeat": 280 |
| 59 | + }, |
| 60 | + layout: false |
| 61 | + }; |
| 62 | +let settings1 = { ...settings}; |
| 63 | + settings1.sample = { |
| 64 | + type: "models", |
| 65 | + models: { |
| 66 | + a: { |
| 67 | + "bicepsCircumference": 335, |
| 68 | + "centerBackNeckToWaist": 520, |
| 69 | + "chestCircumference": 1080, |
| 70 | + "hipsCircumference": 990, |
| 71 | + "naturalWaist": 925, |
| 72 | + "naturalWaistToHip": 145, |
| 73 | + "neckCircumference": 420, |
| 74 | + "shoulderSlope": 55, |
| 75 | + "shoulderToElbow": 410, |
| 76 | + "shoulderToShoulder": 465, |
| 77 | + "shoulderToWrist": 680, |
| 78 | + "wristCircumference": 190, |
| 79 | + "seatCircumference": 1080, |
| 80 | + "inseam": 910, |
| 81 | + "seatDepth": 200, |
| 82 | + "hipsToUpperLeg": 220, |
| 83 | + "upperLegCircumference": 630, |
| 84 | + "headCircumference": 590, |
| 85 | + "naturalWaistToFloor": 1310, |
| 86 | + "naturalWaistToSeat": 280 |
| 87 | + }, |
| 88 | + b: { |
| 89 | + "bicepsCircumference": 33.5, |
| 90 | + "centerBackNeckToWaist": 52, |
| 91 | + "chestCircumference": 108, |
| 92 | + "hipsCircumference": 99, |
| 93 | + "naturalWaist": 92, |
| 94 | + "naturalWaistToHip": 14, |
| 95 | + "neckCircumference": 42, |
| 96 | + "shoulderSlope": 5, |
| 97 | + "shoulderToElbow": 41, |
| 98 | + "shoulderToShoulder": 46, |
| 99 | + "shoulderToWrist": 68, |
| 100 | + "wristCircumference": 19, |
| 101 | + "seatCircumference": 108, |
| 102 | + "inseam": 91, |
| 103 | + "seatDepth": 20, |
| 104 | + "hipsToUpperLeg": 22, |
| 105 | + "upperLegCircumference": 63, |
| 106 | + "headCircumference": 59, |
| 107 | + "naturalWaistToFloor": 131, |
| 108 | + "naturalWaistToSeat": 28 |
| 109 | + }} |
| 110 | + } |
| 111 | + var pattern1 = new freesewing.patterns.Aaron(settings1); |
| 112 | + pattern1.use(freesewing.plugins.theme); |
| 113 | + pattern1.use(freesewing.plugins.designer); |
| 114 | + pattern1.draft(); |
| 115 | + document.getElementById("svg1").innerHTML = pattern1.render(); |
| 116 | + |
| 117 | + function pointHover(evt) { |
| 118 | + var point = evt.target; |
| 119 | + var id = point.id; |
| 120 | + var cx = point.getAttribute('x'); |
| 121 | + var cy = point.getAttribute('y'); |
| 122 | + var name = point.getAttribute('data-point'); |
| 123 | + var part = point.getAttribute('data-part'); |
| 124 | + console.log(name+' ('+cx+', '+cy+') @ '+part); |
| 125 | + var scale = 2; |
| 126 | + cx = cx-scale*cx; |
| 127 | + cy = cy-scale*cy; |
| 128 | + point.setAttribute("transform", 'matrix('+scale+', 0, 0, '+scale+', '+cx+', '+cy+')'); |
| 129 | + pointUnhover(id); |
| 130 | + } |
| 131 | + function pointUnhover(id) { |
| 132 | + setTimeout(function(){ |
| 133 | + document.getElementById(id).removeAttribute("transform", ''); |
| 134 | + }, 500); |
| 135 | + } |
| 136 | + </script> |
| 137 | + </body> |
| 138 | +</html> |
0 commit comments