# Lowtide tide table hero with a live sea

> A dark harbour hero where about fifty stacked wave lines rise and fall with a real tide formula, with a live height readout and a 24-hour curve.

- Category: SaaS
- Version: 1.0
- Source: https://ownlyplans.com/bhaskar/lowtide-tide-table-hero-with-a-live-sea/

## Overview

A single-file hero for a tide table service. The sea is a canvas of stacked, filled wave lines that rise and fall with a two-wave tide formula keyed to the real clock. The bottom strip shows the current height, whether the tide is rising or falling, and a 24-hour curve with a dashed now line. Only Google Fonts load from outside; everything else is inline, so it works in the live preview. The numbers are demo data: swap level() for your own harbour predictions.

## Tech stack

- Canvas
- CSS
- HTML
- JavaScript
- SVG

## Build steps

### 1. Set the palette, type and layout

Pick a deep harbour palette and one serif for the headline. Keep the copy on the left and the live data along the bottom, so the sea can fill the right side.

Prompt:

```text
Create a single-file HTML hero for Lowtide, a tide table service for working harbours. Colours: ink #0a1c22, deep #12333b, sea #2f7f86, foam #e8f0e6, buoy yellow #f4c542. Fonts: Fraunces for the headline and Hanken Grotesk for everything else, loaded from Google Fonts with Georgia and system-ui fallbacks. Layout: a top bar with a wave logo, three links and a Sign in pill; a left-aligned headline "The harbour at six is not the harbour at noon." with "noon." in buoy yellow; one lead paragraph limited to 46 characters wide; two buttons (Open today's tides, Add your harbour); and an empty strip along the bottom for a live tide reading. No centred text. Keep it responsive and keep visible keyboard focus.
```

**Done when:** The page shows the bar, the headline, the copy, both buttons and an empty bottom strip, all readable on a dark background.

### 2. Draw the sea on a canvas

Fill the screen with stacked wavy lines. Each row is a filled shape, so rows in front hide rows behind, which gives depth. Lines get brighter toward the bottom.

Prompt:

```text
Add a full-screen canvas behind the content. Draw one row every 15px starting 20% down the screen. For each row build a wave from three summed sine waves with different frequencies that drift with time, fill below it with a dark teal that gets slightly lighter toward the bottom, then stroke the top edge with a colour that goes from sea teal to foam and gets brighter toward the bottom. Redraw with requestAnimationFrame and size the canvas for devicePixelRatio up to 2. Add a left-to-right dark gradient over the canvas so the headline stays readable.
```

**Done when:** A calm field of fine lines moves across the right side of the screen and the headline stays easy to read.

### 3. Drive the sea with the real tide

Use a simple two-wave tide formula tied to the clock. The same number moves the waves and fills the readout, so what you read matches what you see.

Prompt:

```text
Write level(t) with a 12h25m semi-diurnal period P: 1.1 + 0.82*sin(2*PI*t/P + 0.6) + 0.18*sin(2*PI*t/(2.03*P) + 1.9). Show level(Date.now()) bottom-left as a large serif number with a small "m" unit and the word rising or falling underneath, updated every 15 seconds. Scale the canvas wave amplitude with the current level so the sea looks higher at high tide. Add a small yellow buoy that bobs on one row with a faint pulsing ring. Mark the data as demo values to replace with real predictions.
```

**Done when:** The reading shows a height such as 0.41 m with rising or falling, and the waves are taller at high tide than at low tide.

### 4. Add the 24-hour curve and the phone layout

A small curve next to the number shows what is coming. Then tidy the phone layout and respect reduced motion.

Prompt:

```text
Draw a 24-hour tide curve in SVG beside the reading, from 3 hours ago to 21 hours ahead, with a dashed vertical now line, a yellow dot on the curve and hour labels every 6 hours. Set the SVG viewBox from its real pixel width on load and on resize so the text is never stretched. Make rows near the pointer bend slightly. At 760px and below hide the text links, stack the bottom strip, make the buttons full width and push the copy to the bottom of the screen. If prefers-reduced-motion is set, draw one still frame.
```

**Done when:** The curve and the now dot appear, resizing the window redraws it cleanly, and on a phone nothing scrolls sideways.

## Assets

### lowtide-hero.html — The finished file. Open it in a browser.

```
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="theme-color" content="#0a1c22">
<title>Lowtide · Tide tables for working harbours</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=Hanken+Grotesk:wght@400;500;600&display=swap">
<style>
:root{--ink:#0a1c22;--deep:#12333b;--sea:#2f7f86;--foam:#e8f0e6;--buoy:#f4c542;--mute:#8fb0b0;
--serif:"Fraunces",Georgia,"Times New Roman",serif;--sans:"Hanken Grotesk",system-ui,-apple-system,"Segoe UI",sans-serif}
*{box-sizing:border-box;margin:0}
html,body{height:100%;background:var(--ink);color:var(--foam);font-family:var(--sans);-webkit-font-smoothing:antialiased}
.hero{position:relative;min-height:100vh;min-height:100svh;overflow:hidden;display:grid;grid-template-rows:auto 1fr auto}
canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.veil{position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,28,34,.92) 0%,rgba(10,28,34,.55) 42%,rgba(10,28,34,0) 70%),linear-gradient(0deg,rgba(10,28,34,.85),rgba(10,28,34,0) 38%);pointer-events:none}
header,main,footer{position:relative;z-index:2;padding-inline:clamp(20px,5vw,72px)}
header{display:flex;justify-content:space-between;align-items:center;padding-block:26px}
.logo{display:flex;align-items:center;gap:10px;font-family:var(--serif);font-size:22px;font-weight:600;letter-spacing:-.01em;color:var(--foam);text-decoration:none}
.logo i{width:22px;height:22px;display:block}
nav{display:flex;gap:28px;align-items:center;font-size:15px}
nav a{color:var(--mute);text-decoration:none}
nav a:hover,nav a:focus-visible{color:var(--foam)}
nav .pill{color:var(--ink);background:var(--foam);padding:9px 16px;border-radius:999px;font-weight:600}
nav .pill:hover{background:var(--buoy);color:var(--ink)}
a:focus-visible,button:focus-visible{outline:2px solid var(--buoy);outline-offset:3px;border-radius:6px}
main{display:flex;flex-direction:column;justify-content:center;max-width:820px;padding-block:24px}
h1{font-family:var(--serif);font-weight:400;font-size:clamp(40px,7.2vw,96px);line-height:1.02;letter-spacing:-.03em;font-variation-settings:"opsz" 144}
h1 em{font-style:normal;color:var(--buoy)}
.lead{margin-top:26px;max-width:46ch;font-size:clamp(16px,1.5vw,19px);line-height:1.6;color:#b9d0cf}
.cta{display:flex;flex-wrap:wrap;gap:12px;margin-top:34px}
.btn{font:600 15px/1 var(--sans);padding:15px 22px;border-radius:12px;text-decoration:none;border:1px solid transparent;cursor:pointer}
.btn.main{background:var(--buoy);color:var(--ink)}
.btn.main:hover{background:#ffd75f}
.btn.ghost{color:var(--foam);border-color:rgba(232,240,230,.28);background:rgba(10,28,34,.4)}
.btn.ghost:hover{border-color:var(--foam)}
footer{padding-block:0 28px;display:grid;grid-template-columns:auto 1fr;gap:clamp(20px,4vw,56px);align-items:end}
.now{display:grid;gap:4px}
.now small{font-size:13px;color:var(--mute)}
.now b{font-family:var(--serif);font-weight:400;font-size:clamp(44px,6vw,76px);line-height:1;letter-spacing:-.03em}
.now b .u{font-size:.38em;color:var(--mute);margin-left:6px;letter-spacing:0}
.now em{font-style:normal;font-size:14px;color:var(--buoy)}
.curve{position:relative;height:96px;min-width:0;width:100%}
.curve svg{width:100%;height:100%;overflow:visible}
.curve text{font:500 11px var(--sans);fill:var(--mute)}
@media (max-width:760px){
 nav a:not(.pill){display:none}
 .veil{background:linear-gradient(0deg,rgba(10,28,34,.9) 0%,rgba(10,28,34,.35) 55%,rgba(10,28,34,.7) 100%)}
 main{justify-content:flex-end;padding-bottom:12px}
 footer{grid-template-columns:1fr;gap:14px}
 .curve{height:70px}
 .btn{flex:1 1 auto;text-align:center}
}
@media (prefers-reduced-motion:reduce){.hero{--still:1}}
</style>
</head>
<body>
<section class="hero" id="hero">
<canvas id="sea" aria-hidden="true"></canvas>
<div class="veil"></div>
<header>
 <a class="logo" href="#"><svg class="i" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="#f4c542" stroke-width="2" stroke-linecap="round"><path d="M2 9c3-3 5 3 8 0s5 3 8 0 3 0 4-1M2 16c3-3 5 3 8 0s5 3 8 0 3 0 4-1"/></svg>Lowtide</a>
 <nav><a href="#">Harbours</a><a href="#">How it works</a><a href="#">For pilots</a><a class="pill" href="#">Sign in</a></nav>
</header>
<main>
 <h1>The harbour at six is not the harbour at <em>noon.</em></h1>
 <p class="lead">Tide tables for working ports, cut down to what a skipper needs before the engine starts: when the water turns, how deep the channel is, and when it is safe to cross the bar.</p>
 <div class="cta"><a class="btn main" href="#">Open today's tides</a><a class="btn ghost" href="#">Add your harbour</a></div>
</main>
<footer>
 <div class="now" aria-live="off"><small>Visakhapatnam outer harbour, now</small><b><span id="h">0.00</span><span class="u">m</span></b><em id="trend">rising</em></div>
 <div class="curve"><svg id="curve" viewBox="0 0 600 96" role="img" aria-label="Tide height over the next 24 hours"></svg></div>
</footer>
</section>
<script>
(function(){
var c=document.getElementById('sea'),x=c.getContext('2d'),W,H,DPR,reduce=matchMedia('(prefers-reduced-motion:reduce)').matches;
var P=12.4208*3600e3; // semi-diurnal period in ms
function level(t){return 1.1+0.82*Math.sin(2*Math.PI*t/P+0.6)+0.18*Math.sin(2*Math.PI*t/(P*2.03)+1.9)}
function size(){DPR=Math.min(2,devicePixelRatio||1);W=c.clientWidth;H=c.clientHeight;c.width=W*DPR;c.height=H*DPR;x.setTransform(DPR,0,0,DPR,0,0)}
addEventListener('resize',size);size();
var px=.5,py=.5,tx=.5,ty=.5;
addEventListener('pointermove',function(e){tx=e.clientX/W;ty=e.clientY/H},{passive:true});
function draw(ms){
 var t=ms/1000,now=Date.now(),lv=level(now);
 x.clearRect(0,0,W,H);
 px+=(tx-px)*.05;py+=(ty-py)*.05;
 var rows=Math.round(H/15),base=H*.2,span=H*.82;
 for(var r=0;r<rows;r++){
  var k=r/(rows-1),y0=base+k*span;
  x.beginPath();
  var amp=(8+k*34)*(0.75+0.5*(lv/2));
  for(var i=0;i<=W;i+=10){
   var u=i/W,
    w=Math.sin(u*5+t*.35*(reduce?0:1)+k*6)*.55+Math.sin(u*11-t*.22*(reduce?0:1)+k*3.1)*.3+Math.sin(u*2.2+t*.12*(reduce?0:1)+k*9)*.5,
    d=Math.exp(-Math.pow((u-px)*3.2,2))*(1-Math.abs(k-py))*14;
   var y=y0+w*amp-d*(r%2?1:-1)*0.4;
   i?x.lineTo(i,y):x.moveTo(i,y);
  }
  x.lineTo(W,H+20);x.lineTo(0,H+20);x.closePath();
  x.fillStyle='rgb('+(10+k*6|0)+','+(28+k*14|0)+','+(34+k*18|0)+')';x.fill();
  x.lineWidth=1.1;
  x.strokeStyle='rgba('+(47+k*185|0)+','+(127+k*113|0)+','+(134+k*96|0)+','+(0.32+k*.65)+')';x.stroke();
 }
 // buoy bobbing on the front rows
 var bx=W*.78,by=base+span*.52+Math.sin(t*.9)*5;
 x.fillStyle='#f4c542';x.beginPath();x.arc(bx,by,6,0,7);x.fill();
 x.strokeStyle='rgba(244,197,66,.35)';x.lineWidth=1;x.beginPath();x.arc(bx,by,12+Math.sin(t*1.4)*2,0,7);x.stroke();
 if(!reduce)requestAnimationFrame(draw)
}
requestAnimationFrame(draw);
// readout + 24h curve
var hEl=document.getElementById('h'),tr=document.getElementById('trend'),svg=document.getElementById('curve');
function readout(){var n=Date.now(),a=level(n),b=level(n+6e4);hEl.textContent=a.toFixed(2);tr.textContent=b>a?'rising':'falling'}
function curve(){
 var VW=Math.max(200,svg.clientWidth),VH=96,n=Date.now(),s=n-3*3600e3,e=n+21*3600e3,pts=[],mn=9,mx=-9,i,v;
 svg.setAttribute('viewBox','0 0 '+VW+' '+VH);
 for(i=0;i<=96;i++){v=level(s+(e-s)*i/96);mn=Math.min(mn,v);mx=Math.max(mx,v);pts.push(v)}
 var d='',nx=VW*3/24;
 pts.forEach(function(v,i){d+=(i?'L':'M')+(i/96*VW).toFixed(1)+' '+(78-(v-mn)/(mx-mn)*62).toFixed(1)});
 var ny=78-(level(n)-mn)/(mx-mn)*62,lab='';
 for(var hr=0;hr<=21;hr+=6){var dt=new Date(n+hr*3600e3);lab+='<text x="'+((hr+3)/24*VW)+'" y="94" text-anchor="middle">'+(hr?String(dt.getHours()).padStart(2,'0')+':00':'now')+'</text>'}
 svg.innerHTML='<path d="'+d+'L'+VW+' 82L0 82Z" fill="rgba(47,127,134,.25)"/><path d="'+d+'" fill="none" stroke="#e8f0e6" stroke-width="1.6"/><line x1="'+nx+'" x2="'+nx+'" y1="4" y2="82" stroke="rgba(244,197,66,.5)" stroke-dasharray="3 4"/><circle cx="'+nx+'" cy="'+ny+'" r="5" fill="#f4c542"/>'+lab;
}
readout();curve();setInterval(readout,15000);setInterval(curve,300000);addEventListener("resize",curve);
})();
</script>
</body>
</html>
```


## Build instructions by tool

### Claude Code

Open a terminal in an empty folder, run `claude`, then paste the prompt.

```text
Build the "Lowtide tide table hero with a live sea" app from the OwnlyPlans blueprint at https://ownlyplans.com/bhaskar/lowtide-tide-table-hero-with-a-live-sea/.
Stack: Canvas, CSS, HTML, JavaScript, SVG.
Follow the plan's steps in order: Set the palette, type and layout → Draw the sea on a canvas → Drive the sea with the real tide → Add the 24-hour curve and the phone layout.
Download the full plan (Markdown) from the link above and keep it in the project root as PLAN.md.
Ask me before adding anything not in the plan. (Prepared for Claude Code.)
```

### Cursor

Open an empty folder in Cursor, start an Agent chat, then paste the prompt.

```text
Build the "Lowtide tide table hero with a live sea" app from the OwnlyPlans blueprint at https://ownlyplans.com/bhaskar/lowtide-tide-table-hero-with-a-live-sea/.
Stack: Canvas, CSS, HTML, JavaScript, SVG.
Follow the plan's steps in order: Set the palette, type and layout → Draw the sea on a canvas → Drive the sea with the real tide → Add the 24-hour curve and the phone layout.
Download the full plan (Markdown) from the link above and keep it in the project root as PLAN.md.
Ask me before adding anything not in the plan. (Prepared for Cursor.)
```

### Lovable

Start a new Lovable project and paste the prompt as your first message.

```text
Build the "Lowtide tide table hero with a live sea" app from the OwnlyPlans blueprint at https://ownlyplans.com/bhaskar/lowtide-tide-table-hero-with-a-live-sea/.
Stack: Canvas, CSS, HTML, JavaScript, SVG.
Follow the plan's steps in order: Set the palette, type and layout → Draw the sea on a canvas → Drive the sea with the real tide → Add the 24-hour curve and the phone layout.
Download the full plan (Markdown) from the link above and keep it in the project root as PLAN.md.
Ask me before adding anything not in the plan. (Prepared for Lovable.)
```

## Definition of done

- Every build step is complete and the app runs locally.
- The main user flow works end to end.
- Share your build on OwnlyPlans with a demo link, build time and tool.
