diff --git a/packages/tutorial/config/index.js b/packages/tutorial/config/index.js index dd57adf7603..897007b858e 100644 --- a/packages/tutorial/config/index.js +++ b/packages/tutorial/config/index.js @@ -1,38 +1,36 @@ -import { version } from "../package.json"; +import { version } from '../package.json' // ?? 🤔 ?? --> https://en.freesewing.dev/packages/core/config export default { - name: "tutorial", + name: 'tutorial', version, - design: "joostdecock", - code: "joostdecock", - department: "womenswear", - type: "pattern", + design: 'joostdecock', + code: 'joostdecock', + department: 'womenswear', + type: 'pattern', difficulty: 1, - tags: [ - "example", - ], + tags: ['example'], optionGroups: { - fit: ["neckRatio", "widthRatio", "lengthRatio"], - box: ["size"] + fit: ['neckRatio', 'widthRatio', 'lengthRatio'], + box: ['size'] }, - measurements: ["headCircumference"], + measurements: ['head'], inject: { - step4: "step3", - step5: "step4", - step6: "step5", - step7: "step6", - step8: "step7", - step9: "step8", - step10: "step9", - step11: "step10" + step4: 'step3', + step5: 'step4', + step6: 'step5', + step7: 'step6', + step8: 'step7', + step9: 'step8', + step10: 'step9', + step11: 'step10' }, - parts: ["step1", "step2", "bib"], + parts: ['step1', 'step2', 'bib'], options: { size: { pct: 50, min: 10, max: 100 }, neckRatio: { pct: 80, min: 70, max: 90 }, widthRatio: { pct: 45, min: 35, max: 55 }, lengthRatio: { pct: 75, min: 55, max: 85 } } -}; +} diff --git a/packages/tutorial/src/bib.js b/packages/tutorial/src/bib.js index d069a546a3e..54364e96f61 100644 --- a/packages/tutorial/src/bib.js +++ b/packages/tutorial/src/bib.js @@ -1,4 +1,4 @@ -export default function(part) { +export default function (part) { let { Point, points, @@ -15,11 +15,11 @@ export default function(part) { // Construct the neck opening let tweak = 1 - let target = (measurements.headCircumference * options.neckRatio) / 4 + let target = (measurements.head * options.neckRatio) / 4 let delta do { - points.right = new Point((tweak * measurements.headCircumference) / 10, 0) - points.bottom = new Point(0, (tweak * measurements.headCircumference) / 12) + points.right = new Point((tweak * measurements.head) / 10, 0) + points.bottom = new Point(0, (tweak * measurements.head) / 12) points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2) points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2) @@ -45,8 +45,8 @@ export default function(part) { points.topCp2 = points.bottomCp1.flipY() // Construct the outline - let width = measurements.headCircumference * options.widthRatio - let length = measurements.headCircumference * options.lengthRatio + let width = measurements.head * options.widthRatio + let length = measurements.head * options.lengthRatio points.topLeft = new Point(width / -2, points.top.y - (width / 2 - points.right.x)) points.topRight = points.topLeft.shift(0, width) diff --git a/packages/tutorial/src/step2.js b/packages/tutorial/src/step2.js index d8062b35696..8861ca5b3a7 100644 --- a/packages/tutorial/src/step2.js +++ b/packages/tutorial/src/step2.js @@ -1,8 +1,8 @@ -export default function(part) { +export default function (part) { let { Point, points, Path, paths, measurements } = part.shorthand() - points.right = new Point(measurements.headCircumference / 10, 0) - points.bottom = new Point(0, measurements.headCircumference / 12) + points.right = new Point(measurements.head / 10, 0) + points.bottom = new Point(0, measurements.head / 12) points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2) points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2) diff --git a/packages/tutorial/src/step3.js b/packages/tutorial/src/step3.js index 5b16627f432..6139502a8ff 100644 --- a/packages/tutorial/src/step3.js +++ b/packages/tutorial/src/step3.js @@ -1,12 +1,12 @@ -export default function(part) { +export default function (part) { let { Point, points, Path, paths, measurements, options } = part.shorthand() let tweak = 1 - let target = (measurements.headCircumference * options.neckRatio) / 4 + let target = (measurements.head * options.neckRatio) / 4 let delta do { - points.right = new Point((tweak * measurements.headCircumference) / 10, 0) - points.bottom = new Point(0, (tweak * measurements.headCircumference) / 12) + points.right = new Point((tweak * measurements.head) / 10, 0) + points.bottom = new Point(0, (tweak * measurements.head) / 12) points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2) points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2) diff --git a/packages/tutorial/src/step5.js b/packages/tutorial/src/step5.js index b19c4efb884..7e850ff0ee3 100644 --- a/packages/tutorial/src/step5.js +++ b/packages/tutorial/src/step5.js @@ -1,8 +1,8 @@ -export default function(part) { +export default function (part) { let { Point, points, Path, paths, measurements, options } = part.shorthand() - let width = measurements.headCircumference * options.widthRatio - let length = measurements.headCircumference * options.lengthRatio + let width = measurements.head * options.widthRatio + let length = measurements.head * options.lengthRatio points.topLeft = new Point(width / -2, points.top.y - (width / 2 - points.right.x)) points.topRight = points.topLeft.shift(0, width)