Project Structure
This page explains the structure of an fxhash project, providing an overview of the individual files and their purpose.
Generative artworks on fxhash are self-contained web projects that run in the browser. In other words, fxhash projects are mini web pages that display generative graphics, which are served inside an iframe whenever they are requested by a user in the interface.
If your project is not working in the sandbox or the mint preview, the most common reason is that you are likely trying to make networked requests or load in external script files. All assets required for your project need to be contained within the source directory.
An fxhash project needs to follow a specific structure—at the bare minimum it needs to consist out of:
An
index.html
file that the browser uses to display the artwork.A
styles.css
stylesheet that helps display the HTML file properly.And a
script.js
JavaScript file that contains the artist's code and is responsible for generating the artwork/graphcis.
Additionally, fxhash provides a script file fxhash.js
(or fxhash.min.js
as a minified version) that provides the functionality to make the project compatible with the platform.
If you're familiar with these technologies, here's a quick example of what each file should contain:
Every web project typically has a primary HTML entry point, also known as the index file. This file usually represents the initial view of a webpage, and in the case of generative art project on fxhash is the page that will display your generative artwork. In essence it's the page that fxhash serves to the client whenever a project is viewed.
Here is an example of what a minimal index.html page looks like:
It is necessary that every fxhash project has this index.html file. And it needs to be titled index.html
. This HTML file will either contain all of the necessary code, including the CSS and the JavaScript, or reference them as other files in the same directory.
If you're not familiar with the general structure of a webpage, here's additional information to get you up to speed:
Although these are the main 3 technologies that you need to have a grasp of for making a project on fxhash, there are other approaches that you can
In the next section we'll have a look at the fxhash boilerplate - a starting template that already includes all of these files and essentially constitutes the quickest way to get started building a generative token for fxhash, without you having to manually create these files.
Last updated