Sure! Here is a comprehensive README file for your GitHub repository:
This repository aims to unify several disparate JavaScript projects, envisioning them as different programs on an imaginary (haunted) alternate history computing device. Each sketch utilizes the 'Libuše' tileset in unique ways.
The Didaktik Gama App is a collection of public HTML documents, each with a separate JavaScript rendering in a canvas, either using Pixi.js or p5.js. The project is packaged with Electron to behave as a native application for macOS and Windows. A server script keeps track of global variables shared between the pages.
Each public page features a different experiment using a spritesheet of glyphs and a collection of sounds sampled from a single physical instrument or an oscillator.
Skip backwards and forwards in the pages with { and } close the application with esc
The poems in the keyboard.js sketch are generated by first making a long sentence using Markov chains generated with Markovify. Words are then randomly removed from this sentence in steps, and new ‘mirror’ sentences are generated using the removed words. The text for this process is sourced from various corpora, including De Re Metallica, a medieval mining text that bridged alchemy and modern metallurgy.
Python poetry generator scripts are found in the text_sources directory and are not directly used by the node/electron app
git clone https://github.com/wysiwyggins/Console.git
cd Console
npm install
To run the project in development mode with hot-reloading:
NODE_ENV=development npm start
To build the project for production:
test with
NODE_ENV=production npm start
build with
npm run build
The built application will be located in the dist
directory.
To package the app for macOS and Windows:
npm run package
The preload.js
script exposes IPC methods to the renderer process:
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('api', {
getSharedState: () => ipcRenderer.invoke('get-shared-state'),
setSharedState: (newState) => ipcRenderer.invoke('set-shared-state', newState),
navigate: (url) => ipcRenderer.send('navigate', url),
quitApp: () => ipcRenderer.send('quit-app'),
});
Example of handling the Escape key in the renderer process:
document.addEventListener('keydown', (event) => {
if (event.key === 'Escape') {
if (window.api) {
window.api.quitApp();
} else {
console.error('api is not available');
}
}
});
This art project is licensed under an Anti-Capitalist License.