Skip to content
OwnlyPlans

lowtide-hero.html

The finished file. Open it in a browser.

Part of Lowtide tide table hero with a live sea by Admin

Download Open the item

<!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>

Source, 129 lines
<!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>

Your AI tool
Starter prompt

		

Download the plan