DEV Community

Cover image for # PANIC.HTML — A Polyglot Emotion-Driven Layout Runtime
PEACEBINFLOW
PEACEBINFLOW

Posted on

# PANIC.HTML — A Polyglot Emotion-Driven Layout Runtime

April Fools Challenge Submission ☕️🤡


What I Built

Modern web development focuses heavily on performance, stability, scalability, accessibility, and solving real-world problems.

This project does the opposite.

PANIC.HTML is a browser environment where:

  • HTML hosts the chaos
  • CSS pretends to be a geometry engine
  • SVG mutates shapes randomly
  • JavaScript runs an emotion-driven layout AI
  • multiple programming languages are embedded in one page
  • none of them solve anything

The system operates using emotional runtime states instead of traditional application states.

Instead of:

idle → loading → success
Enter fullscreen mode Exit fullscreen mode

we use:

happy → angry → confused → existential
Enter fullscreen mode Exit fullscreen mode

These emotional states directly control how elements move, rotate, and distort across the screen.

The result is a self-destabilizing web interface.

It accomplishes absolutely nothing.


Demo

Run the page and watch as:

  • buttons escape your cursor
  • text rotates without reason
  • SVG shapes mutate unpredictably
  • the layout randomly reorganizes itself

The page becomes a mindless emotional AI controlling CSS transforms.


Code

Below is the entire useless runtime environment.


panic.html

<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="UTF-8">
<title>PANIC.HTML — Polyglot Chaos Engine</title>

<link rel="stylesheet" href="chaos.css">

</head>

<body>

<h1 class="entity">PANIC.HTML</h1>

<p class="entity">
A polyglot emotional runtime for absolutely no reason.
</p>

<button class="entity">Try clicking me</button>

<svg width="200" height="200">
<polygon points="50,0 100,100 0,100" class="shape entity"></polygon>
</svg>

<script src="panic.js"></script>


<!-- Polyglot Language Buffet -->

<script type="python">
print("hello from python")
</script>

<script type="sql">
SELECT * FROM meaning_of_life WHERE answer = NULL;
</script>

<script type="bash">
sudo rm -rf stability
</script>

<script type="yaml">
emotion:
 - happy
 - angry
 - existential
</script>

</body>
</html>
Enter fullscreen mode Exit fullscreen mode

chaos.css

Instead of styling, CSS is used here as a border-geometry experiment layer.

body{
background:black;
color:white;
font-family:monospace;
overflow:hidden;
}

.entity{

position:absolute;

border-style:dashed;

border-width:calc(5px + 10 * random());

transition:all 0.8s linear;

transform-origin:center;

}

button{
padding:10px 20px;
background:hotpink;
border:none;
cursor:pointer;
}

.shape{
fill:cyan;
stroke:white;
stroke-width:3;
}
Enter fullscreen mode Exit fullscreen mode

panic.js

The Emotional Runtime Engine.

Instead of deterministic UI logic, the interface runs on emotional states.

const emotions = [
"happy",
"angry",
"sad",
"confused",
"existential"
];

function randomEmotion(){

return emotions[
Math.floor(Math.random()*emotions.length)
];

}

function chaosMove(){

const elements = document.querySelectorAll(".entity");

const emotion = randomEmotion();

elements.forEach(el=>{

let x = Math.random()*window.innerWidth;
let y = Math.random()*window.innerHeight;

if(emotion==="happy"){
el.style.transform=
`translate(${x}px,${y}px) scale(1.2)`
}

if(emotion==="angry"){
el.style.transform=
`translate(${x}px,${y}px) rotate(${Math.random()*360}deg)`
}

if(emotion==="sad"){
el.style.transform=
`translate(${x}px,${y}px) scale(0.7)`
}

if(emotion==="confused"){
el.style.transform=
`translate(${Math.random()*200}px,${Math.random()*200}px)
rotate(${Math.random()*720}deg)`
}

if(emotion==="existential"){
el.style.transform=
`rotate(${Math.random()*1440}deg)`
}

});

}

setInterval(chaosMove,900);
Enter fullscreen mode Exit fullscreen mode

Fake Python Execution Layer

The browser obviously cannot run Python directly.

But it can pretend to.

document
.querySelectorAll('script[type="python"]')
.forEach(code=>{

console.log("Running Python (emotionally):");

console.log(code.textContent);

});
Enter fullscreen mode Exit fullscreen mode

This creates the illusion of a browser-based polyglot runtime.

Which is completely unnecessary.


How I Built It

The system combines several technologies that were never intended to cooperate in this way:

HTML

Acts as the host container for the entire chaos runtime.

CSS

Used incorrectly as a geometry and border computation layer.

SVG

Provides shape mutation and dynamic geometry instability.

JavaScript

Runs the Emotional Runtime Engine, which randomly changes system states.

Polyglot Embedding

Multiple language fragments are embedded inside the HTML:

  • Python
  • SQL
  • Bash
  • YAML

They are not executed.

They simply exist together in one page, forming what I like to call an HTML Buffet.


System Architecture

HTML
 ↓
CSS Geometry Layer
 ↓
SVG Mutation Engine
 ↓
JavaScript Emotional Runtime
 ↓
Polyglot Language Buffet
Enter fullscreen mode Exit fullscreen mode

This stack ensures the page is always technically active but functionally pointless.


Prize Category

Community Favorite

Because if this project wins anything, it will probably be because people are equally confused and amused by it.


Final Thoughts

After extensive testing we confirmed that the system successfully:

  • runs emotional runtime states
  • mutates SVG geometry
  • destabilizes UI layout
  • embeds multiple programming languages inside one HTML page

Unfortunately it does not solve any problems.

However the architecture is flexible enough that we believe it may eventually discover a purpose.

Possibly.

Maybe.

We’ll find something.

Top comments (0)