Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #997

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions triangleabstraction-luna/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
@title: TriangleAbstraction
@author: Luna
@snapshot: abstract
*/
/*
Welcome to Blot!

To get started with learning Blot's toolkit,
you can find a handful of guides here: https://blot.hackclub.com/guides

You can find full documentation on Blot's toolkit by clicking the button at the top!

Before you make a submission, there are a couple *mandatory* requirements for your PR:

- It must be drawable in Blot! This means keeping the dimensions at 125x125 or smaller
- It must change based on different parameters; it cannot be hardcoded.

*/

const container = document.getElementById('container');
container.innerHTML = svgString;
const width = 125;
const height = 125;

setDocDimensions(width, height);

// store final lines here
const finalLines = [];
const rfinallines= [];
const random = bt.randIntInRange(1, 50);
// create a polyline
const polyline = [
[58.0, 66.1],
[60, 34],
[43, 17],
[8, 41],
[20, 80],
[56, 75],
[58, 66],
[95, 66],
[55, 90],
[22, 46],
[58, 20],
[67, 124],
[16, 66],
[58, 20],
[45, 65],
[67, 124],
[15, 65],
[93, 66]
];
const rpolyline = [
[random, 77],
[28, 15],
[random, 107],
[54, 39]
];
// add the polyline to the final lines
finalLines.push(polyline);
rfinallines.push(rpolyline);


// transform lines using the toolkit
bt.rotate(finalLines, 45);
bt.rotate(rfinallines, 15);

// draw it
drawLines(finalLines);
drawLines(rfinallines);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added triangleabstraction-luna/snapshots/abstract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions triangleabstraction-luna/snapshots/anon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.