This commit is contained in:
Sam
2023-04-17 18:10:38 +12:00
parent aeed45cc70
commit ff94cff820
15 changed files with 1493 additions and 41 deletions

View File

@@ -3,15 +3,11 @@ async function fetchConfig(className) {
const config = {
PolyTwistColourWidth: [
{ type: "range", min: 3, max: 10, defaultValue: 5, property: "sides" },
{ type: "range", min: 1, max: 600, defaultValue: 400, property: "width" },
{ type: "range", min: 400, max: 400, 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",
},
{ type: "range", min: -180, max: 180, defaultValue: -90, property: "rotation", },
{ type: "range", min: 1, max: 500, defaultValue: 100, property: "speedMultiplier", },
{ type: "color", defaultValue: "#4287f5", property: "colour1" },
{ type: "color", defaultValue: "#42f57b", property: "colour2" },
],
@@ -219,7 +215,7 @@ function drawEyelidAccident(x1, y1) {
ctx.stroke();
}
function DrawPolygon(sides, width, rotation, colour) {
function DrawPolygon(sides, width, rotation, colour,line_width) {
ctx.beginPath();
ctx.moveTo(
centerX + width * Math.cos((rotation * Math.PI) / 180),
@@ -229,14 +225,14 @@ function DrawPolygon(sides, width, rotation, colour) {
for (var i = 1; i <= sides; i += 1) {
ctx.lineTo(
centerX +
width *
Math.cos((i * 2 * Math.PI) / sides + (rotation * Math.PI) / 180),
width *
Math.cos((i * 2 * Math.PI) / sides + (rotation * Math.PI) / 180),
centerY +
width * Math.sin((i * 2 * Math.PI) / sides + (rotation * Math.PI) / 180)
width * Math.sin((i * 2 * Math.PI) / sides + (rotation * Math.PI) / 180)
);
}
ctx.strokeStyle = colour;
ctx.lineWidth = 3;
ctx.lineWidth = line_width;
ctx.stroke();
}