A p5.js starter template for the 128kb Challenge
Your 128kb journey starts here!
This is a template you can use to start developing your idea within the 128kb framework. It is based on inline HTML, so everything (the HTML, the CSS and the JS) is included in a single file. That’s a lean an smart way working with simple sketches.
How it works
Simply put this code in your favorite code editor (for example Visual Studio Code) and start sketching. To easiest way to display your running sketch in Visual Studio Code is by using the the “live-server” extension. It adds a button to the UI at the bottom right. When you click that button, it opens up the sketch in your browser.
To start the rendering process of the gif, simply set the variable exportGif
to true. Then the gif file will be downloaded autmatically.
Have fun!
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.2/p5.js"></script>
<script src="https://unpkg.com/p5.createloop@0.3.1/dist/p5.createloop.js"></script>
<meta charset="utf-8" />
<link rel="icon" href="data:," />
</head>
<body>
<style>
html,
body {
margin: 0;
padding: 0;
}
main {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
}
canvas {
display: block;
image-rendering: pixelated;
width: 512px !important;
height: 512px !important;
display: block;
}
</style>
<main></main>
</body>
<script>
const exportGif = false;
function setup() {
createCanvas(128, 128);
if (exportGif) {
saveGif("mySketch", 128, { units: "frames", delay: 20 });
}
}
function draw() {
background("#aaaaaa");
fill(0);
circle(width / 2, height / 2, frameCount);
}
</script>
</html>
Submit your work to the gallery!
If you want to show what you have done, please feel free to submit it via the form on this page:
Share it on Social Media
To share your work on Instagram or other channels, that do not accept the gif format, you can use this tool to convert your gif to a high resolution mp4 file.
Enjoying the content?
I put a lot of love and effort into developing content on Creative Coding. Since 2018, I have published 209 interviews, case studies, and tutorials, along with over 272 lessons in 17 online courses – and there's more to come! If you'd like to support my work and help keep this platform evolving, please consider supporting me on Patreon. Thank you very much!
Related
I am really excited to announce that I’ve finally released my brand new course Building Tools today! I just added […]
Two thousand and twenty-four. At the “Barceloneta” metro station, a few hundred meters from the beach, stands an old dot-matrix […]
In an age of increasing digital consumption, Hannah, a recent visual communication graduate, explored “Permacomputing”—a sustainable approach to technology inspired […]
Click here to login or connect!To view this content, you must be a member of Tim's Patreon at €7 or […]
Limitations have always been playing a major role in my creative work; I was only able to develop my best […]
In this interview, Copenhagen-based creative director Tameem Sankari shares his journey into Creative Coding, combining Processing, Blender, and Adobe CC. […]
In this post I’d like to introduce you to Sam Griffith, a talented graphic designer based in Detroit, to discuss […]
The next edition of the DEMO Festival is already approaching and I am currently developing a brand new talk for […]
20 = 1 21 = 222 = 323 = 824 = 1625 = 3226 = 6427 = 128 … »In […]
This is a call for coding designers. It aims to serve as a proposal and a provocation for creative work […]
Hi! In this post I’ll collect case studies and direct links to tools that people have built with p5.js and […]
In 2022, I spontaneously posted a story on Instagram: If anyone out there is also in Rotterdam, I’d love to […]
One day in early 2024 I started to experiment with a new idea. I wrote down a set of rules […]
During OFFF Festival here in Barcelona, many interesting people come around! This interview with Talia Cotton came about almost by […]
Lena: This 10-minute visualiser for A. G. Cooks album teaser featuring my python archive generator, is one of my favourite […]
Hi Anna! It was super nice to meet you at the PCD CPH, I really liked your talk in which […]
When I held Martin Lorenz’s new book in my hands and turned it onto its back, I was a little […]
Hey folks, I hope you are doing great! You may have already read one or two of my essays that […]
Instagram, Twitter, TikTok… All the main platforms that technically have the required features to connect emerging communies for Creative Coding […]
In my teaching at universities and in workshops, I have met many very enthusiastic and highly talented people who have […]
One of the first exercises I assign to my students in my seminars is called “Random Compositions”. Basically, it’s quite […]
I’ve been travelling a lot in the last few months. Still, it was only during a short stay in Copenhagen […]
For me, it’s by far the most inspiring project of the last few years: “Symphony in Acid”, a collaboration between […]
Sometimes it is so difficult to display the potencial of Creative Coding, since it mostly happens in the digital realm, […]
In this conversation Daniel and I discussed a broad range of topics, from the role of AI in Creative Coding to the beauty of Object Oriented Programming.
Please note: This is a interim state of this interview, I am currently working on the edit. Stay tuned! How […]
“Think Different” If you are as old as me, you probably remember the iconic advertisement of Apple with the bold […]