← Demos
Web Pages · Hello World

Hello World Flowers

by Paige Hogberg Aug 30, 2026 4 views 6.2 KB
Sandbox · hello-world-flowers · 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 Garden</title>
<style>
  * { box-sizing: border-box; }
  html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
  body {
    font-family: Georgia, "Times New Roman", serif;
    color: #fffdf1;
    background:
      radial-gradient(circle at 50% 12%, #ffe8a3 0 3%, transparent 22%),
      linear-gradient(#92d8e4 0%, #b8e9df 46%, #72b779 47%, #254f3a 100%);
    cursor: crosshair;
  }
  main { position: relative; width: 100%; height: 100%; overflow: hidden; }
  .sun {
    position: absolute; width: 9rem; height: 9rem; border-radius: 50%;
    top: 7vh; right: 12vw;
    background: #fff1aa;
    box-shadow: 0 0 55px 18px rgba(255,237,158,.45);
    opacity: .88;
  }
  .title {
    position: absolute; z-index: 5; top: 10vh; left: 50%;
    transform: translateX(-50%); text-align: center; width: 90%;
    text-shadow: 0 3px 14px rgba(27,75,58,.3);
  }
  h1 { margin: 0; font-size: clamp(3rem, 9vw, 7rem); letter-spacing: .02em; font-weight: 400; }
  .hint { margin: .7rem 0 0; font: 600 clamp(.8rem, 1.8vw, 1rem)/1.4 system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; opacity: .88; }
  .hill {
    position: absolute; left: -10%; width: 120%; height: 48%;
    bottom: -25%; border-radius: 50% 50% 0 0;
    background: linear-gradient(130deg, #5d9d5c, #2f6846 60%, #1e493b);
  }
  .hill.back { bottom: -30%; left: -25%; background: #4e8b5c; opacity: .72; }
  .flower {
    --size: .62;
    position: absolute; z-index: 3; bottom: 19%;
    left: var(--x); width: 4.5rem; height: 13rem;
    transform: translateX(-50%) scale(var(--size));
    transform-origin: bottom center;
    transition: transform .18s ease-out;
    filter: drop-shadow(0 5px 3px rgba(16,55,35,.2));
  }
  .stem {
    position: absolute; bottom: 0; left: 50%; width: .42rem; height: 9rem;
    transform: translateX(-50%); border-radius: 1rem;
    background: linear-gradient(90deg, #286342, #76b75f, #24593c);
  }
  .stem:before, .stem:after {
    content: ""; position: absolute; width: 2.6rem; height: 1rem;
    background: #4e9a52; border-radius: 100% 0 100% 0;
  }
  .stem:before { left: -.35rem; top: 4.3rem; transform: rotate(28deg); }
  .stem:after { right: -.35rem; top: 6rem; transform: scaleX(-1) rotate(28deg); }
  .head {
    position: absolute; left: 50%; top: 0; width: 4.5rem; height: 4.5rem;
    transform: translateX(-50%);
  }
  .petal {
    position: absolute; left: 50%; top: 50%; width: 1.65rem; height: 2.5rem;
    border-radius: 65% 65% 50% 50%; transform-origin: 50% 100%;
    background: var(--petal, #ff91a8);
    box-shadow: inset -5px -5px 8px rgba(0,0,0,.1);
  }
  .petal:nth-child(1) { transform: translate(-50%, -100%) rotate(0deg); }
  .petal:nth-child(2) { transform: translate(-50%, -100%) rotate(72deg); }
  .petal:nth-child(3) { transform: translate(-50%, -100%) rotate(144deg); }
  .petal:nth-child(4) { transform: translate(-50%, -100%) rotate(216deg); }
  .petal:nth-child(5) { transform: translate(-50%, -100%) rotate(288deg); }
  .center {
    position: absolute; z-index: 2; left: 50%; top: 50%;
    width: 1.35rem; height: 1.35rem; transform: translate(-50%,-50%);
    border-radius: 50%; background: #ffd15c;
    box-shadow: inset 0 0 0 5px #e9a83e, 0 2px 4px rgba(0,0,0,.2);
  }
  .flower:nth-of-type(2n) { bottom: 15%; }
  .flower:nth-of-type(3n) { bottom: 22%; }
  .flower:nth-of-type(4n) { bottom: 12%; }
  .firefly {
    position: absolute; z-index: 2; width: .35rem; height: .35rem;
    border-radius: 50%; background: #fff4a5; box-shadow: 0 0 13px 5px #fff0a0;
    animation: float 5s ease-in-out infinite alternate;
  }
  .f1 { left: 16%; top: 32%; } .f2 { left: 78%; top: 37%; animation-delay: 1s; }
  .f3 { left: 67%; top: 53%; animation-delay: 2.3s; } .f4 { left: 30%; top: 48%; animation-delay: .6s; }
  @keyframes float { to { transform: translate(18px,-22px); opacity: .35; } }
  @media (max-width: 600px) {
    .sun { width: 6rem; height: 6rem; top: 8vh; right: 5vw; }
    .title { top: 11vh; }
    .flower { bottom: 18%; }
    .flower:nth-of-type(2n) { bottom: 13%; }
    .flower:nth-of-type(3n) { bottom: 21%; }
  }
</style>
</head>
<body>
<main id="garden" aria-label="A flower garden. Move your pointer close to a flower to help it grow.">
  <div class="sun"></div>
  <div class="title">
    <h1>Hello, world!</h1>
    <p class="hint">Move gently through the garden</p>
  </div>
  <div class="hill back"></div>
  <div class="hill"></div>
  <i class="firefly f1"></i><i class="firefly f2"></i><i class="firefly f3"></i><i class="firefly f4"></i>
</main>
<script>
  const garden = document.querySelector("#garden");
  const colors = ["#ff91a8", "#ffd36e", "#c8a3ff", "#f58c61", "#f4a9d0", "#fff0a0", "#9edcff", "#ff9bba"];
  const positions = [8, 19, 31, 43, 55, 67, 78, 90];
  const flowers = positions.map((x, i) => {
    const flower = document.createElement("div");
    flower.className = "flower";
    flower.style.setProperty("--x", x + "%");
    flower.style.setProperty("--petal", colors[i]);
    flower.innerHTML = `<div class="stem"></div><div class="head">
      <b class="petal"></b><b class="petal"></b><b class="petal"></b><b class="petal"></b><b class="petal"></b><em class="center"></em>
    </div>`;
    garden.appendChild(flower);
    return flower;
  });

  let pointer = { x: -1000, y: -1000 };
  let active = false;
  function move(e) {
    pointer.x = e.clientX;
    pointer.y = e.clientY;
    active = true;
  }
  function reset() { active = false; }
  garden.addEventListener("pointermove", move);
  garden.addEventListener("pointerleave", reset);

  function grow() {
    flowers.forEach(flower => {
      const box = flower.getBoundingClientRect();
      const x = box.left + box.width / 2, y = box.top + box.height * .25;
      const distance = Math.hypot(pointer.x - x, pointer.y - y);
      const closeness = active ? Math.max(0, 1 - distance / 180) : 0;
      flower.style.setProperty("--size", (.58 + closeness * .48).toFixed(2));
    });
    requestAnimationFrame(grow);
  }
  grow();
</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 Paige Hogberg. 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.