Skip to content

Commit

Permalink
Access all examples through Astro
Browse files Browse the repository at this point in the history
  • Loading branch information
stalgiag committed Feb 29, 2024
1 parent 62660ac commit 0b0be16
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 430 deletions.
2 changes: 2 additions & 0 deletions src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { librariesCollection } from "./libraries/config";
import { peopleCollection } from "./people/config";
import { sketchesCollection } from "./sketches/config";
import { referenceCollection } from "./reference/config";
import { examplesCollection } from "./examples/config";

export const collections = {
tutorials: tutorialsCollection,
Expand All @@ -12,4 +13,5 @@ export const collections = {
people: peopleCollection,
sketches: sketchesCollection,
reference: referenceCollection,
examples: examplesCollection,
};
9 changes: 9 additions & 0 deletions src/content/examples/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { z, defineCollection } from "astro:content";

export const examplesCollection = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
arialabel: z.string().optional(),
}),
});

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
title: Walk Over 2d Array
arialabel: >-
Several small black words arranged on a white background.
---


undefined
contributed by [Prof WM Harris](https://www.rit.edu/directory/wmhics-w-michelle-harris), How to display 2D array contents on the canvas using regular for and for-of loops in multiple different ways.
A function is created for the canvas, the 2D array (Friend Array) is initialized and walked over using nested loops in different ways.
Variables x and y are used to place the array item on the canvas in the form of 2D array.
The final nested loop is used to initialize 2D array (Fish Array) with random Integers (fish ages).
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Pixel Array
arialabel: A rectangle that changes hues as you move the mouse
---


Click and drag the mouse up and down to control the signal
and press and hold any key to see the current pixel being read.
This program sequentially reads the color of every pixel of an image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Histogram
arialabel: A black and white image of white persons in front of a tent with a white bar histogram overlayed on the bottom.
---


Calculates the histogram of an image.
A histogram is the frequency distribution of the gray levels with the number of
pure black values displayed on the left and number of pure white values on the right.
Expand Down
176 changes: 0 additions & 176 deletions src/content/examples/en/09_Simulate/11_SmokeParticleSystem/code.js

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0b0be16

Please sign in to comment.