port to OOP

This commit is contained in:
41666 2023-10-01 11:43:31 -04:00
parent 7e8b1ad477
commit e33936a86b
15 changed files with 918 additions and 158 deletions

View file

@ -1,17 +0,0 @@
# noeidelon
Foxes dream of electron beams.
https://art.mekanoe.com
## Development
`nix` to install bun... or do it globally.
`bun run .` to generate HTMLs
`bun serve` to serve them locally
## Artworks
<!--/INSERT/-->

39
generators/README.md.txt Normal file
View file

@ -0,0 +1,39 @@
# noeidelon
Foxes dream of electron beams.
**noe** + **eidelon** _(n. a thing, an image, a reflection)_
https://art.mekanoe.com
## Development
`nix` to install bun... or do it globally.
`bun run .` to generate HTMLs
`bun serve` to serve them locally
## Artworks
<!--/INSERT/-->
## Infrastructure
- The "generator" does
- Generates a work list from .js files within `html`
- Creates this README.md file
- Creates the index.html file
- Creates individual HTML files for each work
- The platform supplies
- Shader types
- Primitive objects
- A canvas to draw on
- WebGL hooks
- Helpers, etc
## License
Code and images are licensed under the AGPLv3 license. See [LICENSE](./LICENSE) for more information.

View file

@ -1,5 +1,8 @@
import { unlinkSync } from "fs";
import { unlinkSync } from "node:fs";
import { globSync } from "glob";
import indexTemplate from "./index.html.txt";
import workTemplate from "./work.html.txt";
import readmeTemplate from "./README.md.txt";
const allHtmls = globSync("html/*.html").filter(
(file) => file !== "html/index.html"
@ -8,10 +11,6 @@ for (const htmlFile of allHtmls) {
unlinkSync(htmlFile);
}
const indexTemplate = await Bun.file("generators/index.html.template").text();
const workTemplate = await Bun.file("generators/work.html.template").text();
const readmeTemplate = await Bun.file("generators/README.md.template").text();
const allWorks = globSync("html/*.js")
.map((file) => file.replace("html/", "").replace(".js", ""))
.filter((work) => work !== "platform");
@ -31,7 +30,7 @@ const index = indexTemplate.replace(
await Bun.write("html/index.html", index);
const readme = readmeTemplate.replace(
/<!--\/INSERT\/-->/,
"<!--/INSERT/-->",
allWorks
.map((work) => `- [./${work}](https://art.mekanoe.com/${work})`)
.join("\n")