← Demos
Web Pages · Hello World

Hello World

A page that says hello world with interaction

by Maci Meurer Aug 29, 2026 4 views 4.9 KB
Sandbox · hello-world-4 · no access to your account
View source — the whole page is this one file
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello World</title>
<style>
  :root {
    color-scheme: dark;
    --ink: #f7f8ff;
    --muted: #aab1ca;
    --a: #8b7cff;
    --b: #55e4c2;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: var(--ink);
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
    background:
      radial-gradient(circle at var(--x, 50%) var(--y, 35%), #29305c 0, transparent 34rem),
      linear-gradient(135deg, #101322, #17142b 55%, #0b2028);
  }
  main {
    width: min(90vw, 760px);
    text-align: center;
    position: relative;
    isolation: isolate;
  }
  .eyebrow {
    color: var(--b);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
  }
  h1 {
    margin: .35rem 0 1rem;
    font-size: clamp(4rem, 16vw, 9rem);
    line-height: .9;
    letter-spacing: -.08em;
    background: linear-gradient(100deg, #fff 15%, var(--b), var(--a) 75%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: float 5s ease-in-out infinite;
  }
  p {
    margin: 0 auto 2rem;
    max-width: 34rem;
    color: var(--muted);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
  }
  button {
    border: 0;
    border-radius: 999px;
    padding: .9rem 1.35rem;
    color: #101322;
    background: linear-gradient(100deg, var(--b), #b3f8e4);
    font: 700 1rem inherit;
    cursor: pointer;
    box-shadow: 0 0 0 0 #55e4c244, 0 10px 30px #0004;
    transition: transform .2s, box-shadow .2s;
  }
  button:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 0 0 8px #55e4c222, 0 14px 35px #0006; }
  button:active { transform: translateY(0) scale(.98); }
  button:focus-visible { outline: 3px solid white; outline-offset: 5px; }
  .orb {
    position: fixed;
    z-index: -1;
    width: 18rem;
    height: 18rem;
    left: 50%;
    top: 52%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #8b7cff66, #55e4c233);
    filter: blur(2px);
    opacity: .7;
    animation: breathe 7s ease-in-out infinite;
  }
  .spark {
    position: fixed;
    pointer-events: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--b);
    animation: pop .7s ease-out forwards;
  }
  .count { color: var(--b); font-weight: 700; }
  @keyframes float { 50% { transform: translateY(-10px) rotate(-1deg); } }
  @keyframes breathe { 50% { transform: translate(-50%, -50%) scale(1.2); opacity: .4; } }
  @keyframes pop { to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  }
</style>
</head>
<body>
  <div class="orb" aria-hidden="true"></div>
  <main>
    <div class="eyebrow">A tiny beginning</div>
    <h1 id="hello">Hello<br>World</h1>
    <p id="message">The universe is a little more interesting now that you're here.</p>
    <button id="button" type="button">Say hello back <span aria-hidden="true">↗</span></button>
    <p aria-live="polite" style="margin-top:1.25rem;font-size:.9rem">Greetings: <span class="count">0</span></p>
  </main>
<script>
  const greetings = [
    ["Hello<br>World", "The universe is a little more interesting now that you're here."],
    ["Hi<br>there", "Nice to meet you, internet wanderer."],
    ["Hey<br>you", "You just made this page smile."],
    ["Hola<br>mundo", "A warm hello, with a little extra sparkle."],
    ["Bonjour<br>monde", "Small words can open very big doors."]
  ];
  const title = document.querySelector("#hello");
  const message = document.querySelector("#message");
  const button = document.querySelector("#button");
  const count = document.querySelector(".count");
  let index = 0, total = 0;

  function spark(x, y) {
    const dot = document.createElement("i");
    dot.className = "spark";
    dot.style.left = x + "px";
    dot.style.top = y + "px";
    dot.style.setProperty("--dx", (Math.random() * 100 - 50) + "px");
    dot.style.setProperty("--dy", (Math.random() * -100 - 20) + "px");
    document.body.append(dot);
    dot.addEventListener("animationend", () => dot.remove());
  }
  button.addEventListener("click", e => {
    index = (index + 1) % greetings.length;
    total++;
    title.innerHTML = greetings[index][0];
    message.textContent = greetings[index][1];
    count.textContent = total;
    for (let i = 0; i < 10; i++) spark(e.clientX, e.clientY);
  });
  document.addEventListener("pointermove", e => {
    document.body.style.setProperty("--x", e.clientX + "px");
    document.body.style.setProperty("--y", e.clientY + "px");
  });
</script>
</body>
</html>

Reaches out to

Nothing. This page is entirely self-contained and contacts no other website when it runs.

Licence

Published on Globefin under the MIT License. You may copy, change, and reuse this page, including commercially — just keep the notice below with it.

Copyright © 2026 Maci Meurer. Licensed under the MIT License. Published on Globefin.

Provided as is, without warranty. Any external libraries it loads keep their own licences. Terms →

Sandbox

Scripts run, but the demo has its own throwaway origin. It can't read your session or cookies, can't reach the page around it, and can't navigate your tab. Don't enter real passwords or personal data into any demo.