chore(rendertest): Make it prettier
This commit is contained in:
parent
b1647a7371
commit
ca4c0b5bae
10 changed files with 97 additions and 104 deletions
|
@ -13,17 +13,7 @@ export default {
|
|||
content: ['only'],
|
||||
},
|
||||
measurements: [],
|
||||
parts: [
|
||||
'demo',
|
||||
'circles',
|
||||
'colors',
|
||||
'widths',
|
||||
'styles',
|
||||
'combos',
|
||||
'text',
|
||||
'snippets',
|
||||
'macros',
|
||||
],
|
||||
parts: ['demo', 'circles', 'colors', 'widths', 'styles', 'combos', 'text', 'snippets', 'macros'],
|
||||
options: {
|
||||
width: { mm: 200, min: 50, max: 500, testIgnore: true },
|
||||
strokeColors: { bool: true },
|
||||
|
@ -46,7 +36,7 @@ export default {
|
|||
'text',
|
||||
'snippets',
|
||||
'macros',
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ export default function (part, demo=false) {
|
|||
const { Point, Path, points, paths, store, options } = part.shorthand()
|
||||
|
||||
if (options.only === 'circles' || demo) {
|
||||
|
||||
let y = store.get('y')
|
||||
const w = store.get('w')
|
||||
let colors = store.get('colors')
|
||||
|
@ -12,12 +11,23 @@ export default function (part, demo=false) {
|
|||
points[`circles1-${i}`] = new Point(w / 3 - w / 6, y)
|
||||
.attr('data-circle', i * (w / 50))
|
||||
.attr('data-circle-class', store.get('colors')[i])
|
||||
points[`circles2-${i}`] = new Point(w/3*2 - w/6, y)
|
||||
points[`circles2-${i}`] = new Point((w / 3) * 2 - w / 6, y)
|
||||
.attr('data-circle', i * (w / 50))
|
||||
.attr('data-circle-class', 'fabric ' + store.get('styles')[i] + ' ' + store.get('colors')[i])
|
||||
.attr(
|
||||
'data-circle-class',
|
||||
'fabric ' + store.get('styles')[i] + ' ' + store.get('colors')[i]
|
||||
)
|
||||
points[`circles3-${i}`] = new Point(w - w / 6, y)
|
||||
.attr('data-circle', i * (w / 50))
|
||||
.attr('data-circle-class', 'fabric ' + store.get('widths')[i] + ' ' + store.get('styles')[i] + ' ' + store.get('colors')[i])
|
||||
.attr(
|
||||
'data-circle-class',
|
||||
'fabric ' +
|
||||
store.get('widths')[i] +
|
||||
' ' +
|
||||
store.get('styles')[i] +
|
||||
' ' +
|
||||
store.get('colors')[i]
|
||||
)
|
||||
}
|
||||
y += w / 8
|
||||
store.set('y', y)
|
||||
|
|
|
@ -7,7 +7,8 @@ export default function (part, demo=false) {
|
|||
|
||||
// Stroke colors
|
||||
y += 10
|
||||
if (!demo) paths.noClip = new Path()
|
||||
if (!demo)
|
||||
paths.noClip = new Path()
|
||||
.move(new Point(0, y - 5))
|
||||
.line(new Point(10, y - 5))
|
||||
.attr('class', 'hidden')
|
||||
|
|
|
@ -7,7 +7,8 @@ export default function (part, demo=false) {
|
|||
|
||||
// Stroke combos
|
||||
y += 25
|
||||
if (!demo) paths.noClip = new Path()
|
||||
if (!demo)
|
||||
paths.noClip = new Path()
|
||||
.move(new Point(0, y - 5))
|
||||
.line(new Point(10, y - 5))
|
||||
.attr('class', 'hidden')
|
||||
|
|
|
@ -31,15 +31,7 @@ export default function (part) {
|
|||
'stroke-xl',
|
||||
'stroke-2xl',
|
||||
])
|
||||
store.set('styles', [
|
||||
'default-style',
|
||||
'dotted',
|
||||
'dashed',
|
||||
'lashed',
|
||||
'sa',
|
||||
'help',
|
||||
'hidden',
|
||||
])
|
||||
store.set('styles', ['default-style', 'dotted', 'dashed', 'lashed', 'sa', 'help', 'hidden'])
|
||||
|
||||
if (options.only) return part
|
||||
|
||||
|
|
|
@ -5,11 +5,10 @@ export default function (part, demo=false) {
|
|||
let y = store.get('y')
|
||||
const w = store.get('w')
|
||||
y += 10
|
||||
if (!demo) paths.noClip = new Path()
|
||||
.move(new Point(0, y))
|
||||
.line(new Point(10, y))
|
||||
.attr('class', 'hidden')
|
||||
else points.macros = new Point(0,y)
|
||||
if (!demo)
|
||||
paths.noClip = new Path().move(new Point(0, y)).line(new Point(10, y)).attr('class', 'hidden')
|
||||
else
|
||||
points.macros = new Point(0, y)
|
||||
.attr('data-text', 'Macros')
|
||||
.attr('data-text-class', 'text-lg bold')
|
||||
|
||||
|
@ -41,7 +40,7 @@ export default function (part, demo=false) {
|
|||
from: new Point(0, y),
|
||||
to: new Point(w, y),
|
||||
grainline: true,
|
||||
prefix: 'combo'
|
||||
prefix: 'combo',
|
||||
})
|
||||
|
||||
// hd, vd, ld, and pd
|
||||
|
|
|
@ -11,17 +11,19 @@ export default function (part, demo=false) {
|
|||
bnotch: 15,
|
||||
button: 15,
|
||||
buttonhole: 25,
|
||||
"buttonhole-start": 15,
|
||||
"buttonhole-end": 25,
|
||||
"snap-socket": 25,
|
||||
"snap-stud": 15,
|
||||
'buttonhole-start': 15,
|
||||
'buttonhole-end': 25,
|
||||
'snap-socket': 25,
|
||||
'snap-stud': 15,
|
||||
}
|
||||
y += 20
|
||||
if (!demo) paths.noClip = new Path()
|
||||
if (!demo)
|
||||
paths.noClip = new Path()
|
||||
.move(new Point(0, y - 5))
|
||||
.line(new Point(10, y - 5))
|
||||
.attr('class', 'hidden')
|
||||
else points.snippets = new Point(0,y)
|
||||
else
|
||||
points.snippets = new Point(0, y)
|
||||
.attr('data-text', 'Snippets')
|
||||
.attr('data-text-class', 'text-lg bold')
|
||||
y += 10
|
||||
|
|
|
@ -7,7 +7,8 @@ export default function (part, demo=false) {
|
|||
|
||||
// Stroke styles
|
||||
y += 25
|
||||
if (!demo) paths.noClip = new Path()
|
||||
if (!demo)
|
||||
paths.noClip = new Path()
|
||||
.move(new Point(0, y - 5))
|
||||
.line(new Point(10, y - 5))
|
||||
.attr('class', 'hidden')
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
export default function (part, demo = false) {
|
||||
const { Point, Path, points, paths, store, options } = part.shorthand()
|
||||
if (options.only === 'text' || demo) {
|
||||
|
||||
let y = store.get('y')
|
||||
const w = store.get('w')
|
||||
|
||||
// Text sizes
|
||||
y += 15
|
||||
if (!demo) paths.noClip = new Path()
|
||||
if (!demo)
|
||||
paths.noClip = new Path()
|
||||
.move(new Point(0, y - 5))
|
||||
.line(new Point(10, y - 5))
|
||||
.attr('class', 'hidden')
|
||||
|
@ -17,7 +17,7 @@ export default function (part, demo=false) {
|
|||
const sizes = {
|
||||
'text-xs': 3,
|
||||
'text-sm': 5,
|
||||
'text': 8,
|
||||
text: 8,
|
||||
'text-lg': 10,
|
||||
'text-xl': 14,
|
||||
'text-2xl': 22,
|
||||
|
@ -63,13 +63,9 @@ export default function (part, demo=false) {
|
|||
.attr('data-text', 'Text style')
|
||||
.attr('data-text-class', 'text-lg bold')
|
||||
y += 10
|
||||
points.titalic = new Point(0, y)
|
||||
.attr('data-text', '.italic')
|
||||
.attr('data-text-class', 'italic')
|
||||
points.titalic = new Point(0, y).attr('data-text', '.italic').attr('data-text-class', 'italic')
|
||||
y += 10
|
||||
points.tbold = new Point(0, y)
|
||||
.attr('data-text', '.bold')
|
||||
.attr('data-text-class', 'bold')
|
||||
points.tbold = new Point(0, y).attr('data-text', '.bold').attr('data-text-class', 'bold')
|
||||
|
||||
store.set('y', y)
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ export default function (part, demo=false) {
|
|||
|
||||
// Stroke widths
|
||||
y += 25
|
||||
if (!demo) paths.noClip = new Path()
|
||||
if (!demo)
|
||||
paths.noClip = new Path()
|
||||
.move(new Point(0, y - 5))
|
||||
.line(new Point(10, y - 5))
|
||||
.attr('class', 'hidden')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue