small clean
This commit is contained in:
parent
1f924163dd
commit
ac624866a7
|
@ -23,7 +23,6 @@
|
|||
<option value="FloralAccident">FloralAccident</option>
|
||||
<option value="Phyllotaxis">Phyllotaxis</option>
|
||||
<option value="SquareTwist_angle">SquareTwist_angle</option>
|
||||
<option value="rectangle_pattern1">rectangle_pattern1</option>
|
||||
</select>
|
||||
<div id="custom"></div>
|
||||
<br>
|
||||
|
|
|
@ -3,7 +3,7 @@ async function fetchConfig(className) {
|
|||
const config = {
|
||||
PolyTwistColourWidth: [
|
||||
{ type: "range", min: 3, max: 10, defaultValue: 5, property: "sides" },
|
||||
{ type: "range", min: 400, max: 400, defaultValue: 400, property: "width" },
|
||||
{ type: "range", min: 400, max: 2000, defaultValue: 400, property: "width" },
|
||||
{ type: "range", min: 2, max: 5, defaultValue: 5, property: "line_width" },
|
||||
{ type: "range", min: 1, max: 100, defaultValue: 50, property: "depth" },
|
||||
{ type: "range", min: -180, max: 180, defaultValue: -90, property: "rotation", },
|
||||
|
@ -56,12 +56,6 @@ async function fetchConfig(className) {
|
|||
{ type: "range", min: 1, max: 10, defaultValue: 1, property: "line_width" },
|
||||
{ type: "color", defaultValue: "#2D81FC", property: "colour1" },
|
||||
],
|
||||
rectangle_pattern1: [
|
||||
{ type: "range", min: 1, max: 800, defaultValue: 400, property: "width" },
|
||||
{ type: "range", min: 1, max: 100, defaultValue: 10, property: "squares" },
|
||||
{ type: "range", min: 1, max: 10, defaultValue: 1, property: "line_width" },
|
||||
{ type: "color", defaultValue: "#2D81FC", property: "colour1" },
|
||||
],
|
||||
EyePrototype: [
|
||||
{ type: "range", min: -400, max: 400, defaultValue: 0, property: "x" },
|
||||
{ type: "range", min: -400, max: 400, defaultValue: 0, property: "y" },
|
||||
|
|
|
@ -26,7 +26,6 @@ function createInstance(className, args) {
|
|||
Nodal_expanding: Nodal_expanding,
|
||||
Phyllotaxis:Phyllotaxis,
|
||||
SquareTwist_angle:SquareTwist_angle,
|
||||
rectangle_pattern1:rectangle_pattern1,
|
||||
EyePrototype:EyePrototype,
|
||||
CircleExpand:CircleExpand,
|
||||
MaryFace:MaryFace,
|
||||
|
|
|
@ -349,33 +349,6 @@ class SquareTwist_angle extends BaseShape {
|
|||
|
||||
}
|
||||
}
|
||||
class rectangle_pattern1 extends BaseShape {
|
||||
constructor(width, squares, line_width, colour1) {
|
||||
super();
|
||||
this.width = width;
|
||||
this.squares = squares;
|
||||
this.line_width = line_width;
|
||||
this.colour1 = colour1;
|
||||
}
|
||||
drawSquare(angle, size, colour) {
|
||||
ctx.save();
|
||||
ctx.translate(centerX, centerY)//-(Math.sin(rad(angle)) *centerX));
|
||||
ctx.rotate(rad(angle + 180));
|
||||
ctx.beginPath();
|
||||
ctx.strokeStyle = colour;
|
||||
ctx.lineWidth = this.line_width;
|
||||
ctx.rect(-size / 2, -size / 2, size, size);
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
}
|
||||
// Draw_rectangle_pattern1(rotation, squares, 200, "blue");
|
||||
draw(rotation) {
|
||||
rotation *= (this.speedMultiplier / 100)
|
||||
for (let z = 0; z < 360; z += 360 / this.squares) {
|
||||
this.drawSquare(z + rotation, this.width, this.colour1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class CircleExpand extends BaseShape {
|
||||
constructor(nCircles, gap, linear, heart, colour1, colour2) {
|
||||
|
|
Loading…
Reference in New Issue