From f3f1ad6ff87575680495533974805b607253acf0 Mon Sep 17 00:00:00 2001 From: Anthony O'Brien Date: Fri, 29 Oct 2021 11:11:08 +0100 Subject: [PATCH] Default files added to project directory --- src/art/auxfuse-points/index.html | 15 +++++++++++++++ src/art/auxfuse-points/main.js | 27 +++++++++++++++++++++++++++ src/art/auxfuse-points/meta.json | 5 +++++ src/art/auxfuse-points/style.css | 15 +++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 src/art/auxfuse-points/index.html create mode 100644 src/art/auxfuse-points/main.js create mode 100644 src/art/auxfuse-points/meta.json create mode 100644 src/art/auxfuse-points/style.css diff --git a/src/art/auxfuse-points/index.html b/src/art/auxfuse-points/index.html new file mode 100644 index 00000000..03810eda --- /dev/null +++ b/src/art/auxfuse-points/index.html @@ -0,0 +1,15 @@ + + + + + + + + Auxfuse - Canvaz Points to Shape + + + + + + + \ No newline at end of file diff --git a/src/art/auxfuse-points/main.js b/src/art/auxfuse-points/main.js new file mode 100644 index 00000000..d8adab72 --- /dev/null +++ b/src/art/auxfuse-points/main.js @@ -0,0 +1,27 @@ +const c = document.querySelector('canvas'); +const ctx = c.getContext('2d'); + +c.height = window.innerHeight; +c.width = window.innerWidth; + +function sides(r, inset, n){ + ctx.beginPath(); + ctx.save(); + ctx.translate(c.width/2, c.height/2); + ctx.moveTo(0, 0 - r); + + for (let i = 0; i < n; i++) { + ctx.rotate(Math.PI / n); + ctx.lineTo(0, 0 - (r * inset)); + + ctx.rotate(Math.PI / n); + ctx.lineTo(0, 0 - r); + }; + + ctx.restore(); + ctx.closePath(); + ctx.stroke(); + ctx.fill(); +}; + +sides(100, 0.5, 6); diff --git a/src/art/auxfuse-points/meta.json b/src/art/auxfuse-points/meta.json new file mode 100644 index 00000000..d42398c7 --- /dev/null +++ b/src/art/auxfuse-points/meta.json @@ -0,0 +1,5 @@ +{ + "art_name": "Shape Points", + "author_name": "Auxfuse", + "author_github_url": "https://github.com/auxfuse/" +} \ No newline at end of file diff --git a/src/art/auxfuse-points/style.css b/src/art/auxfuse-points/style.css new file mode 100644 index 00000000..1dd0ea55 --- /dev/null +++ b/src/art/auxfuse-points/style.css @@ -0,0 +1,15 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + overflow: hidden; +} + +canvas { + position: absolute; + top: 0; + left: 0; +} \ No newline at end of file