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

Update to add capture preview url #36

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
9 changes: 7 additions & 2 deletions hl-gen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Highlight Generative Art Script : V0
* @version: 0.1.2
* @version: 0.1.3
* @description The script exposes certain values and methods that
* can be used within code based generative art.
*/
Expand Down Expand Up @@ -132,10 +132,15 @@ const hl = (function () {
traits: {},
name: "",
description: "",
previewUrl: "",
capturePreview: function () {
window.dispatchEvent(new Event("CAPTURE_PREVIEW"));
setTimeout(() => this.capturePreview(), 500);
},
capturePreviewUrl: function (url) {
this.previewUrl = url;
this.capturePreview();
},
setTraits: function (traits) {
this.traits = traits;
},
Expand All @@ -161,7 +166,7 @@ const hl = (function () {
scriptInfo: () => {
return {
name: "Highlight Generative Art Script",
version: "0.1.2",
version: "0.1.3",
framework: "js",
};
},
Expand Down