Skip to content

Add Greetings from p5.js 2.0 tutorial #920

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

Open
wants to merge 2 commits into
base: 2.0
Choose a base branch
from
Open

Conversation

davepagurek
Copy link
Collaborator

I've added a new tutorial for our upcoming SIGGRAPH Labs workshop!

image

I've added it to a new 2.0 category for now, for content new in 2.0 from 1.x. It's a little weird with just one thing for now, but this is also under the assumption that we'll want to put something in here about migrating from 1.x, and maybe also @ksen0's quilting tutorial too.

image

This also includes some updates to our UI components:

  • Editable sketches can now include extra script tags to include (in this case, used to add p5.woff2 for Google Font loading)
  • Sketch embeds previously were always statically generated and embedded, meaning we couldn't turn them off when they scroll offscreen. This is normally fine, but in a long tutorial like this with many sketches, I wanted it to be able to hide like editable sketches do, so I've added a hideOffscreen option that uses a live JS embed.

Especially as the sketch gets long near the end, embedding the whole thing every time feels a little heavy, but I also want checkpoints where you can see the full sketch source code, so I've left them in for now. In the future it might be nice to have a component that highlights just a subset of the code that could then be expanded to show the whole thing, but that would take a little too much time for this tutorial for now.

Copy link
Member

@ksen0 ksen0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks so much for putting this together!

@@ -6,6 +6,7 @@ interface CodeBundle {
htmlBody?: string;
js?: string;
base?: string;
scripts?: string[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 cool!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential alt names: "include" "depedencies" - scripts is also totally ok! But I'm thinking how to distinguish the "script.js" concept which usually refers to the sketch from external includes

---
title: "Greetings from p5.js 2.0: Animation, Interaction, and Typography in 2D and 3D"
description: "Use new typography and 3D features of p5.js 2.0 to create an interactive postcard!"
category: "2.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe makes sense to put the existing p5.strands tut in the 2.0 category too? I'm also working on the transition guide for this hypothetical/forthcoming category


A common theme in old postcards is to have large block letters with local imagery showing through. Here's [an example of such a postcard](https://commons.wikimedia.org/wiki/File:Greetings_from_St._Paul,_Minnesota_postcard.jpg) from 1937:

![A postcard reading "Greetings from St. Paul, Minnesota" written in big block letters with local buildings showing through the letters.](../images/2.0/example-postcard.jpg)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor optional suggestion - alt text <=100 chars: "Postcard with "Greetings from St. Paul, Minnesota" in big letters with local buildings inside them." This is not a hard and fast rule but a UX convention suggested by web accessibility stewards


![A screenshot of a new p5.js Web Editor project, with the version picker circled.](../images/2.0/switch-version.png)

![A screenshot of the version picker modal in the p5.js Web Editor, showing the dropdown of versions open and the latest 2.0 version selected.](../images/2.0/version-dropdown.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor/optional "Screenshot of the p5.js Editor version picker showing a list of versions, and the latest 2.0 version selected"


We've got a nice looking postcard already! But since this isn't going to be a physical postcard--we're going to put it on a website--we want viewers who use screen readers to be able to tell what's on the canvas.

To do so, we can use `describe()` in setup, and write a short, descriptive string about what we've drawn.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor/optional - thanks for including this! Could also link to https://p5js.org/tutorials/writing-accessible-canvas-descriptions/ for more info?


We have a small canvas here, what would you do if you wanted to get a high-res image saved?

Well, first, I'll add `setAttributes({ antialias: true })` after the `createCanvas` line to make sure our edges are nice and smooth.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor/optional: consider switching this sectionand the previous? Most tutorials end in a full copy-able sketch that includes all functionality

@@ -102,6 +102,7 @@ tutorialCategories:
"advanced": "Advanced Topics"
"p5-strands": p5.strands
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this PR should also remove this one, for the time being

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants