All Projects → MattCozendey → doom-console-log

MattCozendey / doom-console-log

Licence: other
🕹️ DOOM rendered via console.log() in a web browser.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to doom-console-log

archi cloudnative
Cloud Native Architectural Models using Archi. Contains models for CAAS, Cloud Native Applications, 12/15 Factor Applications with CI/CD/CS, monitoring and log management. Infrastructure components include Red Hat OpenShift, Red Hat Storage, Red Hat Ansible Tower, Red Hat Cloudforms, Red Hat Satellite, Red Hat JBoss Middleware.
Stars: ✭ 55 (+189.47%)
Mutual labels:  log
yii2-logreader
Yii2 Log Reader
Stars: ✭ 31 (+63.16%)
Mutual labels:  log
indicator-doom-cpu
Ubuntu indicator that displays how much load your CPU is under via the dying face from the video game DOOM.
Stars: ✭ 51 (+168.42%)
Mutual labels:  doom
dlog
A super simple logger for Go. Supports stderr, logfiles, syslog and windows event log.
Stars: ✭ 16 (-15.79%)
Mutual labels:  log
WatsonSyslogServer
C# Syslog Server
Stars: ✭ 18 (-5.26%)
Mutual labels:  log
printer
A fancy logger yet lightweight, and configurable. 🖨
Stars: ✭ 65 (+242.11%)
Mutual labels:  log
DMXOPL
YMF262-enhanced FM patch set for Doom and source ports.
Stars: ✭ 42 (+121.05%)
Mutual labels:  doom
wasm-fizzbuzz
WebAssembly from Scratch: From FizzBuzz to DooM.
Stars: ✭ 1,364 (+7078.95%)
Mutual labels:  doom
UE4 MagicConsole
Enhanced UE4 output log widget
Stars: ✭ 71 (+273.68%)
Mutual labels:  log
state inspector
State change & method call logger. A debugging tool for instance variables and method calls.
Stars: ✭ 24 (+26.32%)
Mutual labels:  log
msLog
log for webView & webApp 用于webView和webApp的log工具
Stars: ✭ 25 (+31.58%)
Mutual labels:  log
discord-audit-log-bot
A Discord bot that extends Discord's native Audit Log.
Stars: ✭ 109 (+473.68%)
Mutual labels:  log
horse-logger
Middleware for access logging in HORSE
Stars: ✭ 25 (+31.58%)
Mutual labels:  log
k8s-log
容器日志搜集套件。
Stars: ✭ 15 (-21.05%)
Mutual labels:  log
analog-ce
Analog CE
Stars: ✭ 14 (-26.32%)
Mutual labels:  log
EDGE
EDGE Source Code
Stars: ✭ 55 (+189.47%)
Mutual labels:  doom
ip-logger
📇 When someone clicks the link, you will receive their IP and other information via telegram.
Stars: ✭ 0 (-100%)
Mutual labels:  log
VexV5Doom
DOOM port for the Vex V5 Robot Brain
Stars: ✭ 39 (+105.26%)
Mutual labels:  doom
composition-logger
The most optimal way to visualize/debug functional compositions 🔍
Stars: ✭ 15 (-21.05%)
Mutual labels:  log
dtail
DTail is a distributed DevOps tool for tailing, grepping, catting logs and other text files on many remote machines at once.
Stars: ✭ 112 (+489.47%)
Mutual labels:  log

🕹️ DOOM via Console.Log()!


Preview image of DOOM/DOOM console.log()


Play it now.

The Pitch


Bryan Braun gave us Checkboxland, a unique library for rendering text, shapes, and video, via a grid of checkboxes.

Id software gave us DOOM.

Cornelius Diekmann gave us DOOM via WebAssembly.

Healey gave us DOOM via Checkboxes.

Today, I'm pleased to stand on top of these giants' shoulders, and give you DOOM via Console.log().

How

DOOM runs via WebAssembly in a hidden <canvas>. I use HTMLCanvasElement.toDataURL() to turn this into a base64 encoded string. A Console.log() is called with two arguments, "%c X", which is a random string that is going to be stylized by the next parameter, which is composed of css properties. I then attribute the base 64 into a background-url property, thus rendering it.

const base64Image = canvas.toDataURL().replace(/(\r\n|\n|\r)/gm, "");
console.log(
  "%c X",
  `font-size:400px;color: transparent;background:url(${base64Image}) no-repeat; background-size: contain;margin-top: 140px;margin-left: 60px;`
);

Non-standard: This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user.

Key events are forwarded to the hidden <canvas> to avoid focus issues.

const forwardKey = (e, type) => {
  const ev = new KeyboardEvent(type, {
    key: e.key,
    keyCode: e.keyCode,
  });
  canvas.dispatchEvent(ev);
};
document.body.addEventListener("keydown", (e) => forwardKey(e, "keydown"));
document.body.addEventListener("keyup", (e) => forwardKey(e, "keyup"));

While the .wasm is downloaded and processed, the console displays a loading message.

Development

python dev.py

Edit files, refresh.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].