js1024

js1024

Annual JavaScript Golfing Competition

CLOSED. Starts on 1 July

About

Participants have 15 days to create a cool JavaScript or GLSL program in 1024 bytes or less.
Check out the rules and the existing demos for some cool examples.
Entry is free, so give it a try, it's really fun! >:)

• 1st of July - theme is announced, competition starts, submission form is open
• 19th of July - deadline!!! submission form is closed, you can rate other projects (19 Jul 9:00 PM GMT+00:00)
• 1st of August - no more ratings!
• a few days later - boom, the results are published and winners are announced

Press here if you want to be announced when it starts

Rules

• Your source code mustn't take up more than 1 KiB
• No malicious/harmful code allowed
• You're not allowed to extract personal data from users
• No external files allowed (external scripts and images will be automatically blocked)
• Do not share your private participant key. You will use it to rate other projects
• Upload a readable version (+ comments) of your code to help people understand it (optional)

I will analyze the code before making demos public in order to ascertain if they are safe.

How It Works

• Submit a project when the submission form is open
• Rate other people's projects using a secret key as proof of identity (only participants can rate other projects)
• The person with the highest rating in each category gets the fabled #1 place

Demo Categories & Shim Details

Classic Canvas Mode Download shim
• a = the canvas element
• b = the body element
• c = the 2d context
• d = the document element
• M = a bool that indicates if the user is on mobile
P5.js demo
• The p5js library will be used in your demo (p5.sound isn't included)
• You only need to submit the script (the setup(), draw() and the other stuff...)
• Check out the documentation: https://p5js.org/get-started/
Shader demo Download shim
• Write your entry like a Shadertoy demo (WebGL1 / GLSL ES 1.0 only)
• Canvas is responsive but its ratio is fixed: 16/9
• Shader inputs: iResolution (w, h), iTime (float), iTimeDelta (float), iFrame (int), iMouse (x, y, clickx, clicky), iDate: float
No shim
• It's an empty HTML file, lol. You start from scratch. Anything is allowed (2d canvas, 3d, etc...)
Note: there was a p5js category in the past but I removed it to keep things balanced
Note: some chars take more than 1 byte: 2 bytes for chars U+80 to U+7FF, 3 bytes for chars U+800 to U+FFFF, 4 bytes for chars U+FFFF to U+10FFFF, when encoded in UTF-8
Note: in 2024, all demos will have the navigation bar my default. Under this bar, there will be an iframe with your demo, so you have to make sure your demo works inside iframes

Code Minificators
(from js13kgames resources)

Try Terser - a live version of the Terser ES6+ minifier
babeljs - JS (ES2015/2016/2017) minifier based on Babili, choose your flavor in the "presets" dropdown
GLSL Minifier
Another shader minifier
Packer - JavaScript compressor
Roadroller - Flattens Your JavaScript Demo
JavaScript Minifier - minify your JavaScript
RegPack - self-contained packer for size-constrained JS code
Closure Compiler - compile your code
UglifyJS - JavaScript parser / mangler / compressor / beautifier
Extreme Javascript minification - compression experiments
miniMinifier - tiny (but super efficient) HTML and CSS minifiers
Minify - a JavaScript and CSS minifier
JSCompress - a compression tool for javascript
ZPNG Minifier - in-browser jsExe
int2binary2html - helps you to encode a long list of integers (0-255) in binary and embed it in your index.html
Terser-online - a live version of the Terser ES6+ minifier, with extra compression options because every byte counts

Tutorials & Guides
(from js13kgames resources)

TRICKS TO GOLF IN JAVASCRIPT
StackExchange thread for javascript golfing tips
js13kGames tutorial - How to make a text game with HTML5
Getting started with HTML5 game development
Tiny platformer
Trigonometry cheat sheet
How to support arrow keys, WASD and ZQSD keyboard inputs in just 56+ bytes of JS
How to make games with CSS3D
Procedurally Generated Dungeon Tutorial
Creating simple music using the Web Audio API
WebGL guide

Postmortems & Articles related to demos

1Keys - How to Make a Piano in only 1kb of JavaScript
Batafuraiko - Winner of JS1024 2021
Star Traveler Postmortem
JavaScript Butterfly Sakura 1k Postmortem
JavaScript Balloon 1k Postmortem
Detective Moji postmortem: a javascript game in just 1024 bytes
Professor Moji: a javascript educational game in just 1024 bytes
JS1024: A post-mortem for Space Hopper 👾

Big thanks to our donors!

Frank Force Evan Hahn TGY xem Joey Twiddle Lewis Nakao Staś Małolepszy Raimon Ràfols nrkn lionleaf

JS1024 is made with by traian
contact: admin@js1024.fun