← Demos
Web Pages · Hello World

Hello World

by Ciara Gilley Aug 31, 2026 4 views 9.2 KB
Sandbox · hello-world-5 · no access to your account
View source — the whole page is this one file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello, World!</title>
<style>
  :root{
    --sky-top:#4a90d9;
    --sky-bottom:#bfe3ff;
    --ink:#1f2d3d;
    --paper:#ffffff;
    --accent:#ff6b6b;
    --found:#4CAF50;
    --select:#ffd54f;
  }
  *{box-sizing:border-box;}
  body{
    margin:0;
    min-height:100vh;
    font-family:'Trebuchet MS', 'Segoe UI', sans-serif;
    background:linear-gradient(to bottom, var(--sky-top), var(--sky-bottom) 70%, #eafaf1 70%);
    display:flex;
    flex-direction:column;
    align-items:center;
    overflow-x:hidden;
    color:var(--ink);
  }

  /* ---------- SKY SCENE ---------- */
  .sky{
    position:relative;
    width:100%;
    height:220px;
    overflow:hidden;
  }
  .cloud{
    position:absolute;
    background:rgba(255,255,255,0.85);
    border-radius:50px;
    opacity:0.9;
  }
  .cloud::before, .cloud::after{
    content:"";
    position:absolute;
    background:inherit;
    border-radius:50%;
  }
  .cloud1{width:90px;height:30px; top:30px; left:10%; animation:drift 40s linear infinite;}
  .cloud1::before{width:50px;height:50px; top:-20px; left:10px;}
  .cloud1::after{width:40px;height:40px; top:-15px; left:45px;}

  .cloud2{width:70px;height:24px; top:90px; left:60%; animation:drift 55s linear infinite;}
  .cloud2::before{width:40px;height:40px; top:-15px; left:8px;}
  .cloud2::after{width:30px;height:30px; top:-10px; left:35px;}

  .cloud3{width:60px;height:20px; top:150px; left:30%; animation:drift 65s linear infinite;}
  .cloud3::before{width:34px;height:34px; top:-12px; left:6px;}
  .cloud3::after{width:26px;height:26px; top:-8px; left:30px;}

  @keyframes drift{
    from{transform:translateX(0);}
    to{transform:translateX(120vw);}
  }

  .plane-wrap{
    position:absolute;
    top:55px;
    left:-180px;
    animation:fly-in 3.5s ease-out forwards, bob 3s ease-in-out 3.5s infinite;
    font-size:54px;
    line-height:1;
    filter:drop-shadow(0 6px 6px rgba(0,0,0,0.25));
  }
  @keyframes fly-in{
    0%{ left:-180px; transform:translateY(0) rotate(-8deg); }
    70%{ left:58%; transform:translateY(-6px) rotate(0deg); }
    100%{ left:50%; transform:translateY(0) rotate(0deg); }
  }
  @keyframes bob{
    0%,100%{ transform:translateY(0) rotate(0deg); }
    50%{ transform:translateY(-8px) rotate(2deg); }
  }

  .banner{
    position:absolute;
    top:78px;
    left:50%;
    transform:translateX(-50%);
    white-space:nowrap;
    display:flex;
    gap:2px;
  }
  .banner span{
    display:inline-block;
    font-size:34px;
    font-weight:800;
    color:var(--paper);
    text-shadow:0 2px 4px rgba(0,0,0,0.35), 0 0 12px rgba(255,255,255,0.4);
    opacity:0;
    transform:translateY(10px);
    animation:letter-pop 0.4s ease forwards;
  }

  @keyframes letter-pop{
    to{ opacity:1; transform:translateY(0); }
  }

  /* ---------- CONTENT ---------- */
  .content{
    text-align:center;
    padding:10px 20px 40px;
    max-width:520px;
  }
  h1{
    margin:8px 0 4px;
    font-size:26px;
  }
  p.sub{
    margin:0 0 20px;
    color:#3a4a5a;
    font-size:15px;
  }

  .puzzle-card{
    background:var(--paper);
    border-radius:16px;
    padding:20px;
    box-shadow:0 10px 25px rgba(0,0,0,0.12);
  }
  .puzzle-card h2{
    margin:0 0 4px;
    font-size:18px;
  }
  .puzzle-card p{
    margin:0 0 14px;
    font-size:13px;
    color:#5a6a7a;
  }

  .grid{
    display:grid;
    grid-template-columns:repeat(8, 34px);
    grid-template-rows:repeat(8, 34px);
    gap:3px;
    justify-content:center;
    margin:0 auto 16px;
    user-select:none;
  }
  .cell{
    display:flex;
    align-items:center;
    justify-content:center;
    background:#f2f5f8;
    border-radius:6px;
    font-weight:700;
    font-size:15px;
    cursor:pointer;
    transition:background 0.15s, transform 0.1s;
    color:var(--ink);
  }
  .cell:hover{ background:#e3ecf5; }
  .cell.selected{ background:var(--select); }
  .cell.found{ background:var(--found); color:white; }

  .word-list{
    display:flex;
    gap:10px;
    justify-content:center;
    font-size:14px;
    font-weight:700;
    letter-spacing:1px;
  }
  .word-list span{
    padding:4px 10px;
    border-radius:20px;
    background:#eef1f4;
    color:#8a97a3;
    transition:all 0.25s;
  }
  .word-list span.done{
    background:var(--found);
    color:white;
    text-decoration:line-through;
  }

  .celebrate{
    margin-top:16px;
    font-size:15px;
    font-weight:700;
    color:var(--accent);
    opacity:0;
    transition:opacity 0.4s;
  }
  .celebrate.show{ opacity:1; }

  footer{
    padding:14px;
    font-size:12px;
    color:#4a4a4a;
  }
</style>
</head>
<body>

  <div class="sky">
    <div class="cloud cloud1"></div>
    <div class="cloud cloud2"></div>
    <div class="cloud cloud3"></div>
    <div class="plane-wrap">✈️</div>
    <div class="banner" id="banner"></div>
  </div>

  <div class="content">
    <h1>Welcome aboard 👋</h1>
    <p class="sub">A little plane just wrote it in the sky. Now find those two words hiding below.</p>

    <div class="puzzle-card">
      <h2>Mini Word Search</h2>
      <p>Click and drag across letters to find <strong>HELLO</strong> and <strong>WORLD</strong>.</p>

      <div class="grid" id="grid"></div>

      <div class="word-list">
        <span id="w-hello">HELLO</span>
        <span id="w-world">WORLD</span>
      </div>

      <div class="celebrate" id="celebrate">🎉 You found them both — hello, world indeed!</div>
    </div>
  </div>

  <footer>made with a tiny bit of aviation and a tiny bit of vocabulary</footer>

<script>
  // Fly the banner text in, letter by letter, after the plane arrives
  const bannerText = "Hello, World!";
  const bannerEl = document.getElementById('banner');
  [...bannerText].forEach((ch, i) => {
    const s = document.createElement('span');
    s.textContent = ch === " " ? "\u00A0" : ch;
    s.style.animationDelay = (3.5 + i * 0.06) + "s";
    bannerEl.appendChild(s);
  });

  // ---------- Word search ----------
  const rows = [
    "QWKJFTNB",
    "HELLOXRM",
    "ZYUIPASD",
    "GKJHFQWE",
    "RTYUIOPA",
    "WORLDNMB",
    "SDFGHJKL",
    "QAZXCVBN"
  ];

  const gridEl = document.getElementById('grid');
  const cells = [];

  rows.forEach((rowStr, r) => {
    [...rowStr].forEach((ch, c) => {
      const div = document.createElement('div');
      div.className = 'cell';
      div.textContent = ch;
      div.dataset.r = r;
      div.dataset.c = c;
      gridEl.appendChild(div);
      cells.push(div);
    });
  });

  const words = {
    HELLO: { found: false, cells: [] },
    WORLD: { found: false, cells: [] }
  };

  let selecting = false;
  let selection = [];

  function cellAt(r, c){
    return cells.find(cell => +cell.dataset.r === r && +cell.dataset.c === c);
  }

  function clearSelection(){
    selection.forEach(cell => {
      if (!cell.classList.contains('found')) cell.classList.remove('selected');
    });
    selection = [];
  }

  function tryMatch(){
    // Build string from selection in order, and reversed
    const letters = selection.map(cell => cell.textContent).join('');
    const reversed = [...letters].reverse().join('');

    for (const word of Object.keys(words)){
      if (words[word].found) continue;
      if (letters === word || reversed === word){
        words[word].found = true;
        selection.forEach(cell => {
          cell.classList.add('found');
          cell.classList.remove('selected');
        });
        document.getElementById('w-' + word.toLowerCase()).classList.add('done');
      }
    }

    if (Object.values(words).every(w => w.found)){
      document.getElementById('celebrate').classList.add('show');
    }
  }

  function handleStart(cell){
    selecting = true;
    clearSelection();
    selection = [cell];
    cell.classList.add('selected');
  }

  function handleEnter(cell){
    if (!selecting) return;
    // Only allow straight horizontal or vertical lines from the start cell
    const start = selection[0];
    const r0 = +start.dataset.r, c0 = +start.dataset.c;
    const r1 = +cell.dataset.r, c1 = +cell.dataset.c;

    let path = [];
    if (r0 === r1){
      const step = c1 >= c0 ? 1 : -1;
      for (let c = c0; c !== c1 + step; c += step) path.push(cellAt(r0, c));
    } else if (c0 === c1){
      const step = r1 >= r0 ? 1 : -1;
      for (let r = r0; r !== r1 + step; r += step) path.push(cellAt(r, c0));
    } else {
      return; // diagonal not supported, ignore
    }

    clearSelection();
    selection = path;
    selection.forEach(c => c.classList.add('selected'));
  }

  function handleEnd(){
    if (!selecting) return;
    selecting = false;
    tryMatch();
    setTimeout(clearSelection, 150);
  }

  cells.forEach(cell => {
    cell.addEventListener('mousedown', (e) => { e.preventDefault(); handleStart(cell); });
    cell.addEventListener('mouseenter', () => handleEnter(cell));
    cell.addEventListener('touchstart', (e) => { e.preventDefault(); handleStart(cell); }, {passive:false});
    cell.addEventListener('touchmove', (e) => {
      e.preventDefault();
      const touch = e.touches[0];
      const el = document.elementFromPoint(touch.clientX, touch.clientY);
      if (el && el.classList.contains('cell')) handleEnter(el);
    }, {passive:false});
  });

  document.addEventListener('mouseup', handleEnd);
  document.addEventListener('touchend', handleEnd);
</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 Ciara Gilley. 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.