An open API service indexing awesome lists of open source software.

https://github.com/scriptogre/bad-apple

Bad Apple using htmx + sse ext. + server-commands ext.
https://github.com/scriptogre/bad-apple

badapple demo htmx htmx-extension

Last synced: 8 months ago
JSON representation

Bad Apple using htmx + sse ext. + server-commands ext.

Awesome Lists containing this project

README

          

# Bad Apple

The Bad Apple animation as ASCII art rendered in real-time from the server @ 60 FPS using [**htmx**](https://htmx.org/) + [**sse extension**](https://htmx.org/extensions/sse/) + [**server-commands extension**](https://github.com/scriptogre/htmx-extensions/tree/feature/server-commands/src/server-commands).

![img.png](img.png)

## Quick Start

```bash
cp .env.example .env
docker compose up
```

## How it works

The `server-commands` extension provides a special `` tag. The server streams `` tags ~60 times/second via SSE to update multiple elements in real-time:

```html
data: {frame}
data: {progress}%
```

You can read more about it in the extension's [README.md](https://github.com/scriptogre/htmx-extensions/tree/feature/server-commands/src/server-commands).